Aim: a geometric kernel to compute the convex hull of digital points with integer-only arithmetic.
More...
#include <DGtal/geometry/tools/QuickHullKernels.h>
|
| typedef ConvexHullCommonKernel< dim, TCoordinateInteger, TInternalInteger > | Base |
| |
| typedef ConvexHullIntegralKernel< dim, TCoordinateInteger, TInternalInteger > | Self |
| |
| typedef ConvexHullIntegralKernel< dim-1, TCoordinateInteger, TInternalInteger > | LowerSelf |
| |
| typedef DGtal::PointVector< dim, CoordinateInteger > | CoordinatePoint |
| |
| typedef DGtal::PointVector< dim, CoordinateInteger > | CoordinateVector |
| |
| typedef CoordinateInteger | CoordinateScalar |
| |
| typedef DGtal::PointVector< dim, InternalInteger > | InternalPoint |
| |
| typedef DGtal::PointVector< dim, InternalInteger > | InternalVector |
| |
| typedef InternalInteger | InternalScalar |
| |
| typedef std::size_t | Size |
| |
| typedef Size | Index |
| |
| typedef std::vector< Index > | IndexRange |
| |
| typedef std::array< Index, dim > | CombinatorialPlaneSimplex |
| |
| typedef TCoordinateInteger | CoordinateInteger |
| |
| typedef TInternalInteger | InternalInteger |
| |
| typedef CoordinateInteger | CoordinateScalar |
| |
| typedef InternalInteger | InternalScalar |
| |
| typedef DGtal::PointVector< dim, CoordinateInteger > | CoordinatePoint |
| |
| typedef DGtal::PointVector< dim, CoordinateInteger > | CoordinateVector |
| |
| typedef DGtal::PointVector< dim, InternalInteger > | InternalPoint |
| |
| typedef DGtal::PointVector< dim, InternalInteger > | InternalVector |
| |
| typedef std::size_t | Size |
| |
| typedef Size | Index |
| |
| typedef std::vector< Index > | IndexRange |
| |
| typedef std::array< Index, dim > | CombinatorialPlaneSimplex |
| |
| typedef ConvexHullCommonKernel< dim, TCoordinateInteger, TInternalInteger > | Self |
| |
| typedef ConvexHullCommonKernel< dim-1, TCoordinateInteger, TInternalInteger > | LowerSelf |
| |
| typedef IntegerConverter< dim, CoordinateInteger > | Outer |
| | Converter to outer coordinate integers or lattice points / vector.
|
| |
| typedef IntegerConverter< dim, InternalInteger > | Inner |
| | Converter to inner internal integers or lattice points / vector.
|
| |
|
| | ConvexHullIntegralKernel ()=default |
| | Default constructor.
|
| |
| bool | hasInfiniteFacets () const |
| |
| bool | isHalfSpaceFacetInfinite (const HalfSpace &hs) const |
| |
| template<typename InputPoint > |
| void | makeInput (std::vector< CoordinatePoint > &processed_points, IndexRange &input2comp, IndexRange &comp2input, const std::vector< InputPoint > &input_points, bool remove_duplicates) |
| |
| template<typename OutputPoint > |
| void | convertPointTo (const CoordinatePoint &p, OutputPoint &out_p) const |
| |
| HalfSpace | compute (const std::vector< CoordinatePoint > &vpoints, const CombinatorialPlaneSimplex &simplex, Index idx_below) |
| |
| HalfSpace | compute (const std::vector< CoordinatePoint > &vpoints, const CombinatorialPlaneSimplex &simplex) |
| |
| CoordinateVector | normal (const HalfSpace &H) const |
| |
| CoordinateScalar | intercept (const HalfSpace &H) const |
| |
| InternalScalar | dot (const HalfSpace &H1, const HalfSpace &H2) const |
| |
| bool | equal (const HalfSpace &H1, const HalfSpace &H2) const |
| |
| InternalScalar | height (const HalfSpace &H, const CoordinatePoint &p) const |
| |
| InternalScalar | volume (const HalfSpace &H, const CoordinatePoint &p) const |
| |
| bool | above (const HalfSpace &H, const CoordinatePoint &p) const |
| |
| bool | aboveOrOn (const HalfSpace &H, const CoordinatePoint &p) const |
| |
| bool | on (const HalfSpace &H, const CoordinatePoint &p) const |
| |
| | BOOST_CONCEPT_ASSERT ((concepts::CInteger< TCoordinateInteger >)) |
| |
| | BOOST_CONCEPT_ASSERT ((concepts::CInteger< TInternalInteger >)) |
| |
| | ConvexHullCommonKernel ()=default |
| | Default constructor.
|
| |
| HalfSpace | compute (const std::vector< CoordinatePoint > &vpoints, const CombinatorialPlaneSimplex &simplex, Index idx_below) |
| |
| HalfSpace | compute (const std::vector< CoordinatePoint > &vpoints, const CombinatorialPlaneSimplex &simplex) |
| |
| CoordinateVector | normal (const HalfSpace &H) const |
| |
| CoordinateScalar | intercept (const HalfSpace &H) const |
| |
| InternalScalar | dot (const HalfSpace &H1, const HalfSpace &H2) const |
| |
| bool | equal (const HalfSpace &H1, const HalfSpace &H2) const |
| |
| InternalScalar | height (const HalfSpace &H, const CoordinatePoint &p) const |
| |
| InternalScalar | volume (const HalfSpace &H, const CoordinatePoint &p) const |
| |
| bool | above (const HalfSpace &H, const CoordinatePoint &p) const |
| |
| bool | aboveOrOn (const HalfSpace &H, const CoordinatePoint &p) const |
| |
| bool | on (const HalfSpace &H, const CoordinatePoint &p) const |
| |
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
struct DGtal::ConvexHullIntegralKernel< dim, TCoordinateInteger, TInternalInteger >
Aim: a geometric kernel to compute the convex hull of digital points with integer-only arithmetic.
Description of template class 'ConvexHullIntegralKernel'
- See also
- QuickHull algorithm in arbitrary dimension for convex hull and Delaunay cell complex computation
- Template Parameters
-
| 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. |
- Examples
- geometry/tools/checkLatticeBallQuickHull.cpp, geometry/tools/exampleLatticeBallQuickHull3D.cpp, and geometry/tools/exampleRationalBallQuickHull3D.cpp.
Definition at line 371 of file QuickHullKernels.h.
◆ Base
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ CombinatorialPlaneSimplex
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ CoordinatePoint
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ CoordinateScalar
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ CoordinateVector
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ Index
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ IndexRange
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ InternalPoint
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ InternalScalar
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ InternalVector
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ LowerSelf
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ Self
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ Size
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ ConvexHullIntegralKernel()
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ above()
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
- Parameters
-
| H | the half-space |
| p | any point |
- Returns
- 'true' iff p is strictly above this plane (so in direction N ).
Definition at line 329 of file QuickHullKernels.h.
InternalScalar height(const HalfSpace &H, const CoordinatePoint &p) const
◆ aboveOrOn()
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
- Parameters
-
| H | the half-space |
| p | any point |
- Returns
- 'true' iff p is above or lies on this plane (so in direction N ).
Definition at line 335 of file QuickHullKernels.h.
336 {
return height(
H, p ) >= 0; }
◆ compute() [1/2]
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
Computes an halfspace from dimension points specified by simplex with vertices in a range vpoints of Point. Orientation is induced by the order of the points. If the simplex is degenerated, the half-space is invalid and has null normal.
- Parameters
-
| [in] | vpoints | a range of points over which the simplex is defined. |
| [in] | simplex | a range of dimension indices of points defining an hyperplane. |
- Returns
- the corresponding halfspace (has null normal vector if simplex was not full dimensional)
Definition at line 261 of file QuickHullKernels.h.
263 {
264
268 return HalfSpace { N, N.dot( ip ) };
269 }
static void getOrthogonalVector(TPoint &w, const std::vector< TInputPoint > &X, const TIndexRange &I, const double tolerance=1e-12)
DGtal::PointVector< dim, InternalInteger > InternalVector
DGtal::PointVector< dim, InternalInteger > InternalPoint
static Integer cast(Integer i)
◆ compute() [2/2]
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
Computes an halfspace from dimension points specified by simplex with vertices in a range vpoints of Point. It is oriented such that the point of index idx_below is included in the half-space (i.e. below).
- Parameters
-
| [in] | vpoints | a range of points over which the simplex is defined. |
| [in] | simplex | a range of dimension indices of points defining an hyperplane. |
| [in] | idx_below | the index of a p-oint that is below the hyperplane. |
- Returns
- the corresponding halfspace (has null normal vector if simplex was not full dimensional)
Definition at line 234 of file QuickHullKernels.h.
237 {
238 HalfSpace hs =
compute( vpoints, simplex );
240 {
243
244 if ( nu > hs.c ) { hs.N = -hs.N; hs.c = -hs.c; }
245 }
246 return hs;
247 }
static Self zero
Static const for zero PointVector.
InternalInteger InternalScalar
HalfSpace compute(const std::vector< CoordinatePoint > &vpoints, const CombinatorialPlaneSimplex &simplex, Index idx_below)
◆ convertPointTo()
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
template<typename OutputPoint >
◆ dot()
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
Equivalent of the dot product of the normals of the half-spaces.
- Parameters
-
| H1 | an half-space |
| H2 | an half-space |
- Returns
- a positive scalar if both half-spaces points to to the same hemisphere, a negative scalar if they point to opposite hemispheres, and zero if they are orthogonal.
Definition at line 293 of file QuickHullKernels.h.
294 {
295 return H1.N.dot( H2.N );
296 }
◆ equal()
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
- Parameters
-
| H1 | an half-space |
| H2 | an half-space |
- Returns
- 'true' if the half-spaces have the smae members.
- Note
- two half-spaces may be not equal but may represent the same set of points. For instance
H1={{1,0},3} and H1={{2,0},6}.
Definition at line 306 of file QuickHullKernels.h.
307 {
308 return H1.c == H2.c && H1.N == H2.N;
309 }
◆ hasInfiniteFacets()
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
- Returns
- 'true' if a kernel may induce infinite facets. This is typically the case of a Delaunay computation kernel, which casts points in higher dimension.
Definition at line 409 of file QuickHullKernels.h.
◆ height()
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
- Parameters
-
| H | the half-space |
| p | any point |
- Returns
- the (signed) height of p wrt this plane.
Definition at line 314 of file QuickHullKernels.h.
◆ intercept()
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ isHalfSpaceFacetInfinite()
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
- Parameters
-
| [in] | hs | an half-space corresponding to a facet. |
- Returns
- 'true' if the facet associated to this half-space corresponds to an infinite facet.
Definition at line 416 of file QuickHullKernels.h.
417 {
418 (void) hs;
419 return false;
420 }
◆ makeInput()
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
template<typename InputPoint >
Transforms a range input_points of input points to a range processed_points of points adapted to a processing by QuickHull convex hull algorithm. Keep the mapping information between input and processed points.
- Template Parameters
-
| InputPoint | any model of point whose components are convertible to Scalar. |
- Parameters
-
| [out] | processed_points | the range of points prepared for a process by QuickHull. |
| [out] | input2comp | the surjective mapping between the input_points range and the processed_points range used for computation. |
| [out] | comp2input | the injective mapping between the processed_points range used for computation and the input_points range. |
| [in] | input_points | the range of input points. |
| [in] | remove_duplicates | when 'true', this method removes possible duplicates in input_points and processed_points may thus be of smaller size, otherwise, when 'false', it means that there are no duplicates in input_points. |
Definition at line 448 of file QuickHullKernels.h.
452 {
454 {
458 return p;
459 };
461 input_points.cbegin(), input_points.cend(),
462 F, remove_duplicates );
463 }
void transform(std::vector< OutputValue > &output_values, std::vector< std::size_t > &input2output, std::vector< std::size_t > &output2input, ForwardIterator itb, ForwardIterator ite, const ConversionFct &F, bool remove_duplicates)
CoordinateInteger CoordinateScalar
DGtal::PointVector< dim, CoordinateInteger > CoordinatePoint
References DGtal::ConvexHullIntegralKernel< dim, TCoordinateInteger, TInternalInteger >::dimension, and DGtal::detail::transform().
◆ normal()
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
◆ on()
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
- Parameters
-
| H | the half-space |
| p | any point |
- Returns
- 'true' iff p lies on this plane.
Definition at line 341 of file QuickHullKernels.h.
342 {
return height(
H, p ) == 0; }
◆ volume()
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
- Parameters
-
| H | the half-space |
| p | any point |
- Returns
- the volume of the vectors spanned by the simplex and this point.
Definition at line 320 of file QuickHullKernels.h.
◆ dimension
template<
Dimension dim, typename TCoordinateInteger = DGtal::int64_t, typename TInternalInteger = DGtal::int64_t>
The documentation for this struct was generated from the following file: