73 const Geometry::Vec3& AABBmin,
74 const Geometry::Vec3& AABBmax
91 const std::vector<Polygon*>& polygons,
92 const std::vector<std::pair<Vertex, Graph*>>& graphVertices
124 const std::vector<Polygon*>& polygons,
125 const std::vector<std::pair<Vertex, Graph*>>& graphVertices,
126 const std::string& indent
142 const std::string& indent
156 const Geometry::Vec3& p,
157 const std::string& indent
171 std::vector<std::pair<Vertex, Graph*>>
173 const Geometry::Vec3& p,
174 const std::string& indent
190 const std::vector<Graph*>& graphList
204 const std::string& indent
std::vector< std::pair< Vertex, Graph * > > getNeighbours(const Geometry::Vec3 &p, const std::string &indent)
Given a point p in 3D space, return all vertices associated to the smallest existing octree that has ...
Definition: Octree.cpp:197
bool pointInOctree(const Geometry::Vec3 &p, const std::string &indent)
Check if a point lies inside an octree.
Definition: Octree.cpp:180
void buildOctree(const std::vector< Polygon *> &polygons, const std::vector< std::pair< Vertex, Graph *>> &graphVertices, const std::string &indent)
For two lists of Polygons and vertices, sort them into an empty octree.
Definition: Octree.cpp:76
Geometry::Vec3 max
The AABBmax of the current cube.
Definition: Octree.h:43
A struct that represents a single polygon.
Definition: Polygon.h:21
Octree(const Geometry::Vec3 &AABBmin, const Geometry::Vec3 &AABBmax)
A basic constructor that initializes all data members with dummy data.
Definition: Octree.cpp:25
std::vector< Polygon * > polygons
Store pointers to Polygons that lie in this octree.
Definition: Octree.h:55
bool polygonInOctree(const Polygon *polygon, const std::string &indent)
Check if a poylgon lies inside an octree.
Definition: Octree.cpp:163
const short threshold
If this threshold is reached, stop octree recursion.
Definition: Octree.h:20
Octree * createOctree(const std::vector< Graph *> &graphList)
Given the output of buildGraphList, create an octree containing all polygons and vertices.
Definition: Octree.cpp:231
void deleteOctree(const bool &root)
Free all memory allocated to this octree and polygons.
Definition: Octree.cpp:50
void printOctree(const Octree *octree, const std::string &indent)
Output a graphical representation of an octree to the console.
Definition: Octree.cpp:271
This struct implements the octree data structure.
Definition: Octree.h:32
This file provides using and enum declarations.
std::vector< std::pair< Vertex, Graph * > > graphVertices
Store graph vertices that lie in this octree together with a reference to their graph.
Definition: Octree.h:62
std::vector< Octree * > child
Store pointers to the eight children of the octree.
Definition: Octree.h:49
Geometry::Vec3 min
The AABBmin of the current cube.
Definition: Octree.h:37