BALL  1.5.0
triangulatedSES.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_TRIANGULATEDSES_H
6 #define BALL_STRUCTURE_TRIANGULATEDSES_H
7 
8 #ifndef BALL_TRUCTURE_SOLVENTEXCLUDEDSURFACE_H
10 #endif
11 
12 #ifndef BALL_STRUCTURE_TRIANGLE_H
13 # include <BALL/STRUCTURE/triangle.h>
14 #endif
15 
16 #ifndef BALL_STRUCTURE_TRIANGLEEDGE_H
18 #endif
19 
20 #ifndef BALL_STRUCTURE_TRIANGLEPOINT_H
22 #endif
23 
24 #ifndef BALL_STRUCTURE_TRIANGULATEDSURFACE_H
26 #endif
27 
28 #ifndef BALL_MATHS_ANGLE_H
29 # include <BALL/MATHS/angle.h>
30 #endif
31 
32 #ifndef BALL_MATHS_CIRCLE3_H
33 # include <BALL/MATHS/circle3.h>
34 #endif
35 
36 #ifndef BALL_MATHS_SPHERE3_H
37 # include <BALL/MATHS/sphere3.h>
38 #endif
39 
40 #ifndef BALL_MATHS_VECTOR3_H
41 # include <BALL/MATHS/vector3.h>
42 #endif
43 
44 #include <list>
45 #include <vector>
46 
47 namespace BALL
48 {
49  class SESTriangulator;
50 
55  {
56 
57  public:
58 
64  friend class SESTriangulator;
65 
67 
68 
71 
76  ;
77 
83  TriangulatedSES(const TriangulatedSES& surface, bool = true)
84  ;
85 
91  TriangulatedSES(SolventExcludedSurface* ses, const double& density)
92  ;
93 
97  virtual ~TriangulatedSES()
98  ;
100 
104 
109  void set(const TriangulatedSES& surface, bool = true)
110  ;
111 
115  TriangulatedSES& operator = (const TriangulatedSES& surface)
116  ;
117 
120  void setDensity(const double& density)
121  ;
122 
125  double getDensity() const
126  ;
127 
129 
133 
137  void compute();
138 
140 
141  protected:
142 
143  /*_ @name Attributes
144  */
146 
148 
149  double density_;
150 
152 
153  };
154 
155 
156 
164  {
165 
166  public:
167 
169 
170 
173 
178  ;
179 
184  ;
185 
189  virtual ~SESTriangulator()
190  ;
192 
196 
200  void run();
201 
202  private:
203 
204  void preProcessing()
205  ;
206 
207  void triangulateToricFaces()
208  ;
209 
210  void partitionSingularEdges()
211  ;
212 
213  void triangulateContactFaces()
214  ;
215 
216  void triangulateSphericFaces()
217  ;
218 
219  void triangulateToricFace
220  (SESFace* face,
221  const double& probe_radius)
222  ;
223 
224  void triangulateFreeToricFace
225  (SESFace* face,
226  const double& probe_radius)
227  ;
228 
229  void triangulateSingularToricFace
230  (SESFace* face,
231  const double& probe_radius)
232  ;
233 
234  void triangulateNonSingularToricFace
235  (SESFace* face,
236  const double& probe_radius)
237  ;
238 
239  void partitionSingularEdge(SESEdge* singular_edge)
240  ;
241 
242  void partitionFreeSingularEdge(SESEdge* singular_edge)
243  ;
244 
245  void partitionNonFreeSingularEdge(SESEdge* singular_edge)
246  ;
247 
248  void triangulateContactFace
249  (SESFace* face,
250  const TSphere3<double>& sphere)
251  ;
252 
253  bool triangulateSphericFace
254  (SESFace* face,
255  const TSphere3<double>& sphere)
256  ;
257 
258  bool buildSphericTriangles
259  (SESFace* face,
260  TriangulatedSES& part,
261  const TSphere3<double>& sphere,
262  bool convex = true)
263  ;
264 
265  bool buildFirstTriangle
266  (SESFace* face,
267  TriangulatedSES& part,
268  std::list<TriangleEdge*>& border,
269  const TSphere3<double>& sphere,
270  const HashSet<TrianglePoint*>& points,
271  bool convex)
272  ;
273 
274  SESEdge* firstSESEdge(const std::list<SESEdge*>& sesedge)
275  ;
276 
277  void buildUnambiguousTriangle
278  (TriangleEdge* edge,
279  TrianglePoint* point,
280  std::list<TriangleEdge*>& border,
281  const TSphere3<double>& sphere,
282  TriangulatedSES& part,
283  bool convex
284  )
285  ;
286 
287  void buildAmbiguousTriangles
288  (TriangleEdge* edge,
289  std::list<TrianglePoint*> points,
290  std::list<TriangleEdge*>& border,
291  const TSphere3<double>& sphere,
292  TriangulatedSES& part,
293  bool convex
294  )
295  ;
296 
297  void createTriangleAndEdges
298  (TriangleEdge* edge,
299  TrianglePoint* point,
300  const TSphere3<double>& sphere,
301  TriangleEdge*& edge1,
302  bool& old1,
303  TriangleEdge*& edge2,
304  bool& old2,
305  Triangle*& triangle,
306  bool convex
307  )
308  ;
309 
310  void partitionOfCircle
311  (const TCircle3<double>& circle,
312  const TVector3<double>& p0,
313  const TAngle<double>& phi,
314  Size number_of_segments,
315  vector< TVector3<double> >& partition,
316  bool on_surface = true)
317  ;
318 
319  Size numberOfRefinements(const double& density, const double& radius)
320  ;
321 
322  void buildTemplateSpheres()
323  ;
324 
325  void buildTriangles
326  (SESEdge* edge0,
327  SESEdge* edge1,
328  SESEdge* edge2,
329  SESEdge* edge3,
330  const std::vector< TVector3<double> >& centers,
331  const std::vector< TVector3<double> >& edge1_points,
332  const std::vector< TVector3<double> >& edge3_points,
333  const double& probe_radius)
334  ;
335 
337 
338  protected:
339 
340  /*_ @name Attributes
341  */
343 
345  std::vector<TrianglePoint*> point_;
346  std::vector<std::list<TriangleEdge*> > edge_;
349 
351 
352  };
353 
354 
355 } // namespace BALL
356 
357 
358 #endif // BALL_STRUCTURE_TRIANGULATEDSES_H
BALL::TrianglePoint
Definition: trianglePoint.h:41
BALL::TAngle< double >
BALL::TCircle3< double >
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions)
Definition: hashMap.h:73
angle.h
BALL::SESTriangulator::template_spheres_
HashMap< Size, std::list< TrianglePoint * > > template_spheres_
Definition: triangulatedSES.h:347
BALL::SESTriangulator::tses_
TriangulatedSES * tses_
Definition: triangulatedSES.h:344
BALL::SESTriangulator
Definition: triangulatedSES.h:163
vector3.h
BALL::SESTriangulator::sqrt_density_
double sqrt_density_
Definition: triangulatedSES.h:348
circle3.h
BALL::TriangulatedSES
Definition: triangulatedSES.h:54
BALL::TSphere3< double >
triangle.h
triangulatedSurface.h
BALL
Definition: constants.h:12
solventExcludedSurface.h
BALL::SolventExcludedSurface
Definition: solventExcludedSurface.h:66
BALL::HashSet
Definition: hashSet.h:45
BALL::SESEdge
Definition: SESEdge.h:33
BALL::TriangulatedSES::ses_
SolventExcludedSurface * ses_
Definition: triangulatedSES.h:147
BALL::SESTriangulator::edge_
std::vector< std::list< TriangleEdge * > > edge_
Definition: triangulatedSES.h:346
BALL_SIZE_TYPE
BALL::TVector3< double >
BALL::TriangleEdge
Definition: triangleEdge.h:37
triangleEdge.h
BALL::SESTriangulator::point_
std::vector< TrianglePoint * > point_
Definition: triangulatedSES.h:345
sphere3.h
BALL::Triangle
Definition: triangle.h:37
BALL_CREATE
#define BALL_CREATE(name)
Definition: create.h:62
trianglePoint.h
BALL_EXPORT
#define BALL_EXPORT
Definition: COMMON/global.h:50
BALL::SESFace
Definition: SESFace.h:37
BALL::TriangulatedSurface
Definition: triangulatedSurface.h:40
BALL::TriangulatedSES::density_
double density_
Definition: triangulatedSES.h:149