BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
134  void compute()
135  throw(Exception::GeneralException,Exception::DivisionByZero);
136 
138 
139  protected:
140 
141  /*_ @name Attributes
142  */
144 
146 
147  double density_;
148 
150 
151  };
152 
153 
154 
162  {
163 
164  public:
165 
166  BALL_CREATE(SESTriangulator)
167 
168 
171 
175  SESTriangulator()
176  ;
177 
181  SESTriangulator(TriangulatedSES* tses)
182  ;
183 
187  virtual ~SESTriangulator()
188  ;
190 
194 
195  void run()
197 
198  private:
199 
200  void preProcessing()
201  ;
202 
203  void triangulateToricFaces()
204  ;
205 
206  void partitionSingularEdges()
207  ;
208 
209  void triangulateContactFaces()
210  ;
211 
212  void triangulateSphericFaces()
213  ;
214 
215  void triangulateToricFace
216  (SESFace* face,
217  const double& probe_radius)
218  ;
219 
220  void triangulateFreeToricFace
221  (SESFace* face,
222  const double& probe_radius)
223  ;
224 
225  void triangulateSingularToricFace
226  (SESFace* face,
227  const double& probe_radius)
228  ;
229 
230  void triangulateNonSingularToricFace
231  (SESFace* face,
232  const double& probe_radius)
233  ;
234 
235  void partitionSingularEdge(SESEdge* singular_edge)
236  ;
237 
238  void partitionFreeSingularEdge(SESEdge* singular_edge)
239  ;
240 
241  void partitionNonFreeSingularEdge(SESEdge* singular_edge)
242  ;
243 
244  void triangulateContactFace
245  (SESFace* face,
246  const TSphere3<double>& sphere)
247  ;
248 
249  bool triangulateSphericFace
250  (SESFace* face,
251  const TSphere3<double>& sphere)
252  ;
253 
254  bool buildSphericTriangles
255  (SESFace* face,
256  TriangulatedSES& part,
257  const TSphere3<double>& sphere,
258  bool convex = true)
259  ;
260 
261  bool buildFirstTriangle
262  (SESFace* face,
263  TriangulatedSES& part,
264  std::list<TriangleEdge*>& border,
265  const TSphere3<double>& sphere,
266  const HashSet<TrianglePoint*>& points,
267  bool convex)
268  ;
269 
270  SESEdge* firstSESEdge(const std::list<SESEdge*>& sesedge)
271  ;
272 
273  void buildUnambiguousTriangle
274  (TriangleEdge* edge,
275  TrianglePoint* point,
276  std::list<TriangleEdge*>& border,
277  const TSphere3<double>& sphere,
278  TriangulatedSES& part,
279  bool convex
280  )
281  ;
282 
283  void buildAmbiguousTriangles
284  (TriangleEdge* edge,
285  std::list<TrianglePoint*> points,
286  std::list<TriangleEdge*>& border,
287  const TSphere3<double>& sphere,
288  TriangulatedSES& part,
289  bool convex
290  )
291  ;
292 
293  void createTriangleAndEdges
294  (TriangleEdge* edge,
295  TrianglePoint* point,
296  const TSphere3<double>& sphere,
297  TriangleEdge*& edge1,
298  bool& old1,
299  TriangleEdge*& edge2,
300  bool& old2,
301  Triangle*& triangle,
302  bool convex
303  )
304  ;
305 
306  void partitionOfCircle
307  (const TCircle3<double>& circle,
308  const TVector3<double>& p0,
309  const TAngle<double>& phi,
310  Size number_of_segments,
311  vector< TVector3<double> >& partition,
312  bool on_surface = true)
313  ;
314 
315  Size numberOfRefinements(const double& density, const double& radius)
316  ;
317 
318  void buildTemplateSpheres()
319  ;
320 
321  void buildTriangles
322  (SESEdge* edge0,
323  SESEdge* edge1,
324  SESEdge* edge2,
325  SESEdge* edge3,
326  const std::vector< TVector3<double> >& centers,
327  const std::vector< TVector3<double> >& edge1_points,
328  const std::vector< TVector3<double> >& edge3_points,
329  const double& probe_radius)
330  ;
331 
333 
334  protected:
335 
336  /*_ @name Attributes
337  */
339 
340  TriangulatedSES* tses_;
341  std::vector<TrianglePoint*> point_;
342  std::vector<std::list<TriangleEdge*> > edge_;
345 
347 
348  };
349 
350 
351 } // namespace BALL
352 
353 
354 #endif // BALL_STRUCTURE_TRIANGULATEDSES_H