Skip to main content

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() =default

function 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
) const

function intersects

inline bool intersects(
    const RTreeEntry & other
) const

function intersects

inline bool intersects(
    const BoundingBox & bbox
) const

function area

inline float area() const

function width

inline float width() const

function height

inline float height() const

function center_x

inline float center_x() const

function center_y

inline float center_y() const

function toBoundingBox

inline BoundingBox toBoundingBox() const

function distanceToPoint

inline float distanceToPoint(
    float x,
    float y
) const

Calculate 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
) const

Calculate 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