DGtal 2.1.0
Loading...
Searching...
No Matches
ConvexityHelper.h
1
17#pragma once
18
31#if defined(ConvexityHelper_RECURSES)
32#error Recursive header files inclusion detected in ConvexityHelper.h
33#else // defined(ConvexityHelper_RECURSES)
35#define ConvexityHelper_RECURSES
36
37#if !defined ConvexityHelper_h
39#define ConvexityHelper_h
40
42// Inclusions
43#include <iostream>
44#include <string>
45#include <vector>
46#include "DGtal/base/Common.h"
47#include "DGtal/kernel/CInteger.h"
48#include "DGtal/kernel/SpaceND.h"
49#include "DGtal/geometry/tools/QuickHull.h"
50#include "DGtal/geometry/volumes/BoundedLatticePolytope.h"
51#include "DGtal/geometry/volumes/BoundedRationalPolytope.h"
52#include "DGtal/geometry/volumes/ConvexCellComplex.h"
53#include "DGtal/shapes/PolygonalSurface.h"
54
55namespace DGtal
56{
57
58 namespace detail {
59
69 template < typename TIntegerCoordinate, bool safe >
71 typedef TIntegerCoordinate Type;
72 };
73
79 template < >
83
89 template < >
93
99 template < >
103
109 template < >
113
122 template < bool safe >
126
127 } // namespace detail
128
130 // template class ConvexityHelper
151 template < int dim,
152 typename TInteger = DGtal::int32_t,
153 typename TInternalInteger = DGtal::int64_t >
156 // Integer must be a model of the concept CInteger.
158 // Integer must be a model of the concept CInteger.
160
161 static const Dimension dimension = dim;
162
163 typedef TInteger Integer;
164 typedef TInternalInteger InternalInteger;
166 typedef typename Space::Point Point;
167 typedef typename Space::Vector Vector;
168 typedef typename Space::RealPoint RealPoint;
170 typedef std::size_t Size;
171 typedef std::size_t Index;
172 typedef std::vector< Index > IndexRange;
173 typedef std::vector< Point > PointRange;
184
185 // ----------------- lattice convex hull services -------------------------
186 public:
189
207 static
209 computeLatticePolytope( const PointRange& input_points,
210 bool remove_duplicates = true,
211 bool make_minkowski_summable = false );
212
225 static
228 bool remove_duplicates = true );
229
230
252 template < typename TSurfaceMesh >
253 static
254 bool
255 computeConvexHullBoundary( TSurfaceMesh& mesh,
256 const PointRange& input_points,
257 bool remove_duplicates = true );
258
276 static
277 bool
279 const PointRange& input_points,
280 bool remove_duplicates = true );
281
297 static
298 bool
300 const PointRange& input_points,
301 bool remove_duplicates = true );
302
323 static
325 computeSimplex( const PointRange& input_points,
326 bool remove_duplicates = true );
327
347 static
350
369 static
372
390 static
392 compute3DTriangle( const Point& a, const Point& b, const Point& c,
393 bool make_minkowski_summable = false );
394
413 static
415 compute3DOpenTriangle( const Point& a, const Point& b, const Point& c,
416 bool make_minkowski_summable = false );
417
427 static
429 computeDegeneratedTriangle( const Point& a, const Point& b, const Point& c );
430
431
442 static
444 computeSegment( const Point& a, const Point& b );
445
456 static
458 computeOpenSegment( const Point& a, const Point& b );
459
461
462 // ----------------- lattice Delaunay services -------------------------
463 public:
466
483 static
484 bool
486 const PointRange& input_points,
487 bool remove_duplicates = true );
488
490
491 // ----------------- rational convex hull services -------------------------
492 public:
495
517 static
519 computeRationalPolytope( const std::vector< RealPoint >& input_points,
520 Integer denominator,
521 bool remove_duplicates = true,
522 bool make_minkowski_summable = false );
523
550 template < typename TSurfaceMesh >
551 static
552 bool
553 computeConvexHullBoundary( TSurfaceMesh& mesh,
554 const std::vector< RealPoint >& input_points,
555 double precision = 1024.0,
556 bool remove_duplicates = true );
557
578 static
579 bool
581 const std::vector< RealPoint >& input_points,
582 double precision = 1024.0,
583 bool remove_duplicates = true );
584
605 static
606 bool
608 const std::vector< RealPoint >& input_points,
609 double precision = 1024.0,
610 bool remove_duplicates = true );
611
613
614
615 // ----------------- real Delaunay services -------------------------
616 public:
619
641 static
642 bool
644 const std::vector< RealPoint >& input_points,
645 double precision = 1024.0,
646 bool remove_duplicates = true );
647
649
650 // ----------------- utility services -------------------------
651 public:
654
670 template < typename QHull >
671 static
672 void
674 std::vector< IndexRange >& cell_vertices,
675 std::map< typename QHull::Ridge, Index >& r2f,
676 std::vector< IndexRange >& face_vertices );
677
679
680 }; // class ConvexityHelper
681
682
683} // namespace DGtal
684
686// Includes inline functions.
687#include "ConvexityHelper.ih"
688
689// //
691
692#endif // !defined ConvexityHelper_h
693
694#undef ConvexityHelper_RECURSES
695#endif // else defined(ConvexityHelper_RECURSES)
Aim: Represents an nD lattice polytope, i.e. a convex polyhedron bounded with vertices with integer c...
Aim: Represents an nD rational polytope, i.e. a convex polyhedron bounded by vertices with rational c...
Aim: Represents a polygon mesh, i.e. a 2-dimensional combinatorial surface whose faces are (topologic...
DGtal is the top-level namespace which contains all DGtal functions and types.
std::int32_t int32_t
signed 32-bit integer.
Definition BasicTypes.h:71
std::int64_t int64_t
signed 94-bit integer.
Definition BasicTypes.h:73
DGtal::uint32_t Dimension
Definition Common.h:119
boost::multiprecision::number< boost::multiprecision::cpp_int_backend<>, boost::multiprecision::et_off > BigInteger
Definition BasicTypes.h:75
Aim: represents a d-dimensional complex in a d-dimensional space with the following properties and re...
Aim: a geometric kernel to compute the convex hull of digital points with integer-only arithmetic.
Aim: a geometric kernel to compute the convex hull of floating points with integer-only arithmetic....
Aim: Provides a set of functions to facilitate the computation of convex hulls and polytopes,...
static PointRange computeConvexHullVertices(const PointRange &input_points, bool remove_duplicates=true)
static bool computeDelaunayCellComplex(ConvexCellComplex< Point > &cell_complex, const PointRange &input_points, bool remove_duplicates=true)
static void computeFacetAndRidgeVertices(const QHull &hull, std::vector< IndexRange > &cell_vertices, std::map< typename QHull::Ridge, Index > &r2f, std::vector< IndexRange > &face_vertices)
TInternalInteger InternalInteger
static bool computeDelaunayCellComplex(ConvexCellComplex< RealPoint > &cell_complex, 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 LatticePolytope computeSimplex(const PointRange &input_points, bool remove_duplicates=true)
DelaunayIntegralKernel< dim, Integer, InternalInteger > LatticeDelaunayKernel
static PointRange computeDegeneratedConvexHullVertices(PointRange &input_points)
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
Space::RealPoint RealPoint
Space::RealVector RealVector
static const Dimension dimension
static LatticePolytope computeSegment(const Point &a, const Point &b)
static LatticePolytope computeDegeneratedTriangle(const Point &a, const Point &b, const Point &c)
BoundedRationalPolytope< Space > RationalPolytope
ConvexHullRationalKernel< dim, Integer, InternalInteger > RealConvexHullKernel
static RationalPolytope computeRationalPolytope(const std::vector< RealPoint > &input_points, Integer denominator, bool remove_duplicates=true, bool make_minkowski_summable=false)
static bool computeConvexHullCellComplex(ConvexCellComplex< Point > &cell_complex, const PointRange &input_points, bool remove_duplicates=true)
static LatticePolytope computeDegeneratedLatticePolytope(PointRange &input_points)
static LatticePolytope compute3DOpenTriangle(const Point &a, const Point &b, const Point &c, bool make_minkowski_summable=false)
static bool computeConvexHullBoundary(PolygonalSurface< Point > &polysurf, const PointRange &input_points, bool remove_duplicates=true)
static LatticePolytope computeOpenSegment(const Point &a, const Point &b)
static bool computeConvexHullBoundary(TSurfaceMesh &mesh, const std::vector< RealPoint > &input_points, double precision=1024.0, bool remove_duplicates=true)
ConvexHullIntegralKernel< dim, Integer, InternalInteger > LatticeConvexHullKernel
std::vector< Index > IndexRange
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInternalInteger >))
static LatticePolytope compute3DTriangle(const Point &a, const Point &b, const Point &c, bool make_minkowski_summable=false)
static bool computeConvexHullBoundary(TSurfaceMesh &mesh, const PointRange &input_points, bool remove_duplicates=true)
BoundedLatticePolytope< Space > LatticePolytope
DelaunayRationalKernel< dim, Integer, InternalInteger > RealDelaunayKernel
static LatticePolytope computeLatticePolytope(const PointRange &input_points, bool remove_duplicates=true, bool make_minkowski_summable=false)
std::vector< Point > PointRange
static bool computeConvexHullCellComplex(ConvexCellComplex< RealPoint > &cell_complex, const std::vector< RealPoint > &input_points, double precision=1024.0, bool remove_duplicates=true)
SpaceND< dim, Integer > Space
Aim: a geometric kernel to compute the Delaunay triangulation of digital points with integer-only ari...
Aim: a geometric kernel to compute the Delaunay triangulation of a range of floating points with inte...
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Definition CInteger.h:88