SynAPSE  0.6.0
Synergistic Analysis of Phase Space Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Hull.hh
1 #ifndef HULL_HH
2 #define HULL_HH
3 
4 // C++ includes
5 #include <iostream>
6 #include <ctime>
7 #include <cmath>
8 #include <vector>
9 
10 // ROOT includes
11 #include "TPolyLine.h"
12 #include "TCanvas.h"
13 
14 // Additional includes
15 #include "Matrix.hh"
16 #include "Geometry.hh"
17 
25 class Hull {
26  public:
28  Hull();
29 
34  Hull(const std::vector<std::vector<double>>& points);
35 
41  Hull(const std::vector<double>& points,
42  const size_t& dim);
43 
45  Hull(const Hull& hull);
46 
48  Hull& operator=(const Hull& hull);
49 
51  ~Hull();
52 
54  void Initialize(const std::vector<std::vector<double>>& points);
55 
57  void SetPointArray(const std::vector<std::vector<double>>& points) { this->Initialize(points); }
58 
60  void SetPointArray(const std::vector<double>& points, const size_t& dim);
61 
63  void AddPoint(const std::vector<double>& point) { _points.push_back(point); }
64 
66  const std::vector<std::vector<double>>& GetPointArray() const { return _points; }
67 
69  const std::vector<double>& GetPoint(const size_t i) const { return _points[i]; }
70 
72  void SetVolume(const double& vol) { _vol = vol; }
73 
75  const double& GetVolume() const { return _vol; }
76 
79 
81  TPolyLine* Polygon() const;
82 
83 
84  private:
85 
86  size_t _dim;
87  std::vector<std::vector<double>> _points;
88  double _vol;
89 };
90 
91 #endif
Data stucture of a convex hull.
Definition: Hull.hh:25
~Hull()
Destructor.
Definition: Hull.cc:40
void AddPoint(const std::vector< double > &point)
Sets the array of points on the hull.
Definition: Hull.hh:63
Set of functions that compose the Geometry package.
Matrix< double > GetCWPoints() const
Returns the points ordered clockwise with respect to the CMF.
Definition: Hull.cc:66
TPolyLine * Polygon() const
Returns a polygon of the hull to be drawn in ROOT (only 2D)
Definition: Hull.cc:87
double _vol
Volume of the convex hull.
Definition: Hull.hh:88
void Initialize(const std::vector< std::vector< double >> &points)
Find the Hull triangulation of the N points.
Definition: Hull.cc:42
Hull()
Default constructor, initilizes everything to 0.
Definition: Hull.cc:3
const double & GetVolume() const
Returns the volume of the hull.
Definition: Hull.hh:75
std::vector< std::vector< double > > _points
N points on the hull.
Definition: Hull.hh:87
Hull & operator=(const Hull &hull)
Equality operator.
Definition: Hull.cc:29
void SetPointArray(const std::vector< std::vector< double >> &points)
Sets the array of points on the hull.
Definition: Hull.hh:57
const std::vector< std::vector< double > > & GetPointArray() const
Returns the array of points on which the triangulation is constructed.
Definition: Hull.hh:66
const std::vector< double > & GetPoint(const size_t i) const
Returns a specific point.
Definition: Hull.hh:69
size_t _dim
Dimension of the space.
Definition: Hull.hh:86
void SetVolume(const double &vol)
Sets the volume of the hull.
Definition: Hull.hh:72