ARGoS 3
A parallel, multi-engine simulator for swarm robotics
convex_hull.h
Go to the documentation of this file.
1
7#ifndef CONVEX_HULL_H
8#define CONVEX_HULL_H
9
10namespace argos {
11 class CConvexHull;
12}
13
14#include <argos3/core/utility/math/vector3.h>
15#include <array>
16#include <algorithm> // REMOVE
17
18namespace argos {
19
21
22 public:
23 typedef std::vector<UInt32> TEdge;
24
25 /* each face has three points, specified in counter-clockwise
26 order looking from the outside */
27 struct SFace {
28 SFace(const std::vector<CVector3>& vec_points,
29 UInt32 un_A,
30 UInt32 un_B,
31 UInt32 un_C,
32 UInt32 un_inside_point);
33
34 void Flip();
35
38 std::array<UInt32, 3> VertexIndices;
39 };
40
41 public:
42 CConvexHull(const std::vector<CVector3>& vec_points);
43
44 const std::vector<SFace>& GetFaces() const {
45 return m_vecFaces;
46 }
47
48 private:
49 std::vector<SFace> m_vecFaces;
50 std::vector<CVector3> m_vecPoints;
51 };
52}
53
54#endif
unsigned int UInt32
32-bit unsigned integer.
Definition datatypes.h:97
float Real
Collects all ARGoS code.
Definition datatypes.h:39
The namespace containing all the ARGoS related code.
Definition ci_actuator.h:12
const std::vector< SFace > & GetFaces() const
Definition convex_hull.h:44
std::vector< UInt32 > TEdge
Definition convex_hull.h:23
CConvexHull(const std::vector< CVector3 > &vec_points)
std::array< UInt32, 3 > VertexIndices
Definition convex_hull.h:38
SFace(const std::vector< CVector3 > &vec_points, UInt32 un_A, UInt32 un_B, UInt32 un_C, UInt32 un_inside_point)
A 3D vector class.
Definition vector3.h:31