|
DGtal 2.1.0
|
Aim: Implements the quickhull algorithm by Barber et al. [9], a famous arbitrary dimensional convex hull computation algorithm. It relies on dedicated geometric kernels for computing and comparing facet geometries. More...
#include <DGtal/geometry/tools/GenericLatticeConvexHull.h>
Public Types | |
| typedef ConvexHullIntegralKernel< dim, TCoordinateInteger, TInternalInteger > | Kernel |
| typedef Kernel::CoordinatePoint | Point |
| typedef Kernel::CoordinateScalar | Integer |
| typedef Kernel::InternalScalar | InternalInteger |
| typedef Point | OutputPoint |
| typedef std::size_t | Index |
| typedef std::size_t | Size |
| typedef std::vector< Index > | IndexRange |
| typedef detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, dim > | GenericComputers |
Public Member Functions | |
Standard services (construction, initialization, accessors) | |
| GenericLatticeConvexHull (const Kernel &K_=Kernel(), int dbg=0) | |
| void | clear () |
| Clears the object as if no computations have been made. | |
convex hull services | |
| template<typename InputPoint > | |
| bool | compute (const std::vector< InputPoint > &input_points) |
| Integer | count () |
| Integer | countInterior () |
| Integer | countBoundary () |
| Integer | countUpTo (Integer max) |
Interface | |
| void | selfDisplay (std::ostream &out) const |
| bool | isValid () const |
Data Fields | |
public datas | |
| Kernel | kernel |
| The main quickhull kernel that is used for convex hull computations. | |
| int | debug_level |
| debug_level from 0:no to 2:verbose | |
| GenericComputers | generic_computers |
| std::vector< OutputPoint > | points |
| the set of input points, indexed as in the input | |
| std::vector< OutputPoint > | projected_points |
| the set of projected input points, indexed as in the input | |
| int64_t | affine_dimension |
| The affine dimension of the input set. | |
| std::vector< OutputPoint > | positions |
| The positions of the vertices (a subset of the input points). | |
| std::vector< IndexRange > | facets |
| The range giving for each facet the indices of its vertices. | |
| IndexRange | vertex2point |
| The indices of the vertices of the convex hull in the original set. | |
| Integer | projected_dilation |
| The factor of dilation d applied on every projected point coordinates. | |
| AffineBasis< OutputPoint > | affine_basis |
| bool | polytope_computed { false } |
| When 'true', the polytope has been computed. | |
Static Public Attributes | |
| static const Size | dimension = Point::dimension |
Aim: Implements the quickhull algorithm by Barber et al. [9], a famous arbitrary dimensional convex hull computation algorithm. It relies on dedicated geometric kernels for computing and comparing facet geometries.
Description of template class 'GenericLatticeConvexHull'
| dim | the dimension of the space of processed points. |
| TCoordinateInteger | the integer type that represents coordinates of lattice points, a model of concepts::CInteger. |
| TInternalInteger | the integer type that is used for internal computations of above/below plane tests, a model of concepts::CInteger. Must be at least as precise as TCoordinateInteger. |
Definition at line 521 of file GenericLatticeConvexHull.h.
| typedef detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, dim > DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::GenericComputers |
Definition at line 534 of file GenericLatticeConvexHull.h.
| typedef std::size_t DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::Index |
Definition at line 530 of file GenericLatticeConvexHull.h.
| typedef std::vector< Index > DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::IndexRange |
Definition at line 532 of file GenericLatticeConvexHull.h.
| typedef Kernel::CoordinateScalar DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::Integer |
Definition at line 527 of file GenericLatticeConvexHull.h.
| typedef Kernel::InternalScalar DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::InternalInteger |
Definition at line 528 of file GenericLatticeConvexHull.h.
| typedef ConvexHullIntegralKernel< dim, TCoordinateInteger, TInternalInteger > DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::Kernel |
Definition at line 525 of file GenericLatticeConvexHull.h.
| typedef Point DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::OutputPoint |
Definition at line 529 of file GenericLatticeConvexHull.h.
| typedef Kernel::CoordinatePoint DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::Point |
Definition at line 526 of file GenericLatticeConvexHull.h.
| typedef std::size_t DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::Size |
Definition at line 531 of file GenericLatticeConvexHull.h.
|
inline |
Default constructor
| [in] | K_ | a kernel for computing facet geometries. |
| [in] | dbg | the trace level, from 0 (no) to 3 (very verbose). |
Definition at line 547 of file GenericLatticeConvexHull.h.
References DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::clear().
|
inline |
Clears the object as if no computations have been made.
Definition at line 554 of file GenericLatticeConvexHull.h.
References DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::affine_basis, DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::affine_dimension, DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::clear(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::facets, DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::generic_computers, DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::points, DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::polytope_computed, DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::positions, DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::projected_dilation, DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::projected_points, and DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::vertex2point.
Referenced by DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::GenericLatticeConvexHull().
|
inline |
Sets the input data for the QuickHull convex hull algorithm, which is a range of points.
| InputPoint | a model of point that is convertible to Point datatype. |
| [in] | input_points | the range of input points. |
Definition at line 586 of file GenericLatticeConvexHull.h.
References DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::compute(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::debug_level, DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::facets, DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::generic_computers, DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::positions, DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::projected_points, and DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::vertex2point.
|
inline |
Computes the number of integer points lying within the polytope.
Definition at line 623 of file GenericLatticeConvexHull.h.
References DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::count(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::generic_computers, DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::makePolytope(), and DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::polytope_computed.
|
inline |
Computes the number of integer points lying on the boundary of the polytope.
count() <= countInterior() + countBoundary() with equality when the polytope is closed. Definition at line 669 of file GenericLatticeConvexHull.h.
References DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::countBoundary(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::generic_computers, DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::makePolytope(), and DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::polytope_computed.
|
inline |
Computes the number of integer points lying within the interior of the polytope.
count() <= countInterior() + countBoundary() with equality when the polytope is closed. Definition at line 646 of file GenericLatticeConvexHull.h.
References DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::countInterior(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::generic_computers, DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::makePolytope(), and DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::polytope_computed.
|
inline |
Computes the number of integer points within the polytope up to some maximum number max.
| [in] | max | the maximum number of points that are counted, the method exists when this number of reached. |
Definition at line 698 of file GenericLatticeConvexHull.h.
References DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::countUpTo(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::generic_computers, DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::makePolytope(), max(), and DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::polytope_computed.
|
inline |
Checks the validity/consistency of the object.
Definition at line 729 of file GenericLatticeConvexHull.h.
References DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::affine_dimension.
|
inline |
Writes/Displays the object on an output stream.
| out | the output stream where the object is written. |
Definition at line 716 of file GenericLatticeConvexHull.h.
References DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::affine_dimension, DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::dimension, DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::facets, DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::points, and DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::positions.
| AffineBasis< OutputPoint > DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::affine_basis |
The affine basis used for projection (identity if the convex hull is full dimensional, otherwise a basis in reduced echelon form).
Definition at line 766 of file GenericLatticeConvexHull.h.
Referenced by DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::clear(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::compute(), and DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, 1 >::compute().
| int64_t DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::affine_dimension |
The affine dimension of the input set.
Definition at line 754 of file GenericLatticeConvexHull.h.
Referenced by DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::clear(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::compute(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, 1 >::compute(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::count(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::countBoundary(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::countInterior(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::countUpTo(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::isValid(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::makePolytope(), and DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::selfDisplay().
| int DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::debug_level |
debug_level from 0:no to 2:verbose
Definition at line 744 of file GenericLatticeConvexHull.h.
Referenced by DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::compute().
|
static |
Definition at line 536 of file GenericLatticeConvexHull.h.
Referenced by DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::compute(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, 1 >::compute(), and DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::selfDisplay().
| std::vector< IndexRange > DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::facets |
The range giving for each facet the indices of its vertices.
Definition at line 758 of file GenericLatticeConvexHull.h.
Referenced by DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::clear(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::compute(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::compute(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, 1 >::compute(), and DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::selfDisplay().
| GenericComputers DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::generic_computers |
The delegate computation kernel that can take care of all kind of convex hulls, full dimensional or degenerated.
Definition at line 747 of file GenericLatticeConvexHull.h.
Referenced by DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::clear(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::compute(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::count(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::countBoundary(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::countInterior(), and DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::countUpTo().
| Kernel DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::kernel |
The main quickhull kernel that is used for convex hull computations.
Definition at line 742 of file GenericLatticeConvexHull.h.
| std::vector< OutputPoint > DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::points |
the set of input points, indexed as in the input
Definition at line 750 of file GenericLatticeConvexHull.h.
Referenced by DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::clear(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::compute(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, 1 >::compute(), and DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::selfDisplay().
| bool DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::polytope_computed { false } |
When 'true', the polytope has been computed.
Definition at line 768 of file GenericLatticeConvexHull.h.
Referenced by DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::clear(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::count(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::countBoundary(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::countInterior(), and DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::countUpTo().
| std::vector< OutputPoint > DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::positions |
The positions of the vertices (a subset of the input points).
Definition at line 756 of file GenericLatticeConvexHull.h.
Referenced by DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::clear(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::compute(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::compute(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, 1 >::compute(), and DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::selfDisplay().
| Integer DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::projected_dilation |
The factor of dilation d applied on every projected point coordinates.
Definition at line 762 of file GenericLatticeConvexHull.h.
Referenced by DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::clear(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::compute(), and DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, 1 >::compute().
| std::vector< OutputPoint > DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::projected_points |
the set of projected input points, indexed as in the input
Definition at line 752 of file GenericLatticeConvexHull.h.
Referenced by DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::clear(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::compute(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::compute(), and DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, 1 >::compute().
| IndexRange DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::vertex2point |
The indices of the vertices of the convex hull in the original set.
Definition at line 760 of file GenericLatticeConvexHull.h.
Referenced by DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::clear(), DGtal::GenericLatticeConvexHull< dim, TCoordinateInteger, TInternalInteger >::compute(), DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, K >::compute(), and DGtal::detail::GenericLatticeConvexHullComputers< dim, TCoordinateInteger, TInternalInteger, 1 >::compute().