Class

CGAL::Point_container<Traits>

Definition

A custom container for points used to build a tree. Each point container holds the points from a rectangle associated with a node of the tree. In the remainder of this reference page this rectangle is called the associated rectangle. Provides a method to split a container and a number of methods to support the implementation of splitting rules.

#include <CGAL/Point_container.h>

Parameters

Expects for the template argument an implementation for d-dimensional points of the concept SearchTraits, for example CGAL::Cartesian_d<double>.

Types

Traits::FT FT; Number type.

Traits::Point_d Point_d; Point type.

Point_container<Traits>::iterator
An iterator with value type Point_d*.


Point_container<Traits>::const_iterator
A const iterator with value type const Point_d*.

Creation

Point_container<Traits> c ( int d);
Construct an empty container for storing d-dimensional points.


template <class InputIterator>
Point_container<Traits> c ( int d, InputIterator begin, InputIterator end);
Construct the container of d-dimensional points of type Point_d given by the iterator sequence [begin, end).

Operations

template <class SpatialSeparator>
void c.split ( &c2, SpatialSeparator sep, bool sliding=false)
Given an empty container c2 with the same dimension as c, splits c into cand c2 using the separator sep. If sliding is true after splitting each container contains at least one point. Container c should contain at least two points.

void c.swap ( &c2) Swap the contents of c and c2

void c.recompute_tight_bounding_box ()
Recompute the bounding box of the points in the container.

iterator c.begin () Returns an iterator to a pointer to the first point.

iterator c.end () Returns the appropriate past-the-end iterator.

const_iterator c.begin () const Returns a const iterator to a pointer to the first point.

const_iterator c.end () const Returns the appropriate past-the-end const iterator.

int c.dimension () const Returns the dimension.

int c.built_coordinate () const Returns coordinate for which the pointer list is built.

int c.max_span_coord () const Returns coordinate where the associated rectangle has maximal span.

int c.max_tight_span_coord () const Returns coordinate where the point coordinates have maximal span.

FT c.max_span_lower () const Returns lower value of the interval corresponding to max_span_coord().

FT c.max_tight_span_lower () const Returns lower value of the interval corresponding to max_tight_span_coord(). That is, the smallest max_tight_span_coord()-th coordinate of the points in c.

FT c.max_span_upper () const Returns upper value of the interval corresponding to max_span_coord().

FT c.max_span_upper_without_dim ( int d) const
Returns upper value of the interval over all dimensions without taking dimension d into account.

FT c.max_tight_span_upper () const Returns upper value of the interval corresponding to max_tight_span_coord().

FT c.max_spread () const Returns the size of the interval corresponding to max_span_coord().

FT c.max_tight_spread () const Returns the size of the interval corresponding to max_tight_span_coord().

FT c.median ( int split_coord) const Returns the median value of the points stored in the container for dimension split_coord.

Kd_tree_rectangle<Traits> c.bounding_box () const Returns the associated rectangle.

Kd_tree_rectangle<Traits> c.tight_bounding_box () Returns the bounding box of the items in associated rectangle.

int c.max_tight_span_coord_balanced ( FT aspect_ratio) const
Returns the dimension with the maximal point spread, for which after fair splitting the ratio of the length of the longest side and the smallest side of the bounding box of the items in associated rectangle, does not exceed aspect_ratio.

FT c.balanced_fair ( int d, FT aspect_ratio)
Returns the splitting value for fair splitting.

FT c.balanced_sliding_fair ( int d, FT aspect_ratio)
Returns the splitting value for sliding fair splitting.

std::size_t c.size () const Returns the number of points stored.

bool c.empty () const Returns true if no points are present, false otherwise.

Output Routines

template<class Traits>
std::ostream& std::ostream& s << c Prints the point container c to the output stream s and returns s.

See Also

SearchTraits
SpatialSeparator