![]() |
COGS
Computer Graphics Structures library
|
Space-partitioning data structure for point clouds. More...
Public Member Functions | |
| ~Octree () | |
| Octree destructor. | |
| Octree ()=default | |
| Default constructor. | |
| Octree (const cogs::PointCloud &cloud) | |
| Constructs Octree over the given cloud. More... | |
| Octree (const std::vector< glm::vec3 > &positions) | |
| Constructs Octree over the given vector of points. More... | |
| void | Include (const cogs::PointCloud &cloud) |
| Adds points of the input cloud into the Octree. More... | |
| void | Include (const std::vector< const cogs::PointCloud *> &clouds) |
| Adds points of input clouds into the Octree. More... | |
| std::string | ToString () const |
| Get the string representation of this octree. More... | |
| size_t | GetNodeCount () const |
| Get the number of nodes in the octree. More... | |
| std::vector< geom::Aabb3 > | GetNodeCubes () const |
| Returns the vector of bounding boxes of all internal nodes. More... | |
| bool | HasPointIn (const glm::vec3 &location, float_t radius) const |
| Whether any of the points exist in the range from the given location. More... | |
| bool | HasPointIn (const geom::Aabb3 &search_range) const |
| Whether any of the points exist inside the input AABB. More... | |
| std::vector< uint32_t > | Find (const glm::vec3 &location, float_t radius) const |
| Get indices of points in the radius from the given location. More... | |
| std::vector< uint32_t > | Find (const geom::Aabb3 &search_range) const |
| Get indices of points that are inside the input AABB. More... | |
| int32_t | GetIntersectedPoint (const geom::Ray3 &ray, std::optional< float > tolerance=std::nullopt) const |
| Check whether the input ray hits any of the points and if yes, returns the one closest to the origin. More... | |
Static Public Attributes | |
| static const uint8_t | POINTS_THRESHOLD = 64 |
| When an octree node contains this number of points or less, it does not subdivide further. | |
Space-partitioning data structure for point clouds.
| cogs::Octree::Octree | ( | const cogs::PointCloud & | cloud | ) |
| cogs::Octree::Octree | ( | const std::vector< glm::vec3 > & | positions | ) |
| std::vector<uint32_t> cogs::Octree::Find | ( | const glm::vec3 & | location, |
| float_t | radius | ||
| ) | const |
Get indices of points in the radius from the given location.
| location | Location in the world around which will be searched. |
| radius | Radius range of the search area. |
| std::vector<uint32_t> cogs::Octree::Find | ( | const geom::Aabb3 & | search_range | ) | const |
Get indices of points that are inside the input AABB.
| search_range | Area of this axis aligned box will be searched for points. |
| int32_t cogs::Octree::GetIntersectedPoint | ( | const geom::Ray3 & | ray, |
| std::optional< float > | tolerance = std::nullopt |
||
| ) | const |
Check whether the input ray hits any of the points and if yes, returns the one closest to the origin.
| ray | Ray casted in the world. |
| tolerance | Maximal distance between point and ray in order to intersect it. When set tu nullopt, automatic value is used. |
| size_t cogs::Octree::GetNodeCount | ( | ) | const |
Get the number of nodes in the octree.
| std::vector<geom::Aabb3> cogs::Octree::GetNodeCubes | ( | ) | const |
Returns the vector of bounding boxes of all internal nodes.
| bool cogs::Octree::HasPointIn | ( | const glm::vec3 & | location, |
| float_t | radius | ||
| ) | const |
Whether any of the points exist in the range from the given location.
| location | Location in the world around which will be searched. |
| radius | Radius range of the search area. |
| bool cogs::Octree::HasPointIn | ( | const geom::Aabb3 & | search_range | ) | const |
Whether any of the points exist inside the input AABB.
| search_range | Area of this axis aligned box will be searched for points. |
| void cogs::Octree::Include | ( | const cogs::PointCloud & | cloud | ) |
Adds points of the input cloud into the Octree.
| positions | Points of this cloud will be included in the octree. |
| void cogs::Octree::Include | ( | const std::vector< const cogs::PointCloud *> & | clouds | ) |
Adds points of input clouds into the Octree.
| positions | Points from all the clouds in this vector will be included in the octree. |
| std::string cogs::Octree::ToString | ( | ) | const |
Get the string representation of this octree.