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*.

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 () Return an iterator pointing to the pointer to the first point.

iterator c.end () Return the iterator to the corresponding past-the-end iterator.

int c.dimension () const Return the dimension.

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

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

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

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

FT c.max_tight_span_lower () Return 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 () Return upper value of the interval corresponding to max_span_coord().

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

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

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

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

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

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

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

int c.max_tight_span_coord_balanced ( FT aspect_ratio)
Return 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)
Return the splitting value for fair splitting.

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

int c.size () Return the number of points stored.

bool c.empty () Return 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