DGtal  1.2.0
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 
55 namespace DGtal
56 {
58  // template class ConvexityHelper
79  template < int dim,
80  typename TInteger = DGtal::int32_t,
81  typename TInternalInteger = DGtal::int64_t >
82  struct ConvexityHelper {
84  // Integer must be a model of the concept CInteger.
86  // Integer must be a model of the concept CInteger.
88 
89  static const Dimension dimension = dim;
90 
91  typedef TInteger Integer;
92  typedef TInternalInteger InternalInteger;
94  typedef typename Space::Point Point;
95  typedef typename Space::Vector Vector;
96  typedef typename Space::RealPoint RealPoint;
97  typedef typename Space::RealVector RealVector;
98  typedef std::size_t Size;
99  typedef std::size_t Index;
100  typedef std::vector< Index > IndexRange;
111 
112  // ----------------- lattice convex hull services -------------------------
113  public:
116 
134  static
136  computeLatticePolytope( const std::vector< Point >& input_points,
137  bool remove_duplicates = true,
138  bool make_minkowski_summable = false );
139 
140 
141 
163  template < typename TSurfaceMesh >
164  static
165  bool
166  computeConvexHullBoundary( TSurfaceMesh& mesh,
167  const std::vector< Point >& input_points,
168  bool remove_duplicates = true );
169 
187  static
188  bool
190  const std::vector< Point >& input_points,
191  bool remove_duplicates = true );
192 
208  static
209  bool
211  const std::vector< Point >& input_points,
212  bool remove_duplicates = true );
213 
215 
216  // ----------------- lattice Delaunay services -------------------------
217  public:
220 
237  static
238  bool
240  const std::vector< Point >& input_points,
241  bool remove_duplicates = true );
242 
244 
245  // ----------------- rational convex hull services -------------------------
246  public:
249 
271  static
273  computeRationalPolytope( const std::vector< RealPoint >& input_points,
274  Integer denominator,
275  bool remove_duplicates = true,
276  bool make_minkowski_summable = false );
277 
304  template < typename TSurfaceMesh >
305  static
306  bool
307  computeConvexHullBoundary( TSurfaceMesh& mesh,
308  const std::vector< RealPoint >& input_points,
309  double precision = 1024.0,
310  bool remove_duplicates = true );
311 
332  static
333  bool
335  const std::vector< RealPoint >& input_points,
336  double precision = 1024.0,
337  bool remove_duplicates = true );
338 
359  static
360  bool
362  const std::vector< RealPoint >& input_points,
363  double precision = 1024.0,
364  bool remove_duplicates = true );
365 
367 
368 
369  // ----------------- real Delaunay services -------------------------
370  public:
373 
395  static
396  bool
398  const std::vector< RealPoint >& input_points,
399  double precision = 1024.0,
400  bool remove_duplicates = true );
401 
403 
404  // ----------------- utility services -------------------------
405  public:
408 
424  template < typename QHull >
425  static
426  void
427  computeFacetAndRidgeVertices( const QHull& hull,
428  std::vector< IndexRange >& cell_vertices,
429  std::map< typename QHull::Ridge, Index >& r2f,
430  std::vector< IndexRange >& face_vertices );
431 
433 
434  }; // class ConvexityHelper
435 
436 
437 } // namespace DGtal
438 
440 // Includes inline functions.
441 #include "ConvexityHelper.ih"
442 
443 // //
445 
446 #endif // !defined ConvexityHelper_h
447 
448 #undef ConvexityHelper_RECURSES
449 #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:137
boost::int32_t int32_t
signed 32-bit integer.
Definition: BasicTypes.h:72
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 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 bool computeConvexHullBoundary(PolygonalSurface< Point > &polysurf, const std::vector< Point > &input_points, bool remove_duplicates=true)
static bool computeConvexHullBoundary(TSurfaceMesh &mesh, const std::vector< Point > &input_points, bool remove_duplicates=true)
DelaunayIntegralKernel< dim, Integer, InternalInteger > LatticeDelaunayKernel
static bool computeConvexHullCellComplex(ConvexCellComplex< Point > &cell_complex, const std::vector< Point > &input_points, bool remove_duplicates=true)
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
Space::RealPoint RealPoint
Space::RealVector RealVector
static const Dimension dimension
static bool computeDelaunayCellComplex(ConvexCellComplex< Point > &cell_complex, const std::vector< Point > &input_points, bool remove_duplicates=true)
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 LatticePolytope computeLatticePolytope(const std::vector< Point > &input_points, bool remove_duplicates=true, bool make_minkowski_summable=false)
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 >))
BoundedLatticePolytope< Space > LatticePolytope
DelaunayRationalKernel< dim, Integer, InternalInteger > RealDelaunayKernel
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
unsigned int dim(const Vector &z)