Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
K2Tree< T >::Node Struct Reference

Internal node structure for the k-d tree. More...

Collaboration diagram for K2Tree< T >::Node:
[legend]

Public Member Functions

 Node (Point p) noexcept
 Construct a node with a given point.
 
void set_rect (const Geom_Number &xmin, const Geom_Number &ymin, const Geom_Number &xmax, const Geom_Number &ymax) noexcept
 Set the rectangular region for this node.
 
void set_rect (const Point &pmin, const Point &pmax) noexcept
 Set the rectangular region using corner points.
 
const Geom_Numberxmin () const noexcept
 
const Geom_Numberymin () const noexcept
 
const Geom_Numberxmax () const noexcept
 
const Geom_Numberymax () const noexcept
 
const Geom_Numberx () const noexcept
 
const Geom_Numbery () const noexcept
 

Public Attributes

Point point_
 The point stored at this node.
 
Rectangle rect_
 The axis-aligned rectangle for this node's region.
 
Nodelb_
 Left/bottom subtree.
 
Nodert_
 Right/top subtree.
 

Detailed Description

template<typename T = Empty_Class>
struct K2Tree< T >::Node

Internal node structure for the k-d tree.

Definition at line 138 of file tpl_2dtree.H.

Constructor & Destructor Documentation

◆ Node()

template<typename T = Empty_Class>
K2Tree< T >::Node::Node ( Point  p)
inlinenoexcept

Construct a node with a given point.

Definition at line 146 of file tpl_2dtree.H.

Member Function Documentation

◆ set_rect() [1/2]

template<typename T = Empty_Class>
void K2Tree< T >::Node::set_rect ( const Geom_Number xmin,
const Geom_Number ymin,
const Geom_Number xmax,
const Geom_Number ymax 
)
inlinenoexcept

◆ set_rect() [2/2]

template<typename T = Empty_Class>
void K2Tree< T >::Node::set_rect ( const Point pmin,
const Point pmax 
)
inlinenoexcept

Set the rectangular region using corner points.

Definition at line 160 of file tpl_2dtree.H.

References Aleph::pmax(), Aleph::pmin(), K2Tree< T >::Node::rect_, and Aleph::Rectangle::set_rect().

◆ x()

template<typename T = Empty_Class>
const Geom_Number & K2Tree< T >::Node::x ( ) const
inlinenoexcept

Definition at line 169 of file tpl_2dtree.H.

References Aleph::Point::get_x(), and K2Tree< T >::Node::point_.

Referenced by K2Tree< T >::build_balanced().

◆ xmax()

template<typename T = Empty_Class>
const Geom_Number & K2Tree< T >::Node::xmax ( ) const
inlinenoexcept

Definition at line 167 of file tpl_2dtree.H.

References Aleph::Rectangle::get_xmax(), and K2Tree< T >::Node::rect_.

Referenced by K2Tree< T >::Node::set_rect().

◆ xmin()

template<typename T = Empty_Class>
const Geom_Number & K2Tree< T >::Node::xmin ( ) const
inlinenoexcept

Definition at line 165 of file tpl_2dtree.H.

References Aleph::Rectangle::get_xmin(), and K2Tree< T >::Node::rect_.

Referenced by K2Tree< T >::Node::set_rect().

◆ y()

template<typename T = Empty_Class>
const Geom_Number & K2Tree< T >::Node::y ( ) const
inlinenoexcept

Definition at line 170 of file tpl_2dtree.H.

References Aleph::Point::get_y(), and K2Tree< T >::Node::point_.

Referenced by K2Tree< T >::build_balanced().

◆ ymax()

template<typename T = Empty_Class>
const Geom_Number & K2Tree< T >::Node::ymax ( ) const
inlinenoexcept

Definition at line 168 of file tpl_2dtree.H.

References Aleph::Rectangle::get_ymax(), and K2Tree< T >::Node::rect_.

Referenced by K2Tree< T >::Node::set_rect().

◆ ymin()

template<typename T = Empty_Class>
const Geom_Number & K2Tree< T >::Node::ymin ( ) const
inlinenoexcept

Definition at line 166 of file tpl_2dtree.H.

References Aleph::Rectangle::get_ymin(), and K2Tree< T >::Node::rect_.

Referenced by K2Tree< T >::Node::set_rect().

Member Data Documentation

◆ lb_

template<typename T = Empty_Class>
Node* K2Tree< T >::Node::lb_

Left/bottom subtree.

Definition at line 142 of file tpl_2dtree.H.

Referenced by K2Tree< T >::build_balanced(), and K2Tree< T >::for_each_node().

◆ point_

template<typename T = Empty_Class>
Point K2Tree< T >::Node::point_

The point stored at this node.

Definition at line 140 of file tpl_2dtree.H.

Referenced by K2Tree< T >::for_each_node(), K2Tree< T >::nearest(), K2Tree< T >::Node::x(), and K2Tree< T >::Node::y().

◆ rect_

template<typename T = Empty_Class>
Rectangle K2Tree< T >::Node::rect_

◆ rt_

template<typename T = Empty_Class>
Node* K2Tree< T >::Node::rt_

Right/top subtree.

Definition at line 143 of file tpl_2dtree.H.

Referenced by K2Tree< T >::build_balanced(), and K2Tree< T >::for_each_node().


The documentation for this struct was generated from the following file: