BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
9 # include <BALL/STRUCTURE/SASEdge.h>
10 #endif
11 
12 #ifndef BALL_STRUCTURE_SASFACE_H
13 # include <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
25 # include <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
49 # include <BALL/DATATYPE/hashGrid.h>
50 #endif
51 
52 #include <list>
53 #include <vector>
54 
55 namespace BALL
56 {
57  class SASTriangulator;
58 
63  {
64 
65  public:
66 
72  friend class SASTriangulator;
73 
75 
76 
79 
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 
171  BALL_CREATE(SASTriangulator)
172 
173 
176 
180  SASTriangulator();
181 
186  SASTriangulator(TriangulatedSAS* tsas);
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,
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 
240  TriangulatedSAS* tsas_;
241 
243 
244  std::vector< std::list< TVector3<double> > > edge_;
245 
247 
249 
250  };
251 
252 } // namespace BALL
253 
254 
255 #endif // BALL_STRUCTURE_TRIANGULATEDSAS_H
HashMap< Size, TriangulatedSurface > template_spheres_
#define BALL_CREATE(name)
Definition: create.h:62
std::vector< std::list< TVector3< double > > > edge_
TriangulatedSAS * tsas_
HashMap class based on the STL map (containing serveral convenience functions)
Definition: hashMap.h:73
#define BALL_EXPORT
Definition: COMMON/global.h:50