source: molecuilder/src/boundary.hpp@ 6b3826

Last change on this file since 6b3826 was 6b3826, checked in by Christian Neuen <neuen@…>, 17 years ago

In vector a function for calculation of the vector-(cross-)product has been added.
In Boundary a new way for finding the non-convex boundary is implemented.
Currently problem with comparison of the return value of the map::find routine.

  • Property mode set to 100644
File size: 2.7 KB
Line 
1#ifndef BOUNDARY_HPP_
2#define BOUNDARY_HPP_
3
4class BoundaryPointSet;
5class BoundaryLineSet;
6class BoundaryTriangleSet;
7
8// include config.h
9#ifdef HAVE_CONFIG_H
10#include <config.h>
11#endif
12
13// STL headers
14#include <map>
15#include <set>
16#include <deque>
17
18#include <gsl/gsl_poly.h>
19
20#include "molecules.hpp"
21
22template <typename T> void SetEndpointsOrdered(T endpoints[2], T endpoint1, T endpoint2)
23{
24 if (endpoint1->Nr < endpoint2->Nr) {
25 endpoints[0] = endpoint1;
26 endpoints[1] = endpoint2;
27 } else {
28 endpoints[0] = endpoint2;
29 endpoints[1] = endpoint1;
30 }
31};
32
33class BoundaryPointSet {
34 public:
35 BoundaryPointSet();
36 BoundaryPointSet(atom *Walker);
37 ~BoundaryPointSet();
38
39 void AddLine(class BoundaryLineSet *line);
40
41 LineMap lines;
42 int LinesCount;
43 atom *node;
44 int Nr;
45};
46
47class BoundaryLineSet {
48 public:
49 BoundaryLineSet();
50 BoundaryLineSet(class BoundaryPointSet *Point[2], int number);
51 ~BoundaryLineSet();
52
53 void AddTriangle(class BoundaryTriangleSet *triangle);
54
55 class BoundaryPointSet *endpoints[2];
56 TriangleMap triangles;
57 int TrianglesCount;
58 int Nr;
59};
60
61class BoundaryTriangleSet {
62 public:
63 BoundaryTriangleSet();
64 BoundaryTriangleSet(class BoundaryLineSet *line[3], int number);
65 ~BoundaryTriangleSet();
66
67 void GetNormalVector(Vector &NormalVector);
68
69 class BoundaryPointSet *endpoints[3];
70 class BoundaryLineSet *lines[3];
71 Vector *NormalVector;
72 int Nr;
73};
74
75class Tesselation {
76 public:
77
78 Tesselation();
79 ~Tesselation();
80
81 void TesselateOnBoundary(ofstream *out, config *configuration, molecule *mol);
82 void GuessStartingTriangle(ofstream *out);
83 void AddPoint(atom * Walker);
84 void Find_starting_triangle(molecule mol, const double RADIUS);
85 void Find_next_suitable_triangle(molecule* mol, BoundaryLineSet Line, BoundaryTriangleSet T, const double& RADIUS);
86
87 PointMap PointsOnBoundary;
88 LineMap LinesOnBoundary;
89 TriangleMap TrianglesOnBoundary;
90 class BoundaryPointSet *BPS[2];
91 class BoundaryLineSet *BLS[3];
92 class BoundaryTriangleSet *BTS;
93 int PointsOnBoundaryCount;
94 int LinesOnBoundaryCount;
95 int TrianglesOnBoundaryCount;
96};
97
98
99ostream & operator << (ostream &ost, BoundaryPointSet &a);
100ostream & operator << (ostream &ost, BoundaryLineSet &a);
101ostream & operator << (ostream &ost, BoundaryTriangleSet &a);
102
103
104double VolumeOfConvexEnvelope(ofstream *out, ofstream *tecplot, config *configuration, Boundaries *BoundaryPoints, molecule *mol);
105double * GetDiametersOfCluster(ofstream *out, Boundaries *BoundaryPtr, molecule *mol, bool IsAngstroem);
106void PrepareClustersinWater(ofstream *out, config *configuration, molecule *mol, double ClusterVolume, double celldensity);
107
108
109#endif /*BOUNDARY_HPP_*/
Note: See TracBrowser for help on using the repository browser.