CGAL 5.1 - Classification
CGAL::Classification::Planimetric_grid< GeomTraits, PointRange, PointMap > Class Template Reference

#include <CGAL/Classification/Planimetric_grid.h>

Definition

template<typename GeomTraits, typename PointRange, typename PointMap>
class CGAL::Classification::Planimetric_grid< GeomTraits, PointRange, PointMap >

Class that precomputes a 2D planimetric grid.

The grid is composed of squared cells with a user-defined size, each cell containing the list of indices of the points whose projection along the Z-axis lies within this cell. The mapping from each point to the cell it lies in is also stored.

Template Parameters
GeomTraitsmodel of CGAL Kernel.
PointRangemodel of ConstRange. Its iterator type is RandomAccessIterator and its value type is the key type of PointMap.
PointMapmodel of ReadablePropertyMap whose key type is the value type of the iterator of PointRange and value type is GeomTraits::Point_3.

Public Types

typedef GeomTraits::Point_3 Point_3
 
typedef GeomTraits::Iso_cuboid_3 Iso_cuboid_3
 
typedef unspecified_type iterator
 A forward iterator with value type std::size_t. More...
 

Public Member Functions

 Planimetric_grid (const PointRange &input, PointMap point_map, const Iso_cuboid_3 &bbox, float grid_resolution)
 Constructs a planimetric grid based on the input range. More...
 
float resolution () const
 Returns the resolution of the grid. More...
 
std::size_t width () const
 Returns the number of cells along the X-axis. More...
 
std::size_t height () const
 Returns the number of cells along the Y-axis. More...
 
iterator indices_begin (std::size_t x, std::size_t y) const
 Returns the begin iterator on the indices of the points lying in the cell at position (x,y). More...
 
iterator indices_end (std::size_t x, std::size_t y) const
 Returns the past-the-end iterator on the indices of the points lying in the cell at position (x,y). More...
 
bool has_points (std::size_t x, std::size_t y) const
 Returns false if the cell at position (x,y) is empty, true otherwise. More...
 
std::size_t x (std::size_t index) const
 Returns the x grid coordinate of the point at position index. More...
 
std::size_t y (std::size_t index) const
 Returns the y grid coordinate of the point at position index. More...
 

Member Typedef Documentation

◆ Iso_cuboid_3

template<typename GeomTraits , typename PointRange , typename PointMap >
typedef GeomTraits::Iso_cuboid_3 CGAL::Classification::Planimetric_grid< GeomTraits, PointRange, PointMap >::Iso_cuboid_3

◆ iterator

template<typename GeomTraits , typename PointRange , typename PointMap >
typedef unspecified_type CGAL::Classification::Planimetric_grid< GeomTraits, PointRange, PointMap >::iterator

A forward iterator with value type std::size_t.

◆ Point_3

template<typename GeomTraits , typename PointRange , typename PointMap >
typedef GeomTraits::Point_3 CGAL::Classification::Planimetric_grid< GeomTraits, PointRange, PointMap >::Point_3

Constructor & Destructor Documentation

◆ Planimetric_grid()

template<typename GeomTraits , typename PointRange , typename PointMap >
CGAL::Classification::Planimetric_grid< GeomTraits, PointRange, PointMap >::Planimetric_grid ( const PointRange &  input,
PointMap  point_map,
const Iso_cuboid_3 bbox,
float  grid_resolution 
)

Constructs a planimetric grid based on the input range.

Parameters
inputpoint range.
point_mapproperty map to access the input points.
bboxbounding box of the input range.
grid_resolutionresolution of the planimetric grid.

Member Function Documentation

◆ has_points()

template<typename GeomTraits , typename PointRange , typename PointMap >
bool CGAL::Classification::Planimetric_grid< GeomTraits, PointRange, PointMap >::has_points ( std::size_t  x,
std::size_t  y 
) const

Returns false if the cell at position (x,y) is empty, true otherwise.

◆ height()

template<typename GeomTraits , typename PointRange , typename PointMap >
std::size_t CGAL::Classification::Planimetric_grid< GeomTraits, PointRange, PointMap >::height ( ) const

Returns the number of cells along the Y-axis.

◆ indices_begin()

template<typename GeomTraits , typename PointRange , typename PointMap >
iterator CGAL::Classification::Planimetric_grid< GeomTraits, PointRange, PointMap >::indices_begin ( std::size_t  x,
std::size_t  y 
) const

Returns the begin iterator on the indices of the points lying in the cell at position (x,y).

◆ indices_end()

template<typename GeomTraits , typename PointRange , typename PointMap >
iterator CGAL::Classification::Planimetric_grid< GeomTraits, PointRange, PointMap >::indices_end ( std::size_t  x,
std::size_t  y 
) const

Returns the past-the-end iterator on the indices of the points lying in the cell at position (x,y).

◆ resolution()

template<typename GeomTraits , typename PointRange , typename PointMap >
float CGAL::Classification::Planimetric_grid< GeomTraits, PointRange, PointMap >::resolution ( ) const

Returns the resolution of the grid.

◆ width()

template<typename GeomTraits , typename PointRange , typename PointMap >
std::size_t CGAL::Classification::Planimetric_grid< GeomTraits, PointRange, PointMap >::width ( ) const

Returns the number of cells along the X-axis.

◆ x()

template<typename GeomTraits , typename PointRange , typename PointMap >
std::size_t CGAL::Classification::Planimetric_grid< GeomTraits, PointRange, PointMap >::x ( std::size_t  index) const

Returns the x grid coordinate of the point at position index.

◆ y()

template<typename GeomTraits , typename PointRange , typename PointMap >
std::size_t CGAL::Classification::Planimetric_grid< GeomTraits, PointRange, PointMap >::y ( std::size_t  index) const

Returns the y grid coordinate of the point at position index.