RTreeEntry
RTreeEntry
A bounding box with associated data for R-tree storage. More…
#include <RTree.hpp>
Public Functions
| Name | |
|---|---|
| RTreeEntry() =default | |
| RTreeEntry(float min_x, float min_y, float max_x, float max_y, T data) | |
| RTreeEntry(const BoundingBox & bbox, T data) | |
| bool | contains(float x, float y) const |
| bool | intersects(const RTreeEntry & other) const |
| bool | intersects(const BoundingBox & bbox) const |
| float | area() const |
| float | width() const |
| float | height() const |
| float | center_x() const |
| float | center_y() const |
| BoundingBox | toBoundingBox() const |
| float | distanceToPoint(float x, float y) const Calculate the minimum distance from a point to this bounding box. |
| float | distanceToPointSquared(float x, float y) const Calculate the squared minimum distance from a point to this bounding box. |
Public Attributes
| Name | |
|---|---|
| float | min_x |
| float | min_y |
| float | max_x |
| float | max_y |
| T | data |
Detailed Description
template <typename T >
struct RTreeEntry;A bounding box with associated data for R-tree storage. ## Public Functions Documentation
function RTreeEntry
RTreeEntry() =defaultfunction RTreeEntry
inline RTreeEntry(
float min_x,
float min_y,
float max_x,
float max_y,
T data
)function RTreeEntry
inline RTreeEntry(
const BoundingBox & bbox,
T data
)function contains
inline bool contains(
float x,
float y
) constfunction intersects
inline bool intersects(
const RTreeEntry & other
) constfunction intersects
inline bool intersects(
const BoundingBox & bbox
) constfunction area
inline float area() constfunction width
inline float width() constfunction height
inline float height() constfunction center_x
inline float center_x() constfunction center_y
inline float center_y() constfunction toBoundingBox
inline BoundingBox toBoundingBox() constfunction distanceToPoint
inline float distanceToPoint(
float x,
float y
) constCalculate the minimum distance from a point to this bounding box.
Parameters:
- x X coordinate of the point
- y Y coordinate of the point
Return: Minimum distance (0 if point is inside the box)
function distanceToPointSquared
inline float distanceToPointSquared(
float x,
float y
) constCalculate the squared minimum distance from a point to this bounding box.
Parameters:
- x X coordinate of the point
- y Y coordinate of the point
Return: Squared minimum distance (0 if point is inside the box)
Public Attributes Documentation
variable min_x
float min_x;variable min_y
float min_y;variable max_x
float max_x;variable max_y
float max_y;variable data
T data;Updated on 2026-11-13 at 20:25:39 +0000