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
190 // todo
191 // static
192 // std::tuple< IndexRange, std::vector< IndexRange >, PointRange, Dimension >
193
211 static
213 computeLatticePolytope( const PointRange& input_points,
214 bool remove_duplicates = true,
215 bool make_minkowski_summable = false );
216
229 static
232 bool remove_duplicates = true );
233
234
256 template < typename TSurfaceMesh >
257 static
258 bool
259 computeConvexHullBoundary( TSurfaceMesh& mesh,
260 const PointRange& input_points,
261 bool remove_duplicates = true );
262
280 static
281 bool
283 const PointRange& input_points,
284 bool remove_duplicates = true );
285
301 static
302 bool
304 const PointRange& input_points,
305 bool remove_duplicates = true );
306
327 static
329 computeSimplex( const PointRange& input_points,
330 bool remove_duplicates = true );
331
351 static
354
373 static
376
394 static
396 compute3DTriangle( const Point& a, const Point& b, const Point& c,
397 bool make_minkowski_summable = false );
398
417 static
419 compute3DOpenTriangle( const Point& a, const Point& b, const Point& c,
420 bool make_minkowski_summable = false );
421
431 static
433 computeDegeneratedTriangle( const Point& a, const Point& b, const Point& c );
434
435
446 static
448 computeSegment( const Point& a, const Point& b );
449
460 static
462 computeOpenSegment( const Point& a, const Point& b );
463
465
466 // ----------------- lattice Delaunay services -------------------------
467 public:
470
487 static
488 bool
490 const PointRange& input_points,
491 bool remove_duplicates = true );
492
494
495 // ----------------- rational convex hull services -------------------------
496 public:
499
521 static
523 computeRationalPolytope( const std::vector< RealPoint >& input_points,
524 Integer denominator,
525 bool remove_duplicates = true,
526 bool make_minkowski_summable = false );
527
554 template < typename TSurfaceMesh >
555 static
556 bool
557 computeConvexHullBoundary( TSurfaceMesh& mesh,
558 const std::vector< RealPoint >& input_points,
559 double precision = 1024.0,
560 bool remove_duplicates = true );
561
582 static
583 bool
585 const std::vector< RealPoint >& input_points,
586 double precision = 1024.0,
587 bool remove_duplicates = true );
588
609 static
610 bool
612 const std::vector< RealPoint >& input_points,
613 double precision = 1024.0,
614 bool remove_duplicates = true );
615
617
618
619 // ----------------- real Delaunay services -------------------------
620 public:
623
645 static
646 bool
648 const std::vector< RealPoint >& input_points,
649 double precision = 1024.0,
650 bool remove_duplicates = true );
651
653
654 // ----------------- utility services -------------------------
655 public:
658
674 template < typename QHull >
675 static
676 void
678 std::vector< IndexRange >& cell_vertices,
679 std::map< typename QHull::Ridge, Index >& r2f,
680 std::vector< IndexRange >& face_vertices );
681
683
684 }; // class ConvexityHelper
685
686
687} // namespace DGtal
688
690// Includes inline functions.
691#include "ConvexityHelper.ih"
692
693// //
695
696#endif // !defined ConvexityHelper_h
697
698#undef ConvexityHelper_RECURSES
699#endif // else defined(ConvexityHelper_RECURSES)
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