BALL 1.5.0
Loading...
Searching...
No Matches
triangulatedSAS.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4
5#ifndef BALL_STRUCTURE_TRIANGULATEDSAS_H
6#define BALL_STRUCTURE_TRIANGULATEDSAS_H
7
8#ifndef BALL_STRUCTURE_SASEDGE_H
10#endif
11
12#ifndef BALL_STRUCTURE_SASFACE_H
14#endif
15
16#ifndef BALL_TRUCTURE_SOLVENTEXCLUDEDSURFACE_H
18#endif
19
20#ifndef BALL_STRUCTURE_TRIANGULATEDSURFACE_H
22#endif
23
24#ifndef BALL_STRUCTURE_TRIANGLE_H
26#endif
27
28#ifndef BALL_STRUCTURE_TRIANGLEEDGE_H
30#endif
31
32#ifndef BALL_STRUCTURE_TRIANGLEPOINT_H
34#endif
35
36#ifndef BALL_MATHS_ANGLE_H
37# include <BALL/MATHS/angle.h>
38#endif
39
40#ifndef BALL_MATHS_CIRCLE3_H
41# include <BALL/MATHS/circle3.h>
42#endif
43
44#ifndef BALL_MATHS_VECTOR3_H
45# include <BALL/MATHS/vector3.h>
46#endif
47
48#ifndef BALL_DATATYPE_HASHGRID_H
50#endif
51
52#include <list>
53#include <vector>
54
55namespace BALL
56{
57 class SASTriangulator;
58
63 {
64
65 public:
66
72 friend class SASTriangulator;
73
75
76
79
80
84
90 TriangulatedSAS(const TriangulatedSAS& surface, bool = true);
91
97 TriangulatedSAS(SolventAccessibleSurface* sas, const double& density);
98
102 virtual ~TriangulatedSAS();
104
108
113 void set(const TriangulatedSAS& surface, bool = true);
114
118 TriangulatedSAS& operator = (const TriangulatedSAS& surface);
119
121
125
128 void setDensity(const double& density);
129
132 double getDensity() const;
133
136 void compute();
137
139
140 protected:
141
142 /*_ @name Attributes
143 */
145
147
148 double density_;
149
151
152 };
153
161 {
162
163 public:
164
165 #ifdef debug_triangulation
166 void printToHINFile(string filename);
167 void Contour2HIN(const std::list<TriangleEdge*>& contour, const string& file);
168 void SASEdge2HIN(SASEdge* edge, const string& file);
169 #endif
170
172
173
176
177
181
187
191 virtual ~SASTriangulator();
193
197
198 void run();
199
200 private:
201
202 void triangulateFace(SASFace* face);
203
204 void createPlanes(SASFace* face,
205 std::list< std::pair<TPlane3<double>,double> >& planes);
206
207 void tagPoints(TriangulatedSurface& part,
208 const std::list< std::pair<TPlane3<double>,double> >& planes);
209
210 void removeInsideTriangles(TriangulatedSurface& part);
211
212 HashGrid3<TrianglePoint*> createHashGrid(const TriangulatedSurface& part);
213
214 void createPoints(TriangulatedSurface& part,
215 const std::list< std::pair<TPlane3<double>,double> >& planes,
216 HashGrid3<TrianglePoint*>& grid);
217
218 void createNewTriangles(TriangulatedSurface& part, HashGrid3<TrianglePoint*>& grid);
219
220 void onePointOutside(Index outside, Triangle* t,
222
223 void twoPointsOutside(Position outside1, Position outside2,
225
226 TrianglePoint* vertexExists(const TVector3<double>& point, HashGrid3<TrianglePoint*>& grid);
227
228 Size numberOfRefinements(const double& density, const double& radius);
229
230 void buildTemplateSpheres();
231
233
234 protected:
235
239
241
242 double sqrt_density_;
243
244 std::vector< std::list< TVector3<double> > > edge_;
245
246 HashMap<Size,TriangulatedSurface> template_spheres_;
247
249
250 };
251
252} // namespace BALL
253
254
255#endif // BALL_STRUCTURE_TRIANGULATEDSAS_H
#define BALL_CREATE(name)
Definition create.h:62
STL namespace.
Three-dimensional Hash Grid Class.
Definition hashGrid.h:755
HashMap class based on the STL map (containing serveral convenience functions)
#define BALL_EXPORT