CGAL 5.1 - dD Spatial Searching
CGAL::Kd_tree_rectangle< FT, Dimension > Class Template Reference

#include <CGAL/Kd_tree_rectangle.h>

Definition

template<typename FT, typename Dimension>
class CGAL::Kd_tree_rectangle< FT, Dimension >

The class Kd_tree_rectangle implements d-dimensional iso-rectangles and related operations, e.g., methods to compute bounding boxes of point sets.

Examples
Spatial_searching/Distance.h.

Related Functions

(Note that these are not member functions.)

template<class FT >
std::ostream & operator<< (std::ostream &s, Kd_tree_rectangle< FT > &r)
 Inserts rectangle r in the output stream s and returns s. More...
 

Types

typedef Dimension Dimension
 Dimension type. More...
 
typedef FT FT
 Number type. More...
 

Creation

 Kd_tree_rectangle (int d)
 Constructs a d-dimensional rectangle r with lower bound and upper bound set to zero in each dimension. More...
 
template<class Construct_cartesian_const_iterator_d , class PointIter >
 Kd_tree_rectangle (int d, PointIter begin, PointIter end, const Construct_cartesian_const_iterator_d &construct_it)
 Constructs the bounding box of the points in the range [begin,end), where the value type of PointIter can be used by operators of functors Construct_cartesian_const_iterator_d to define iterators with value type FT. More...
 

Operations

FT min_coord (int i) const
 Returns the lower bound of the rectangle in dimension i. More...
 
FT max_coord (int i) const
 Returns the upper bound of the rectangle in dimension i. More...
 
void set_upper_bound (int i, const FT &x)
 Sets upper bound in dimension i to x. More...
 
void set_lower_bound (int i, const FT &x)
 Sets lower bound in dimension i to x. More...
 
FT max_span () const
 Returns the maximal span of the rectangle. More...
 
FT max_span_coord () const
 Returns the smallest coordinate for which the rectangle has its maximal span. More...
 
int dimension () const
 Returns the dimension of the rectangle. More...
 
void split (Kd_tree_rectangle< FT, Dimension > &r, int d, FT value)
 Splits rectangle in dimension d at coordinate-value value by modifying itself to lower half and by modifying r to upper half. More...
 

Member Typedef Documentation

◆ Dimension

template<typename FT , typename Dimension >
typedef Dimension CGAL::Kd_tree_rectangle< FT, Dimension >::Dimension

◆ FT

template<typename FT , typename Dimension >
typedef FT CGAL::Kd_tree_rectangle< FT, Dimension >::FT

Number type.

Constructor & Destructor Documentation

◆ Kd_tree_rectangle() [1/2]

template<typename FT , typename Dimension >
CGAL::Kd_tree_rectangle< FT, Dimension >::Kd_tree_rectangle ( int  d)

Constructs a d-dimensional rectangle r with lower bound and upper bound set to zero in each dimension.

◆ Kd_tree_rectangle() [2/2]

template<typename FT , typename Dimension >
template<class Construct_cartesian_const_iterator_d , class PointIter >
CGAL::Kd_tree_rectangle< FT, Dimension >::Kd_tree_rectangle ( int  d,
PointIter  begin,
PointIter  end,
const Construct_cartesian_const_iterator_d &  construct_it 
)

Constructs the bounding box of the points in the range [begin,end), where the value type of PointIter can be used by operators of functors Construct_cartesian_const_iterator_d to define iterators with value type FT.

Member Function Documentation

◆ dimension()

template<typename FT , typename Dimension >
int CGAL::Kd_tree_rectangle< FT, Dimension >::dimension ( ) const

Returns the dimension of the rectangle.

◆ max_coord()

template<typename FT , typename Dimension >
FT CGAL::Kd_tree_rectangle< FT, Dimension >::max_coord ( int  i) const

Returns the upper bound of the rectangle in dimension i.

◆ max_span()

template<typename FT , typename Dimension >
FT CGAL::Kd_tree_rectangle< FT, Dimension >::max_span ( ) const

Returns the maximal span of the rectangle.

◆ max_span_coord()

template<typename FT , typename Dimension >
FT CGAL::Kd_tree_rectangle< FT, Dimension >::max_span_coord ( ) const

Returns the smallest coordinate for which the rectangle has its maximal span.

◆ min_coord()

template<typename FT , typename Dimension >
FT CGAL::Kd_tree_rectangle< FT, Dimension >::min_coord ( int  i) const

Returns the lower bound of the rectangle in dimension i.

◆ set_lower_bound()

template<typename FT , typename Dimension >
void CGAL::Kd_tree_rectangle< FT, Dimension >::set_lower_bound ( int  i,
const FT x 
)

Sets lower bound in dimension i to x.

◆ set_upper_bound()

template<typename FT , typename Dimension >
void CGAL::Kd_tree_rectangle< FT, Dimension >::set_upper_bound ( int  i,
const FT x 
)

Sets upper bound in dimension i to x.

◆ split()

template<typename FT , typename Dimension >
void CGAL::Kd_tree_rectangle< FT, Dimension >::split ( Kd_tree_rectangle< FT, Dimension > &  r,
int  d,
FT  value 
)

Splits rectangle in dimension d at coordinate-value value by modifying itself to lower half and by modifying r to upper half.

Friends And Related Function Documentation

◆ operator<<()

template<class FT >
std::ostream & operator<< ( std::ostream &  s,
Kd_tree_rectangle< FT > &  r 
)
related

Inserts rectangle r in the output stream s and returns s.