DGtal 1.4.2
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 < >
81#ifdef WITH_BIGINTEGER
83#else
84 typedef DGtal::int64_t Type;
85#endif
86 };
87
93 template < >
97
103 template < >
105#ifdef WITH_BIGINTEGER
107#else
108 typedef DGtal::int64_t Type;
109#endif
110 };
111
117 template < >
121
122#ifdef WITH_BIGINTEGER
131 template < bool safe >
135#endif
136
137 } // namespace detail
138
140 // template class ConvexityHelper
161 template < int dim,
162 typename TInteger = DGtal::int32_t,
163 typename TInternalInteger = DGtal::int64_t >
166 // Integer must be a model of the concept CInteger.
168 // Integer must be a model of the concept CInteger.
170
171 static const Dimension dimension = dim;
172
173 typedef TInteger Integer;
174 typedef TInternalInteger InternalInteger;
176 typedef typename Space::Point Point;
177 typedef typename Space::Vector Vector;
178 typedef typename Space::RealPoint RealPoint;
180 typedef std::size_t Size;
181 typedef std::size_t Index;
182 typedef std::vector< Index > IndexRange;
183 typedef std::vector< Point > PointRange;
194
195 // ----------------- lattice convex hull services -------------------------
196 public:
199
217 static
219 computeLatticePolytope( const PointRange& input_points,
220 bool remove_duplicates = true,
221 bool make_minkowski_summable = false );
222
235 static
238 bool remove_duplicates = true );
239
240
262 template < typename TSurfaceMesh >
263 static
264 bool
265 computeConvexHullBoundary( TSurfaceMesh& mesh,
266 const PointRange& input_points,
267 bool remove_duplicates = true );
268
286 static
287 bool
289 const PointRange& input_points,
290 bool remove_duplicates = true );
291
307 static
308 bool
310 const PointRange& input_points,
311 bool remove_duplicates = true );
312
333 static
335 computeSimplex( const PointRange& input_points,
336 bool remove_duplicates = true );
337
357 static
360
379 static
382
400 static
402 compute3DTriangle( const Point& a, const Point& b, const Point& c,
403 bool make_minkowski_summable = false );
404
423 static
425 compute3DOpenTriangle( const Point& a, const Point& b, const Point& c,
426 bool make_minkowski_summable = false );
427
437 static
439 computeDegeneratedTriangle( const Point& a, const Point& b, const Point& c );
440
441
452 static
454 computeSegment( const Point& a, const Point& b );
455
466 static
468 computeOpenSegment( const Point& a, const Point& b );
469
471
472 // ----------------- lattice Delaunay services -------------------------
473 public:
476
493 static
494 bool
496 const PointRange& input_points,
497 bool remove_duplicates = true );
498
500
501 // ----------------- rational convex hull services -------------------------
502 public:
505
527 static
529 computeRationalPolytope( const std::vector< RealPoint >& input_points,
530 Integer denominator,
531 bool remove_duplicates = true,
532 bool make_minkowski_summable = false );
533
560 template < typename TSurfaceMesh >
561 static
562 bool
563 computeConvexHullBoundary( TSurfaceMesh& mesh,
564 const std::vector< RealPoint >& input_points,
565 double precision = 1024.0,
566 bool remove_duplicates = true );
567
588 static
589 bool
591 const std::vector< RealPoint >& input_points,
592 double precision = 1024.0,
593 bool remove_duplicates = true );
594
615 static
616 bool
618 const std::vector< RealPoint >& input_points,
619 double precision = 1024.0,
620 bool remove_duplicates = true );
621
623
624
625 // ----------------- real Delaunay services -------------------------
626 public:
629
651 static
652 bool
654 const std::vector< RealPoint >& input_points,
655 double precision = 1024.0,
656 bool remove_duplicates = true );
657
659
660 // ----------------- utility services -------------------------
661 public:
664
680 template < typename QHull >
681 static
682 void
684 std::vector< IndexRange >& cell_vertices,
685 std::map< typename QHull::Ridge, Index >& r2f,
686 std::vector< IndexRange >& face_vertices );
687
689
690 }; // class ConvexityHelper
691
692
693} // namespace DGtal
694
696// Includes inline functions.
697#include "ConvexityHelper.ih"
698
699// //
701
702#endif // !defined ConvexityHelper_h
703
704#undef ConvexityHelper_RECURSES
705#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.
boost::int64_t int64_t
signed 94-bit integer.
Definition BasicTypes.h:74
DGtal::uint32_t Dimension
Definition Common.h:136
boost::int32_t int32_t
signed 32-bit integer.
Definition BasicTypes.h:72
mpz_class BigInteger
Multi-precision integer with GMP implementation.
Definition BasicTypes.h:79
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