ed
convex_hull.h
Go to the documentation of this file.
1 #ifndef ED_CONVEX_HULL_H_
2 #define ED_CONVEX_HULL_H_
3 
4 #include <geolib/datatypes.h>
5 
6 #include <vector>
7 
8 namespace ed
9 {
10 
11 struct ConvexHull
12 {
16  float z_min, z_max;
17  float area; // is calculated based on points
18  bool complete;
19 
20  ConvexHull() : area(0), complete(false) {}
21 
22  double height() const { return z_max - z_min; }
23 
24  double volume() const { return height() * area; }
25 
26 };
27 
28 }
29 
30 #endif
datatypes.h
ed::ConvexHull::z_min
float z_min
Definition: convex_hull.h:16
ed::ConvexHull::ConvexHull
ConvexHull()
Definition: convex_hull.h:20
ed::ConvexHull
Definition: convex_hull.h:11
vector
ed::ConvexHull::complete
bool complete
Definition: convex_hull.h:18
ed::ConvexHull::volume
double volume() const
Definition: convex_hull.h:24
ed::ConvexHull::height
double height() const
Definition: convex_hull.h:22
ed::ConvexHull::normals
std::vector< geo::Vec2f > normals
Definition: convex_hull.h:15
ed::ConvexHull::area
float area
Definition: convex_hull.h:17
ed::ConvexHull::edges
std::vector< geo::Vec2f > edges
Definition: convex_hull.h:14
ed
Definition: convex_hull.h:8
ed::ConvexHull::z_max
float z_max
Definition: convex_hull.h:16
ed::ConvexHull::points
std::vector< geo::Vec2f > points
Definition: convex_hull.h:13