Terrain Rasterizer
Conversion of GPS data into 2.5D topographic maps
Loading...
Searching...
No Matches
QuadTree Class Reference

A recursive QuadTree structure for spatial indexing of triangles. More...

#include <quadtree.hpp>

Collaboration diagram for QuadTree:
Collaboration graph

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< Trianglefind (double x, double y, const std::vector< Point > &points) const
 Finds the triangle containing a specific point.
 

Detailed Description

A recursive QuadTree structure for spatial indexing of triangles.

Used to efficiently query which triangle covers a given (x, y) point on the map.

Constructor & Destructor Documentation

◆ QuadTree()

QuadTree::QuadTree ( const BoundingBox bounds,
int  depth = 0 
)

Constructs a QuadTree node.

Parameters
boundsThe spatial bounds of this node.
depthThe current depth in the tree (default is 0).

Member Function Documentation

◆ find()

std::optional< Triangle > QuadTree::find ( double  x,
double  y,
const std::vector< Point > &  points 
) const

Finds the triangle containing a specific point.

Parameters
xX coordinate.
yY coordinate.
pointsThe complete list of points.
Returns
std::optional<Triangle> The triangle containing the point, or std::nullopt.
Here is the call graph for this function:

◆ insert()

void QuadTree::insert ( const Triangle triangle,
const std::vector< Point > &  points 
)

Inserts a triangle into the QuadTree.

Parameters
triangleThe triangle to insert.
pointsThe complete list of points (needed to get vertex coordinates).
Here is the call graph for this function:

The documentation for this class was generated from the following files: