| [8eb17a] | 1 | #ifndef BOUNDARY_HPP_
 | 
|---|
 | 2 | #define BOUNDARY_HPP_
 | 
|---|
 | 3 | 
 | 
|---|
 | 4 | class BoundaryPointSet;
 | 
|---|
 | 5 | class BoundaryLineSet;
 | 
|---|
 | 6 | class 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 | template <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 | 
 | 
|---|
 | 33 | class BoundaryPointSet {
 | 
|---|
 | 34 |   public:
 | 
|---|
 | 35 |     BoundaryPointSet();
 | 
|---|
 | 36 |     BoundaryPointSet(atom *Walker);
 | 
|---|
 | 37 |     ~BoundaryPointSet();
 | 
|---|
| [a8bcea6] | 38 | 
 | 
|---|
| [8eb17a] | 39 |     void AddLine(class BoundaryLineSet *line);
 | 
|---|
| [a8bcea6] | 40 | 
 | 
|---|
| [8eb17a] | 41 |     LineMap lines;
 | 
|---|
 | 42 |     int LinesCount;
 | 
|---|
 | 43 |     atom *node;
 | 
|---|
 | 44 |     int Nr;
 | 
|---|
 | 45 | };
 | 
|---|
 | 46 | 
 | 
|---|
 | 47 | class 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 | 
 | 
|---|
 | 61 | class BoundaryTriangleSet {
 | 
|---|
 | 62 |   public:
 | 
|---|
 | 63 |     BoundaryTriangleSet();
 | 
|---|
 | 64 |     BoundaryTriangleSet(class BoundaryLineSet *line[3], int number);
 | 
|---|
 | 65 |     ~BoundaryTriangleSet();
 | 
|---|
| [a8bcea6] | 66 | 
 | 
|---|
| [e9b8bb] | 67 |     void GetNormalVector(Vector &NormalVector);
 | 
|---|
| [a8bcea6] | 68 | 
 | 
|---|
| [8eb17a] | 69 |     class BoundaryPointSet *endpoints[3];
 | 
|---|
 | 70 |     class BoundaryLineSet *lines[3];
 | 
|---|
| [a8bcea6] | 71 |     Vector NormalVector;
 | 
|---|
| [8eb17a] | 72 |     int Nr;
 | 
|---|
 | 73 | };
 | 
|---|
 | 74 | 
 | 
|---|
 | 75 | class Tesselation {
 | 
|---|
 | 76 |   public:
 | 
|---|
| [a8bcea6] | 77 | 
 | 
|---|
| [8eb17a] | 78 |     Tesselation();
 | 
|---|
 | 79 |     ~Tesselation();
 | 
|---|
| [a8bcea6] | 80 | 
 | 
|---|
| [8eb17a] | 81 |     void TesselateOnBoundary(ofstream *out, config *configuration, molecule *mol);
 | 
|---|
 | 82 |     void GuessStartingTriangle(ofstream *out);
 | 
|---|
 | 83 |     void AddPoint(atom * Walker);
 | 
|---|
| [caf5d6] | 84 |     void AddTrianglePoint(atom* Candidate, int n);
 | 
|---|
| [e4ea46] | 85 |     void AddTriangleLine(class BoundaryPointSet *a, class BoundaryPointSet *b, int n);
 | 
|---|
| [caf5d6] | 86 |     void AddTriangleToLines();
 | 
|---|
| [69eb71] | 87 |     void Find_starting_triangle(molecule* mol, const double RADIUS);
 | 
|---|
| [cc2ee5] | 88 |     bool Find_next_suitable_triangle(ofstream *out, ofstream *tecplot, molecule* mol, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, int N, const char *filename);
 | 
|---|
 | 89 |     bool CheckPresenceOfTriangle(ofstream *out, atom *a, atom *b, atom *c);
 | 
|---|
 | 90 |     void Find_next_suitable_point_via_Angle_of_Sphere(atom* a, atom* b, atom* c, atom* Candidate, atom* Parent, int RecursionLevel, Vector *Chord, Vector *direction1, Vector *OldNormal, Vector ReferencePoint, atom*& Opt_Candidate, double *Storage, const double RADIUS, molecule* mol);
 | 
|---|
| [a8bcea6] | 91 | 
 | 
|---|
| [8eb17a] | 92 |     PointMap PointsOnBoundary;
 | 
|---|
 | 93 |     LineMap LinesOnBoundary;
 | 
|---|
 | 94 |     TriangleMap TrianglesOnBoundary;
 | 
|---|
| [e4ea46] | 95 |     class BoundaryPointSet *TPS[3]; //this is a Storage for pointers to triangle points, this and BPS[2] needed due to AddLine restrictions
 | 
|---|
| [8eb17a] | 96 |     class BoundaryPointSet *BPS[2];
 | 
|---|
 | 97 |     class BoundaryLineSet *BLS[3];
 | 
|---|
 | 98 |     class BoundaryTriangleSet *BTS;
 | 
|---|
 | 99 |     int PointsOnBoundaryCount;
 | 
|---|
 | 100 |     int LinesOnBoundaryCount;
 | 
|---|
 | 101 |     int TrianglesOnBoundaryCount;
 | 
|---|
| [e4ea46] | 102 |     int TriangleFilesWritten;
 | 
|---|
| [8eb17a] | 103 | };
 | 
|---|
 | 104 | 
 | 
|---|
 | 105 | 
 | 
|---|
 | 106 | ostream & operator << (ostream &ost, BoundaryPointSet &a);
 | 
|---|
 | 107 | ostream & operator << (ostream &ost, BoundaryLineSet &a);
 | 
|---|
 | 108 | ostream & operator << (ostream &ost, BoundaryTriangleSet &a);
 | 
|---|
 | 109 | 
 | 
|---|
 | 110 | 
 | 
|---|
| [450d63] | 111 | double VolumeOfConvexEnvelope(ofstream *out, ofstream *tecplot, config *configuration, Boundaries *BoundaryPoints, molecule *mol);
 | 
|---|
| [318bfd] | 112 | double * GetDiametersOfCluster(ofstream *out, Boundaries *BoundaryPtr, molecule *mol, bool IsAngstroem);
 | 
|---|
| [edb650] | 113 | void PrepareClustersinWater(ofstream *out, config *configuration, molecule *mol, double ClusterVolume, double celldensity);
 | 
|---|
| [cc2ee5] | 114 | void Find_non_convex_border(ofstream *out, ofstream *tecplot, molecule* mol, const char *tempbasename, const double RADIUS);
 | 
|---|
| [a8bcea6] | 115 | void Find_next_suitable_point(atom a, atom b, atom Candidate, int n, Vector *d1, Vector *d2, atom*& Opt_Candidate, double *Storage, const double RADIUS, molecule *mol, bool problem);
 | 
|---|
| [8eb17a] | 116 | 
 | 
|---|
 | 117 | 
 | 
|---|
 | 118 | #endif /*BOUNDARY_HPP_*/
 | 
|---|