SynAPSE  0.6.0
Synergistic Analysis of Phase Space Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
AlphaComplex.hh
1 #ifndef ALPHACOMPLEX_HH
2 #define ALPHACOMPLEX_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 #include "TGraph.h"
14 #include "TGeoManager.h"
15 #include "TGeoVolume.h"
16 #include "TGeoMatrix.h"
17 #include "TGeoBBox.h"
18 #include "TGeoArb8.h"
19 #include "TView.h"
20 #include "TCanvas.h"
21 #include "TPolyMarker3D.h"
22 #include "TGLViewer.h"
23 
24 // QHULL includes
25 #include "PointCoordinates.h"
26 #include "RboxPoints.h"
27 #include "QhullError.h"
28 #include "Qhull.h"
29 #include "QhullQh.h"
30 #include "QhullFacet.h"
31 #include "QhullFacetList.h"
32 #include "QhullFacetSet.h"
33 #include "QhullLinkedList.h"
34 #include "QhullVertex.h"
35 #include "QhullSet.h"
36 #include "QhullVertexSet.h"
37 
38 // Additional includes
39 #include "Matrix.hh"
40 #include "Vector.hh"
41 #include "Statistics.hh"
42 #include "Geometry.hh"
43 
50 class AlphaComplex {
51  public:
53  AlphaComplex();
54 
60  AlphaComplex(const std::vector<std::vector<double>>& points,
61  const double alpha=0.);
62 
64  AlphaComplex(const AlphaComplex& del);
65 
67  AlphaComplex& operator=(const AlphaComplex& del);
68 
70  ~AlphaComplex();
71 
75  void Initialize();
76 
78  const size_t& GetDimension() const { return _dim; }
79 
81  const std::vector<std::vector<double>>& GetPointArray() const { return _points; }
82 
84  const std::vector<double>& GetPoint(const size_t i) const { return _points[i]; }
85 
87  const double& GetVolume() const { return _vol; }
88 
90  const std::vector<double>& GetCellVolumeArray() const { return _areas; }
91 
93  void SetAlpha(const double alpha);
94 
101  std::vector<TPolyLine*> Polygons(const bool fill=false) const;
102 
107  TGeoVolume* Polyhedra() const;
108 
114  void Draw(const bool fill=false,
115  const bool points=false) const;
116 
124  void Paint(const std::string name="",
125  const bool fill=false,
126  const bool points=false,
127  const std::vector<std::string> exts=std::vector<std::string>({"pdf"})) const;
128 
129  private:
130 
135  double Circumradius(orgQhull::QhullFacet& facet) const;
136 
142  TGeoVolume* Polyhedron(const std::vector<std::vector<double>>& facet,
143  TGeoHMatrix*& H) const;
144 
145  size_t _dim;
146  double _alpha;
147  std::vector<std::vector<double>> _points;
148  std::vector<std::vector<std::vector<double>>> _facets;
149  std::vector<double> _circumradii;
150  std::vector<double> _areas;
151  double _vol;
152 };
153 
154 #endif
std::vector< double > _areas
Array of facet areas.
Definition: AlphaComplex.hh:150
std::vector< TPolyLine * > Polygons(const bool fill=false) const
Returns an array of polygons to be drawn in ROOT (only 2D)
Definition: AlphaComplex.cc:106
const double & GetVolume() const
Returns the volume of the alpha-complex.
Definition: AlphaComplex.hh:87
void SetAlpha(const double alpha)
Returns the volume of the alpha-complex.
Definition: AlphaComplex.cc:89
const std::vector< double > & GetCellVolumeArray() const
Returns the volume of the alpha-complex.
Definition: AlphaComplex.hh:90
Computes the α-complex of a set of points.
Definition: AlphaComplex.hh:50
size_t _dim
Dimension of the space.
Definition: AlphaComplex.hh:145
Set of functions that compose the Statistics package.
Set of functions that compose the Geometry package.
std::vector< std::vector< double > > _points
Vector of N vertices.
Definition: AlphaComplex.hh:147
const size_t & GetDimension() const
Returns the dimension of the space in which the tesselation is constructed.
Definition: AlphaComplex.hh:78
double _alpha
Curvature alpha.
Definition: AlphaComplex.hh:146
double Circumradius(orgQhull::QhullFacet &facet) const
Returns the circumradius of a simplical facet.
Definition: AlphaComplex.cc:270
std::vector< std::vector< std::vector< double > > > _facets
Array of simplices.
Definition: AlphaComplex.hh:148
TGeoVolume * Polyhedron(const std::vector< std::vector< double >> &facet, TGeoHMatrix *&H) const
Returns a TGeoVolume discribing the simplex in 3D.
Definition: AlphaComplex.cc:301
double _vol
Volume of the complex.
Definition: AlphaComplex.hh:151
void Initialize()
Find the alpha-complex triangulation of the N points.
Definition: AlphaComplex.cc:42
std::vector< double > _circumradii
Array of facet circumradii.
Definition: AlphaComplex.hh:149
void Paint(const std::string name="", const bool fill=false, const bool points=false, const std::vector< std::string > exts=std::vector< std::string >({"pdf"})) const
Paints the alpha-complex onto a TCanvas and save it.
Definition: AlphaComplex.cc:239
void Draw(const bool fill=false, const bool points=false) const
Draw the alpha-complex with the requested properties.
Definition: AlphaComplex.cc:189
TGeoVolume * Polyhedra() const
Returns a parent volume that contains all of the simplices (only 3D)
Definition: AlphaComplex.cc:150
AlphaComplex & operator=(const AlphaComplex &del)
Equality operator.
Definition: AlphaComplex.cc:25
~AlphaComplex()
Destructor.
Definition: AlphaComplex.cc:40
AlphaComplex()
Default constructor, initilizes everything to 0.
Definition: AlphaComplex.cc:3
const std::vector< std::vector< double > > & GetPointArray() const
Returns the array of points on which the alpha-complex is constructed.
Definition: AlphaComplex.hh:81
const std::vector< double > & GetPoint(const size_t i) const
Returns a specific point.
Definition: AlphaComplex.hh:84