Aim: Provides a set of functions to facilitate the computation of convex hulls and polytopes, as well as shortcuts to build cell complex representing a Delaunay complex.
More...
#include <DGtal/geometry/volumes/ConvexityHelper.h>
|
|
static LatticePolytope | computeLatticePolytope (const std::vector< Point > &input_points, bool remove_duplicates=true, bool make_minkowski_summable=false) |
|
template<typename TSurfaceMesh > |
static bool | computeConvexHullBoundary (TSurfaceMesh &mesh, const std::vector< Point > &input_points, bool remove_duplicates=true) |
|
static bool | computeConvexHullBoundary (PolygonalSurface< Point > &polysurf, const std::vector< Point > &input_points, bool remove_duplicates=true) |
|
static bool | computeConvexHullCellComplex (ConvexCellComplex< Point > &cell_complex, const std::vector< Point > &input_points, bool remove_duplicates=true) |
|
|
static bool | computeDelaunayCellComplex (ConvexCellComplex< Point > &cell_complex, const std::vector< Point > &input_points, bool remove_duplicates=true) |
|
|
static RationalPolytope | computeRationalPolytope (const std::vector< RealPoint > &input_points, Integer denominator, bool remove_duplicates=true, bool make_minkowski_summable=false) |
|
template<typename TSurfaceMesh > |
static bool | computeConvexHullBoundary (TSurfaceMesh &mesh, const std::vector< RealPoint > &input_points, double precision=1024.0, bool remove_duplicates=true) |
|
static bool | computeConvexHullBoundary (PolygonalSurface< RealPoint > &polysurf, const std::vector< RealPoint > &input_points, double precision=1024.0, bool remove_duplicates=true) |
|
static bool | computeConvexHullCellComplex (ConvexCellComplex< RealPoint > &cell_complex, const std::vector< RealPoint > &input_points, double precision=1024.0, bool remove_duplicates=true) |
|
|
static bool | computeDelaunayCellComplex (ConvexCellComplex< RealPoint > &cell_complex, const std::vector< RealPoint > &input_points, double precision=1024.0, bool remove_duplicates=true) |
|
|
template<typename QHull > |
static void | computeFacetAndRidgeVertices (const QHull &hull, std::vector< IndexRange > &cell_vertices, std::map< typename QHull::Ridge, Index > &r2f, std::vector< IndexRange > &face_vertices) |
|
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
struct DGtal::ConvexityHelper< dim, TInteger, TInternalInteger >
Aim: Provides a set of functions to facilitate the computation of convex hulls and polytopes, as well as shortcuts to build cell complex representing a Delaunay complex.
Description of template class 'ConvexityHelper'
- Template Parameters
-
dim | the dimension of the space where points and further objects live. |
TInteger | the integral type used to define the digital space, a model of concepts::CInteger. It sets the coordinate type of input lattice points as well as output integral convex hulls and lattice polytopes. |
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. |
- See also
- QuickHull algorithm in arbitrary dimension for convex hull and Delaunay cell complex computation
Definition at line 82 of file ConvexityHelper.h.
◆ Index
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ IndexRange
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ Integer
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ InternalInteger
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ LatticeConvexHullKernel
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ LatticeDelaunayKernel
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ LatticePolytope
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ Point
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ RationalPolytope
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ RealConvexHullKernel
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ RealDelaunayKernel
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ RealPoint
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ RealVector
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ Size
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ Space
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ Vector
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ BOOST_CONCEPT_ASSERT() [1/2]
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ BOOST_CONCEPT_ASSERT() [2/2]
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ BOOST_STATIC_ASSERT()
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
◆ computeConvexHullBoundary() [1/4]
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
Computes a polygonal surface representation of the boundary of the convex hull of the given lattice points.
- Note
- Since it builds a surface, this method is thus 3D.
- Parameters
-
[out] | polysurf | the output polygonal surface that represents the boundary of the convex hull of the given range of points. Its euler characteristic should be 0 in even dimension, 2 in odd dimension. |
[in] | input_points | the range of input lattice points. |
[in] | remove_duplicates | should be set to 'true' if the input data has duplicates. |
- Returns
- 'true' if the input points were full dimensional and the output surface is correct, otherwise return 'false'.
◆ computeConvexHullBoundary() [2/4]
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
Computes a polygonal surface representation of the boundary of the rational polytope that approximates the convex hull of the given real points.
- Note
- Since it builds a surface, this method is thus 3D.
- Parameters
-
[out] | polysurf | the output polygonal surface mesh that represents the boundary of the convex hull of the given range of points. |
[in] | input_points | the range of input real points. |
[in] | precision | the scaling factor that is used to multiply each real coordinate before rounding it to an integer, a kind of common denominator if you think of the result as a rational number. |
[in] | remove_duplicates | should be set to 'true' if the input data has duplicates. |
- Returns
- 'true' if the input points were full dimensional and the output mesh is correct, otherwise return 'false'.
◆ computeConvexHullBoundary() [3/4]
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
template<typename TSurfaceMesh >
static bool DGtal::ConvexityHelper< dim, TInteger, TInternalInteger >::computeConvexHullBoundary |
( |
TSurfaceMesh & |
mesh, |
|
|
const std::vector< Point > & |
input_points, |
|
|
bool |
remove_duplicates = true |
|
) |
| |
|
static |
Computes a surface mesh representation of the boundary of the convex hull of the given lattice points.
- Note
- Since it builds a surface, this method is thus 3D.
- Template Parameters
-
TSurfaceMesh | any model of surface that can be initialized with a range of input positions (cast as real coordinates) and a range of index ranges giving for each face its range of incident vertices. For instance, you may use class SurfaceMesh. |
- Parameters
-
[out] | mesh | the output surface mesh that represents the boundary of the convex hull of the given range of points. |
[in] | input_points | the range of input lattice points. |
[in] | remove_duplicates | should be set to 'true' if the input data has duplicates. |
- Returns
- 'true' if the input points were full dimensional and the output mesh is correct, otherwise return 'false'.
◆ computeConvexHullBoundary() [4/4]
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
template<typename TSurfaceMesh >
static bool DGtal::ConvexityHelper< dim, TInteger, TInternalInteger >::computeConvexHullBoundary |
( |
TSurfaceMesh & |
mesh, |
|
|
const std::vector< RealPoint > & |
input_points, |
|
|
double |
precision = 1024.0 , |
|
|
bool |
remove_duplicates = true |
|
) |
| |
|
static |
Computes a surface mesh representation of the boundary of the rational polytope that approximates the convex hull of the given real points.
- Note
- Since it builds a surface, this method is thus 3D.
- Template Parameters
-
TSurfaceMesh | any model of surface that can be initialized with a range of input positions (cast as real coordinates) and a range of index ranges giving for each face its range of incident vertices. For instance, you may use class SurfaceMesh. |
- Parameters
-
[out] | mesh | the output surface mesh that represents the boundary of the convex hull of the given range of points. |
[in] | input_points | the range of input real points. |
[in] | precision | the scaling factor that is used to multiply each real coordinate before rounding it to an integer, a kind of common denominator if you think of the result as a rational number. |
[in] | remove_duplicates | should be set to 'true' if the input data has duplicates. |
- Returns
- 'true' if the input points were full dimensional and the output mesh is correct, otherwise return 'false'.
◆ computeConvexHullCellComplex() [1/2]
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
Computes a cell complex representing the convex hull of the given lattice points, formed of one maximal dimension cell and as many cells of codimension 1 as the number of facets of the convex hull.
- Parameters
-
[out] | cell_complex | the output cell complex that represents the convex hull of the given lattice points. |
[in] | input_points | the range of input lattice points. |
[in] | remove_duplicates | should be set to 'true' if the input data has duplicates. |
- Returns
- 'true' if the input points were full dimensional and the output complex is correct, otherwise return 'false'.
◆ computeConvexHullCellComplex() [2/2]
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
Computes a cell complex representing the convex hull of the given real points, formed of one maximal dimension cell and as many cells of codimension 1 as the number of facets of the convex hull.
- Parameters
-
[out] | cell_complex | the output cell complex that represents the convex hull of the given real points. |
[in] | input_points | the range of input real points. |
[in] | precision | the scaling factor that is used to multiply each real coordinate before rounding it to an integer, a kind of common denominator if you think of the result as a rational number. |
[in] | remove_duplicates | should be set to 'true' if the input data has duplicates. |
- Returns
- 'true' if the input points were full dimensional and the output complex is correct, otherwise return 'false'.
◆ computeDelaunayCellComplex() [1/2]
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
Computes the Delaunay cell complex associated to the given range of input points.
- Parameters
-
[out] | cell_complex | the output cell complex that represents the Delaunay complex of the given lattice points. |
[in] | input_points | the range of input lattice points. |
[in] | remove_duplicates | should be set to 'true' if the input data has duplicates. |
- Returns
- 'true' if the input points were full dimensional and the output complex is correct, otherwise return 'false'.
- Note
- The Delaunay cell complex may not be simplicial if some points are cospherical.
- Examples
- geometry/tools/exampleLatticeBallDelaunay3D.cpp, and geometry/tools/exampleRationalBallDelaunay3D.cpp.
Referenced by main().
◆ computeDelaunayCellComplex() [2/2]
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
Computes the Delaunay cell complex associated to the given range of input real points.
- Parameters
-
[out] | cell_complex | the output cell complex that represents the Delaunay complex of the given lattice points. |
[in] | input_points | the range of input real points. |
[in] | precision | the scaling factor that is used to multiply each real coordinate before rounding it to an integer, a kind of common denominator if you think of the result as a rational number. |
[in] | remove_duplicates | should be set to 'true' if the input data has duplicates. |
- Returns
- 'true' if the input points were full dimensional and the output complex is correct, otherwise return 'false'.
- Note
- The Delaunay cell complex may not be simplicial if some points are cospherical.
◆ computeFacetAndRidgeVertices()
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
template<typename QHull >
static void DGtal::ConvexityHelper< dim, TInteger, TInternalInteger >::computeFacetAndRidgeVertices |
( |
const QHull & |
hull, |
|
|
std::vector< IndexRange > & |
cell_vertices, |
|
|
std::map< typename QHull::Ridge, Index > & |
r2f, |
|
|
std::vector< IndexRange > & |
face_vertices |
|
) |
| |
|
static |
- Template Parameters
-
- Parameters
-
[in] | hull | a computed QuickHull object |
[out] | cell_vertices | the vector giving for each cell the indices of its vertices. |
[out] | r2f | the map giving for each ridge (i.e. the pair of cells defining each face) the index of its corresponding face. |
[out] | face_vertices | the vector giving for each face the indices of its vertices. |
- Precondition
hull.status() >= Status::VerticesCompleted
and hull.status() <= Status::AllCompleted
◆ computeLatticePolytope()
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
Computes and returns a halfspace representation of the tightiest lattice polytope enclosing all the given input lattice points.
- Parameters
-
[in] | input_points | the range of input lattice points. |
[in] | remove_duplicates | should be set to 'true' if the input data has duplicates. |
[in] | make_minkowski_summable | Other constraints are added so that we can perform axis aligned Minkowski sums on this polytope. Useful for checking full convexity (see moduleDigitalConvexity). |
- Returns
- the tightiest bounded lattice polytope (i.e. H-representation) including the given range of points, or an empty polytope if the given range of points was not full dimensional.
◆ computeRationalPolytope()
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
Computes and returns a halfspace representation of the tightiest rational polytope enclosing all the given input real points.
- Parameters
-
[in] | input_points | the range of input real points. |
[in] | denominator | the denominator used in all rational approximations of points with real value coordinates, the higher the more precise. |
[in] | remove_duplicates | should be set to 'true' if the input data has duplicates. |
[in] | make_minkowski_summable | Other constraints are added so that we can perform axis aligned Minkowski sums on this polytope. Useful for checking full convexity (see moduleDigitalConvexity). |
- Returns
- the tightiest bounded lattice polytope (i.e. H-representation) including the given range of points, or an empty polytope if the given range of points was not full dimensional.
◆ dimension
template<int dim, typename TInteger = DGtal::int32_t, typename TInternalInteger = DGtal::int64_t>
The documentation for this struct was generated from the following file: