Geom Software - C++ Programming and Geometry Libraries
Fade3D Documentation pages v0.98
/home/geom/repo/dev/geomDev/dt3/dt3Library/Fade_3D.h
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the Fade3D library. The student license is free
4 // of charge and covers personal non-commercial research. Licensees
5 // holding a commercial license may use this file in accordance with
6 // the Commercial License Agreement.
7 //
8 // This software is provided AS IS with NO WARRANTY OF ANY KIND,
9 // INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
10 // FOR A PARTICULAR PURPOSE.
11 //
12 // Please contact the author if any conditions of this licensing are
13 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // http://www.geom.at
17 
18 
19 
20 #pragma once
21 
22 #include "definitions.h"
23 #include "Visualizer3.h"
24 #include "Point3.h"
25 #include "Tet3.h"
26 #include "Performance.h"
27 #include "Surface3.h"
28 #include "Vector3.h"
29 #include "testDataGenerators.h"
30 #include "tools.h"
31 #include "freeFunctions.h"
32 
33 namespace FADE3D {
34 
36 enum Orientation3{
37  ORIENTATION3_POSITIVE,
38  ORIENTATION3_NEGATIVE,
39  ORIENTATION3_COPLANAR
40  };
41 
42 
43 class Dt3; // Forward
44 
49 class Fade_3D
50 {
51 public:
52  CLASS_DECLSPEC
53  Fade_3D()
54  {
55  initFade();
56  }
57 
58  CLASS_DECLSPEC
59  ~Fade_3D();
60 
66  CLASS_DECLSPEC
67  void getTetsAroundVertex(Point3* pVtx,std::vector<Tet3*>& vTetOut);
68 
69 
71  CLASS_DECLSPEC
72  void setVerbosity(bool b);
73 
74 // \brief Orientation test
75 //*
76 //* This method returns the orientation of q with respect to the plane of the triangle (p0,p1,p2).
77 //* The result is either ORIENTATION3_POSITIVE, ORIENTATION3_NEGATIVE or ORIENTATION3_COPLANAR. Which is the ORIENTATION3_POSITIVE side?
78 //* If you look at a triangle and you see the vertices (p0,p1,p2) in counterclockwise order
79 //* then you are on the positive side.
80 //*/
81  //CLASS_DECLSPEC
82  //Orientation3 getOrientation(const Point3& p0,
83  //const Point3& p1,
84  //const Point3& p2,
85  //const Point3& q);
86 
87 // \brief Returns an empty Surface object (currently not in the API)
88 //*
89 //* This method creates an empty Surface object. Surface is currently not part of
90 //* the API. Surface objects will later be used to define surfaces or to read
91 //* triangles from STL files. Points created by Surface are owned by the Fade_3D
92 //* object (thus they do not need to be recreated later) but are not triangulated
93 //* until the triangulation is explicitly launched.
94 //*/
95  //CLASS_DECLSPEC
96  //Surface3* createEmptySurface();
97 
98 // \brief Inserts pending points (currently for internal use)
99 //*
100 //* This method inserts points that have been created but not triangulated yet.
101 //*/
102  //CLASS_DECLSPEC
103  //void insertPendingPoints();
104 
105 
117  CLASS_DECLSPEC
118  bool checkValidity(const std::string& msg,bool bCheckSphereInc);
119 
120 
126  CLASS_DECLSPEC
127  void show(const std::string& filename,Point3* pVtx=NULL);
128 
130  CLASS_DECLSPEC
131  void print(const std::string& name);
132 
133 
147  CLASS_DECLSPEC
148  Point3* insert(const Point3& p);
149 
155  CLASS_DECLSPEC
156  void insert(const std::vector<Point3>& vInputPoints);
157 
169  CLASS_DECLSPEC
170  void insert(const std::vector<Point3>& vInputPoints,std::vector<Point3*>& vHandlesOut);
171 
179  CLASS_DECLSPEC
180  Tet3* locate(const Point3& p);
181 
186  CLASS_DECLSPEC
187  void getTetrahedra(std::vector<Tet3*>& vTetrahedra) const;
188 
199  CLASS_DECLSPEC
200  void getVertices(std::vector<Point3*>& vVertices) const;
201 
207  CLASS_DECLSPEC
208  bool is3D() const;
211  CLASS_DECLSPEC
212  void printLicense() const;
213 
214 protected:
216  void initFade();
218  Fade_3D(const Fade_3D&); // No copy constructor
220  Fade_3D& operator=(const Fade_3D&); // No assignment allowed
222  Dt3* pImpl;
223 
224 };
225 
226 CLASS_DECLSPEC
227 std::string getFade3DVersion();
228 } // (namespace)
229 
230 
231 // Helper
232 namespace GEOM_LIC
233 {
234  CLASS_DECLSPEC
235  void setLic(
236  const std::string& l1,
237  const std::string& l2,
238  const std::string& dt,
239  const std::string& s1,
240  const std::string& s2_
241  );
242  class Lic; // FWD
243  Lic* getLic();
244 }
245 
246 #ifndef GEOM_NOLIC
247  #include "License.h"
248 #endif
249 
251 CLASS_DECLSPEC
252 void benchCounter(std::string& s);
253 
Tet3 * locate(const Point3 &p)
Locate a tetrahedron which contains p The Fade_3D class can be used as a data structure for point loc...
void printLicense() const
Print your license type.
void getTetrahedra(std::vector< Tet3 *> &vTetrahedra) const
Get all Tet3 (tetrahedra)
Definition: Ball3.h:16
Vertex.
Definition: Point3.h:32
void getTetsAroundVertex(Point3 *pVtx, std::vector< Tet3 *> &vTetOut)
Get all tetrahedra around a vertex.
3D Delaunay triangulation - the main class
Definition: Fade_3D.h:49
void getVertices(std::vector< Point3 *> &vVertices) const
Get all vertices.
void show(const std::string &filename, Point3 *pVtx=NULL)
Draw a 3D scene.
Tetrahedron.
Definition: Tet3.h:46
Point3 * insert(const Point3 &p)
Insert a single 3D point.
bool checkValidity(const std::string &msg, bool bCheckSphereInc)
Check validity of the tetrahedral mesh.
bool is3D() const
Check if the triangulation is 3D.
Definition: Fade_3D.h:232