DGtal  1.2.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)
35 #define SurfaceMeshHelper_RECURSES
36 
37 #if !defined SurfaceMeshHelper_h
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;
68  static const Dimension dimension = RealPoint::dimension;
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)
TEuclideanRing Component
Type for Vector elements.
Definition: PointVector.h:614
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::uint32_t Dimension
Definition: Common.h:137
Aim: An helper class for building classical meshes.
std::vector< Scalar > Scalars
static Scalars torusSecondPrincipalCurvatures(const Scalar big_radius, const Scalar small_radius, Size m, Size n, const int twist)
static Scalars sphereMeanCurvatures(const Scalar radius, Size m, Size n)
static Scalars sphereGaussianCurvatures(const Scalar radius, Size m, Size n)
static RealVectors sphereSecondPrincipalDirections(const Scalar radius, Size m, Size n)
DGtal::SurfaceMesh< RealPoint, RealVector > SurfaceMesh
SurfaceMesh::Index Index
static Scalars torusMeanCurvatures(const Scalar big_radius, const Scalar small_radius, Size m, Size n, const int twist)
SurfaceMesh::Vertices Vertices
SurfaceMeshHelper< RealPoint, RealVector > Self
static Scalars lanternMeanCurvatures(const Scalar radius, Size m, Size n)
BOOST_STATIC_ASSERT((dimension==3))
static Scalars lanternGaussianCurvatures(const Scalar radius, Size m, Size n)
static Scalars lanternFirstPrincipalCurvatures(const Scalar radius, Size m, Size n)
std::vector< RealVector > RealVectors
static RealVectors lanternFirstPrincipalDirections(const Scalar radius, Size m, Size n)
static Scalars sphereSecondPrincipalCurvatures(const Scalar radius, Size m, Size n)
static RealVectors sphereFirstPrincipalDirections(const Scalar radius, Size m, Size n)
static const Dimension dimension
RealVector::Component Scalar
static Scalars torusFirstPrincipalCurvatures(const Scalar big_radius, const Scalar small_radius, Size m, Size n, const int twist)
static RealVectors torusSecondPrincipalDirections(const Scalar big_radius, const Scalar small_radius, Size m, Size n, const int twist)
static Scalars sphereFirstPrincipalCurvatures(const Scalar radius, Size m, Size n)
static SurfaceMesh makeSphere(const Scalar radius, const RealPoint &center, Size m, Size n, NormalsType normals)
SurfaceMesh::Faces Faces
static SurfaceMesh makeTorus(const Scalar big_radius, const Scalar small_radius, const RealPoint &center, Size m, Size n, const int twist, const NormalsType normals)
static SurfaceMesh makeLantern(const Scalar radius, const Scalar height, const RealPoint &center, Size m, Size n, const NormalsType normals)
static RealVectors torusFirstPrincipalDirections(const Scalar big_radius, const Scalar small_radius, Size m, Size n, const int twist)
static Scalars lanternSecondPrincipalCurvatures(const Scalar radius, Size m, Size n)
static Scalars torusGaussianCurvatures(const Scalar big_radius, const Scalar small_radius, Size m, Size n, const int twist)
static RealVectors lanternSecondPrincipalDirections(const Scalar radius, Size m, Size n)
Aim: Represents an embedded mesh as faces and a list of vertices. Vertices may be shared among faces ...
Definition: SurfaceMesh.h:92
std::vector< Vertex > Vertices
The type that defines a list/range of vertices (e.g. to define faces)
Definition: SurfaceMesh.h:112
std::size_t Index
The type used for numbering vertices and faces.
Definition: SurfaceMesh.h:105
std::size_t Size
The type for counting elements.
Definition: SurfaceMesh.h:103
std::vector< Face > Faces
Definition: SurfaceMesh.h:116