![]() |
Terrain Rasterizer
Conversion of GPS data into 2.5D topographic maps
|
A recursive QuadTree structure for spatial indexing of triangles. More...
#include <quadtree.hpp>

Public Member Functions | |
| QuadTree (const BoundingBox &bounds, int depth=0) | |
| Constructs a QuadTree node. | |
| void | insert (const Triangle &triangle, const std::vector< Point > &points) |
| Inserts a triangle into the QuadTree. | |
| std::optional< Triangle > | find (double x, double y, const std::vector< Point > &points) const |
| Finds the triangle containing a specific point. | |
A recursive QuadTree structure for spatial indexing of triangles.
Used to efficiently query which triangle covers a given (x, y) point on the map.
| QuadTree::QuadTree | ( | const BoundingBox & | bounds, |
| int | depth = 0 |
||
| ) |
Constructs a QuadTree node.
| bounds | The spatial bounds of this node. |
| depth | The current depth in the tree (default is 0). |
| std::optional< Triangle > QuadTree::find | ( | double | x, |
| double | y, | ||
| const std::vector< Point > & | points | ||
| ) | const |
Finds the triangle containing a specific point.
| x | X coordinate. |
| y | Y coordinate. |
| points | The complete list of points. |

Inserts a triangle into the QuadTree.
| triangle | The triangle to insert. |
| points | The complete list of points (needed to get vertex coordinates). |
