source: molecuilder/src/boundary.hpp@ 3f0c46

Last change on this file since 3f0c46 was 3f0c46, checked in by Frederik Heber <heber@…>, 17 years ago

Final touches for Create Clusters in water

repetition in CreateClustersinWater(), some stuff thrown out in VolumeOfConvexEnvelope (loop to throw out some more points, which does not happen if we take any appearing in at least one BoundaryPoints), some variable declarations shifted to the start of a function, BoundaryPoints are given to functions and if NULL is created by calling GetBoundaryPoints() and free'd subsequently.

  • Property mode set to 100644
File size: 3.5 KB
RevLine 
[dcf51d]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
22#define DistanceNrPair pair < double, atom* >
23#define DistanceMap multimap < double, atom* >
24#define DistanceTestPair pair < DistanceMap::iterator, bool>
25
26#define Boundaries map <double, DistanceNrPair >
27#define BoundariesPair pair<double, DistanceNrPair >
28#define BoundariesTestPair pair< Boundaries::iterator, bool>
29
30#define PointMap map < int, class BoundaryPointSet * >
31#define PointPair pair < int, class BoundaryPointSet * >
32#define PointTestPair pair < PointMap::iterator, bool >
33
34#define LineMap map < int, class BoundaryLineSet * >
35#define LinePair pair < int, class BoundaryLineSet * >
36#define LineTestPair pair < LinePair::iterator, bool >
37
38#define TriangleMap map < int, class BoundaryTriangleSet * >
39#define TrianglePair pair < int, class BoundaryTriangleSet * >
40#define TriangleTestPair pair < TrianglePair::iterator, bool >
41
42#define DistanceMultiMap multimap <double, pair < PointMap::iterator, PointMap::iterator> >
43#define DistanceMultiMapPair pair <double, pair < PointMap::iterator, PointMap::iterator> >
44
45template <typename T> void SetEndpointsOrdered(T endpoints[2], T endpoint1, T endpoint2)
46{
47 if (endpoint1->Nr < endpoint2->Nr) {
48 endpoints[0] = endpoint1;
49 endpoints[1] = endpoint2;
50 } else {
51 endpoints[0] = endpoint2;
52 endpoints[1] = endpoint1;
53 }
54};
55
56class BoundaryPointSet {
57 public:
58 BoundaryPointSet();
59 BoundaryPointSet(atom *Walker);
60 ~BoundaryPointSet();
61
62 void AddLine(class BoundaryLineSet *line);
63
64 LineMap lines;
65 int LinesCount;
66 atom *node;
67 int Nr;
68};
69
70class BoundaryLineSet {
71 public:
72 BoundaryLineSet();
73 BoundaryLineSet(class BoundaryPointSet *Point[2], int number);
74 ~BoundaryLineSet();
75
76 void AddTriangle(class BoundaryTriangleSet *triangle);
77
78 class BoundaryPointSet *endpoints[2];
79 TriangleMap triangles;
80 int TrianglesCount;
81 int Nr;
82};
83
84class BoundaryTriangleSet {
85 public:
86 BoundaryTriangleSet();
87 BoundaryTriangleSet(class BoundaryLineSet *line[3], int number);
88 ~BoundaryTriangleSet();
89
90 void GetNormalVector(vector &NormalVector);
91
92 class BoundaryPointSet *endpoints[3];
93 class BoundaryLineSet *lines[3];
94 int Nr;
95};
96
97class Tesselation {
98 public:
99
100 Tesselation();
101 ~Tesselation();
102
103 void TesselateOnBoundary(ofstream *out, config *configuration, molecule *mol);
104 void GuessStartingTriangle(ofstream *out);
105 void AddPoint(atom * Walker);
106
107 PointMap PointsOnBoundary;
108 LineMap LinesOnBoundary;
109 TriangleMap TrianglesOnBoundary;
110 class BoundaryPointSet *BPS[2];
111 class BoundaryLineSet *BLS[3];
112 class BoundaryTriangleSet *BTS;
113 int PointsOnBoundaryCount;
114 int LinesOnBoundaryCount;
115 int TrianglesOnBoundaryCount;
116};
117
118
119ostream & operator << (ostream &ost, BoundaryPointSet &a);
120ostream & operator << (ostream &ost, BoundaryLineSet &a);
121ostream & operator << (ostream &ost, BoundaryTriangleSet &a);
122
123
[7fcea6]124double VolumeOfConvexEnvelope(ofstream *out, config *configuration, Boundaries *BoundaryPoints, molecule *mol);
[3f0c46]125double * GetDiametersOfCluster(ofstream *out, Boundaries *BoundaryPtr, molecule *mol, bool IsAngstroem);
126void PrepareClustersinWater(ofstream *out, config *configuration, molecule *mol, double celldensity);
[dcf51d]127
128
129#endif /*BOUNDARY_HPP_*/
Note: See TracBrowser for help on using the repository browser.