DGtal  1.1.0
SurfaceMeshHelper.h
1 
17 #pragma once
18 
31 #if defined(SurfaceMeshHelper_RECURSES)
32 #error Recursive header files inclusion detected in SurfaceMeshHelper.h
33 #else // defined(SurfaceMeshHelper_RECURSES)
34 
35 #define SurfaceMeshHelper_RECURSES
36 
37 #if !defined SurfaceMeshHelper_h
38 
39 #define SurfaceMeshHelper_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <sstream>
45 #include <string>
46 #include "DGtal/base/Common.h"
47 #include "DGtal/helpers/StdDefs.h"
48 #include "DGtal/shapes/SurfaceMesh.h"
49 
50 namespace DGtal
51 {
52 
54  // template class SurfaceMeshHelper
62  template < typename TRealPoint, typename TRealVector >
64  {
65  typedef TRealPoint RealPoint;
66  typedef TRealVector RealVector;
70 
72  typedef typename RealVector::Component Scalar;
73  typedef std::vector<Scalar> Scalars;
74  typedef std::vector<RealVector> RealVectors;
75  typedef typename SurfaceMesh::Size Size;
76  typedef typename SurfaceMesh::Index Index;
77  typedef typename SurfaceMesh::Vertices Vertices;
78  typedef typename SurfaceMesh::Faces Faces;
79 
84 
85  //---------------------------------------------------------------------------
86  public:
89 
104  static
106  makeSphere( const Scalar radius, const RealPoint &center,
107  Size m, Size n, NormalsType normals );
108 
118  static
119  Scalars
120  sphereMeanCurvatures( const Scalar radius, Size m, Size n );
121 
131  static
132  Scalars
133  sphereGaussianCurvatures( const Scalar radius, Size m, Size n );
134 
144  static
145  Scalars
147 
157  static
158  Scalars
160 
171  static
174 
185  static
188 
190 
191  //---------------------------------------------------------------------------
192  public:
195 
210  static
212  makeLantern( const Scalar radius, const Scalar height, const RealPoint& center,
213  Size m, Size n, const NormalsType normals );
214 
224  static
225  Scalars
226  lanternMeanCurvatures( const Scalar radius, Size m, Size n );
227 
237  static
238  Scalars
239  lanternGaussianCurvatures( const Scalar radius, Size m, Size n );
240 
250  static
251  Scalars
253 
263  static
264  Scalars
266 
276  static
279 
289  static
292 
294 
295  //---------------------------------------------------------------------------
296  public:
299 
318  static
320  makeTorus( const Scalar big_radius, const Scalar small_radius, const RealPoint& center,
321  Size m, Size n, const int twist, const NormalsType normals );
322 
337  static
338  Scalars
339  torusMeanCurvatures( const Scalar big_radius, const Scalar small_radius,
340  Size m, Size n, const int twist );
341 
356  static
357  Scalars
358  torusGaussianCurvatures( const Scalar big_radius, const Scalar small_radius,
359  Size m, Size n, const int twist );
360 
375  static
376  Scalars
377  torusFirstPrincipalCurvatures( const Scalar big_radius, const Scalar small_radius,
378  Size m, Size n, const int twist );
379 
394  static
395  Scalars
396  torusSecondPrincipalCurvatures( const Scalar big_radius, const Scalar small_radius,
397  Size m, Size n, const int twist );
398 
413  static
415  torusFirstPrincipalDirections( const Scalar big_radius, const Scalar small_radius,
416  Size m, Size n, const int twist );
417 
433  static
435  torusSecondPrincipalDirections( const Scalar big_radius, const Scalar small_radius,
436  Size m, Size n, const int twist );
437 
439 
440  };
441 
442 } // namespace DGtal
443 
445 // Includes inline functions.
446 #include "SurfaceMeshHelper.ih"
447 // //
449 
450 #endif // !defined SurfaceMeshHelper_h
451 
452 #undef SurfaceMeshHelper_RECURSES
453 #endif // else defined(SurfaceMeshHelper_RECURSES)
DGtal::SurfaceMeshHelper::lanternSecondPrincipalDirections
static RealVectors lanternSecondPrincipalDirections(const Scalar radius, Size m, Size n)
DGtal::SurfaceMeshHelper::Vertices
SurfaceMesh::Vertices Vertices
Definition: SurfaceMeshHelper.h:77
DGtal::SurfaceMeshHelper
Aim: An helper class for building classical meshes.
Definition: SurfaceMeshHelper.h:64
DGtal::SurfaceMeshHelper::lanternMeanCurvatures
static Scalars lanternMeanCurvatures(const Scalar radius, Size m, Size n)
DGtal::Dimension
DGtal::uint32_t Dimension
Definition: Common.h:133
DGtal::SurfaceMesh
Aim: Represents an embedded mesh as faces and a list of vertices. Vertices may be shared among faces ...
Definition: SurfaceMesh.h:92
DGtal::SurfaceMeshHelper::NormalsType::VERTEX_NORMALS
@ VERTEX_NORMALS
DGtal::SurfaceMeshHelper::sphereGaussianCurvatures
static Scalars sphereGaussianCurvatures(const Scalar radius, Size m, Size n)
DGtal::SurfaceMeshHelper::sphereFirstPrincipalDirections
static RealVectors sphereFirstPrincipalDirections(const Scalar radius, Size m, Size n)
DGtal::SurfaceMeshHelper::sphereMeanCurvatures
static Scalars sphereMeanCurvatures(const Scalar radius, Size m, Size n)
DGtal::SurfaceMeshHelper::makeLantern
static SurfaceMesh makeLantern(const Scalar radius, const Scalar height, const RealPoint &center, Size m, Size n, const NormalsType normals)
DGtal::SurfaceMeshHelper::torusGaussianCurvatures
static Scalars torusGaussianCurvatures(const Scalar big_radius, const Scalar small_radius, Size m, Size n, const int twist)
DGtal::SurfaceMeshHelper::Size
SurfaceMesh::Size Size
Definition: SurfaceMeshHelper.h:75
DGtal::SurfaceMeshHelper::sphereFirstPrincipalCurvatures
static Scalars sphereFirstPrincipalCurvatures(const Scalar radius, Size m, Size n)
DGtal::SurfaceMeshHelper::makeSphere
static SurfaceMesh makeSphere(const Scalar radius, const RealPoint &center, Size m, Size n, NormalsType normals)
DGtal::PointVector::Component
TEuclideanRing Component
Type for Vector elements.
Definition: PointVector.h:614
DGtal::SurfaceMesh::Faces
std::vector< Face > Faces
Definition: SurfaceMesh.h:116
DGtal::SurfaceMesh::Vertices
std::vector< Vertex > Vertices
The type that defines a list/range of vertices (e.g. to define faces)
Definition: SurfaceMesh.h:112
DGtal::SurfaceMeshHelper::SurfaceMesh
DGtal::SurfaceMesh< RealPoint, RealVector > SurfaceMesh
Definition: SurfaceMeshHelper.h:71
DGtal::SurfaceMeshHelper::torusFirstPrincipalDirections
static RealVectors torusFirstPrincipalDirections(const Scalar big_radius, const Scalar small_radius, Size m, Size n, const int twist)
DGtal::SurfaceMeshHelper::Self
SurfaceMeshHelper< RealPoint, RealVector > Self
Definition: SurfaceMeshHelper.h:67
DGtal::SurfaceMeshHelper::torusSecondPrincipalCurvatures
static Scalars torusSecondPrincipalCurvatures(const Scalar big_radius, const Scalar small_radius, Size m, Size n, const int twist)
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::SurfaceMeshHelper::torusSecondPrincipalDirections
static RealVectors torusSecondPrincipalDirections(const Scalar big_radius, const Scalar small_radius, Size m, Size n, const int twist)
DGtal::SurfaceMeshHelper::RealVectors
std::vector< RealVector > RealVectors
Definition: SurfaceMeshHelper.h:74
DGtal::SurfaceMeshHelper::sphereSecondPrincipalCurvatures
static Scalars sphereSecondPrincipalCurvatures(const Scalar radius, Size m, Size n)
DGtal::SurfaceMeshHelper::torusFirstPrincipalCurvatures
static Scalars torusFirstPrincipalCurvatures(const Scalar big_radius, const Scalar small_radius, Size m, Size n, const int twist)
DGtal::SurfaceMeshHelper::RealVector
TRealVector RealVector
Definition: SurfaceMeshHelper.h:66
DGtal::SurfaceMeshHelper::dimension
static const Dimension dimension
Definition: SurfaceMeshHelper.h:68
DGtal::SurfaceMeshHelper::sphereSecondPrincipalDirections
static RealVectors sphereSecondPrincipalDirections(const Scalar radius, Size m, Size n)
DGtal::PointVector::dimension
static const Dimension dimension
Copy of the static dimension of the Point/Vector.
Definition: PointVector.h:626
DGtal::SurfaceMeshHelper::NormalsType
NormalsType
Definition: SurfaceMeshHelper.h:83
DGtal::SurfaceMeshHelper::Faces
SurfaceMesh::Faces Faces
Definition: SurfaceMeshHelper.h:78
DGtal::SurfaceMeshHelper::lanternGaussianCurvatures
static Scalars lanternGaussianCurvatures(const Scalar radius, Size m, Size n)
DGtal::SurfaceMeshHelper::Index
SurfaceMesh::Index Index
Definition: SurfaceMeshHelper.h:76
DGtal::SurfaceMeshHelper::RealPoint
TRealPoint RealPoint
Definition: SurfaceMeshHelper.h:65
DGtal::SurfaceMesh::Size
std::size_t Size
The type for counting elements.
Definition: SurfaceMesh.h:103
DGtal::SurfaceMeshHelper::torusMeanCurvatures
static Scalars torusMeanCurvatures(const Scalar big_radius, const Scalar small_radius, Size m, Size n, const int twist)
DGtal::SurfaceMeshHelper::NormalsType::NO_NORMALS
@ NO_NORMALS
DGtal::SurfaceMeshHelper::Scalar
RealVector::Component Scalar
Definition: SurfaceMeshHelper.h:72
DGtal::SurfaceMeshHelper::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((dimension==3))
DGtal::SurfaceMeshHelper::lanternFirstPrincipalDirections
static RealVectors lanternFirstPrincipalDirections(const Scalar radius, Size m, Size n)
DGtal::SurfaceMeshHelper::NormalsType::FACE_NORMALS
@ FACE_NORMALS
DGtal::SurfaceMeshHelper::lanternSecondPrincipalCurvatures
static Scalars lanternSecondPrincipalCurvatures(const Scalar radius, Size m, Size n)
DGtal::SurfaceMeshHelper::lanternFirstPrincipalCurvatures
static Scalars lanternFirstPrincipalCurvatures(const Scalar radius, Size m, Size n)
DGtal::SurfaceMeshHelper::Scalars
std::vector< Scalar > Scalars
Definition: SurfaceMeshHelper.h:73
DGtal::SurfaceMeshHelper::makeTorus
static SurfaceMesh makeTorus(const Scalar big_radius, const Scalar small_radius, const RealPoint &center, Size m, Size n, const int twist, const NormalsType normals)
DGtal::SurfaceMesh::Index
std::size_t Index
The type used for numbering vertices and faces.
Definition: SurfaceMesh.h:105