SynAPSE  0.6.0
Synergistic Analysis of Phase Space Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Delaunay.hh
1 #ifndef DELAUNAY_HH
2 #define DELAUNAY_HH
3 
4 // C++ includes
5 #include <iostream>
6 #include <ctime>
7 #include <cmath>
8 #include <vector>
9 #include <map>
10 
11 // ROOT includes
12 #include "TPolyLine.h"
13 
14 // QHULL includes
15 #include "PointCoordinates.h"
16 #include "RboxPoints.h"
17 #include "QhullError.h"
18 #include "Qhull.h"
19 #include "QhullQh.h"
20 #include "QhullFacet.h"
21 #include "QhullFacetList.h"
22 #include "QhullFacetSet.h"
23 #include "QhullLinkedList.h"
24 #include "QhullVertex.h"
25 #include "QhullSet.h"
26 #include "QhullVertexSet.h"
27 
28 // Additional includes
29 #include "Matrix.hh"
30 #include "Vertex.hh"
31 #include "Geometry.hh"
32 
40 class Delaunay {
41  public:
43  Delaunay();
44 
49  Delaunay(const std::vector<Vertex>& vertices);
50 
55  Delaunay(const std::vector<std::vector<double>>& vertices);
56 
58  Delaunay(const Delaunay& del);
59 
61  Delaunay& operator=(const Delaunay& del);
62 
64  ~Delaunay();
65 
67  bool Initialize();
68 
70  const size_t& GetDimension() const { return _dim; }
71 
73  const std::vector<Vertex>& GetVertexArray() const { return _vertices; }
74 
76  const Vertex& GetVertex(const size_t i) const { return _vertices[i]; }
77 
79  const std::vector<Vertex>& GetBestFacet(const std::vector<double>& v, bool* isin=NULL) const;
80 
82  std::vector<TPolyLine*> Polygons() const;
83 
84  private:
85 
86  size_t _dim;
87  std::vector<Vertex> _vertices;
88  std::map<size_t, std::vector<Vertex>> _facets;
89  orgQhull::Qhull* _qhull;
90 };
91 
92 #endif
const Vertex & GetVertex(const size_t i) const
Returns a specific vertex.
Definition: Delaunay.hh:76
~Delaunay()
Destructor.
Definition: Delaunay.cc:54
const size_t & GetDimension() const
Returns the dimension of the space in which the tesselation is constructed.
Definition: Delaunay.hh:70
Set of functions that compose the Geometry package.
bool Initialize()
Find the Delaunay triangulation of the N vertices.
Definition: Delaunay.cc:59
Delaunay()
Default constructor, initilizes everything to 0.
Definition: Delaunay.cc:3
std::map< size_t, std::vector< Vertex > > _facets
Map of facets (simplices)
Definition: Delaunay.hh:88
Delaunay & operator=(const Delaunay &del)
Equality operator.
Definition: Delaunay.cc:39
const std::vector< Vertex > & GetVertexArray() const
Returns the array of vertices on which the triangulation is constructed.
Definition: Delaunay.hh:73
std::vector< TPolyLine * > Polygons() const
Returns an array of polygons to be drawn in ROOT (only 2D)
Definition: Delaunay.cc:118
Computes the Delaunay triangulation of a set of points.
Definition: Delaunay.hh:40
size_t _dim
Dimension of the space.
Definition: Delaunay.hh:86
orgQhull::Qhull * _qhull
Pointer to qhull object, owns the memory.
Definition: Delaunay.hh:89
std::vector< Vertex > _vertices
Vector of N vertices.
Definition: Delaunay.hh:87
const std::vector< Vertex > & GetBestFacet(const std::vector< double > &v, bool *isin=NULL) const
Finds the closest facet and returns its vertices.
Definition: Delaunay.cc:95
Defines an n-dimensional vertex and its mapping onto a sclar field.
Definition: Vertex.hh:13