Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
NormalCycleComputer.h
1
16
17#pragma once
18
30
31#if defined(NormalCycleComputer_RECURSES)
32#error Recursive header files inclusion detected in NormalCycleComputer.h
33#else // defined(NormalCycleComputer_RECURSES)
35#define NormalCycleComputer_RECURSES
36
37#if !defined NormalCycleComputer_h
39#define NormalCycleComputer_h
40
42// Inclusions
43#include "DGtal/base/Common.h"
44#include "DGtal/math/linalg/EigenDecomposition.h"
45#include "DGtal/geometry/meshes/SurfaceMeshMeasure.h"
46#include "DGtal/geometry/meshes/NormalCycleFormula.h"
47#include "DGtal/shapes/SurfaceMesh.h"
48
49
50namespace DGtal
51{
53 // template class NormalCycleComputer
66 template < typename TRealPoint, typename TRealVector >
68 {
69 typedef TRealPoint RealPoint;
70 typedef TRealVector RealVector;
75 typedef typename RealVector::Component Scalar;
80 typedef std::vector< Scalar > Scalars;
81 typedef std::vector< RealPoint > RealPoints;
82 typedef std::vector< RealVector > RealVectors;
83 typedef std::vector< RealTensor > RealTensors;
84 typedef typename SurfaceMesh::Size Size;
85 typedef typename SurfaceMesh::Index Index;
86 typedef typename SurfaceMesh::Vertex Vertex;
87 typedef typename SurfaceMesh::Face Face;
88
89
93
108
109 //-------------------------------------------------------------------------
110 public:
113
117 static
119 {
120 return ( mu0 != 0.0 ) ? mu1 / ( 2.0 * mu0 ) : 0.0;
121 }
122
126 static
128 {
129 return ( mu0 != 0.0 ) ? mu2 / mu0 : 0.0;
130 }
131
139 static
140 std::tuple< Scalar, Scalar, RealVector, RealVector >
142 {
143 muXY += muXY.transpose();
144 muXY *= 0.5;
145 const double coef_N = 1000.0 * mu0;
146 // Trick to force orthogonality to normal vector.
147 for ( int j = 0; j < 3; j++ )
148 for ( int k = 0; k < 3; k++ )
149 muXY( j, k ) += coef_N * N[ j ] * N[ k ];
150 RealTensor V;
153 return std::make_tuple( ( mu0 != 0.0 ) ? -L[ 1 ] / mu0 : 0.0,
154 ( mu0 != 0.0 ) ? -L[ 0 ] / mu0 : 0.0,
155 V.column( 1 ),
156 V.column( 0 ) );
157 }
158
159
160 // ------------------------- Protected Datas ------------------------------
161 protected:
162
165
166
167
168 }; // end of class NormalCycleComputer
169
170} // namespace DGtal
171
173// Includes inline functions.
174#include "NormalCycleComputer.ih"
175// //
177
178#endif // !defined NormalCycleComputer_h
179
180#undef NormalCycleComputer_RECURSES
181#endif // else defined(NormalCycleComputer_RECURSES)
182
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition ConstAlias.h:187
static void getEigenDecomposition(const Matrix &matrix, Matrix &eigenVectors, Vector &eigenValues)
Compute both eigen vectors and eigen values from an input matrix.
static const Dimension dimension
ColumnVector column(const DGtal::Dimension j) const
SimpleMatrix< Component, TN, TM > transpose() const
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::uint32_t Dimension
Definition Common.h:119
static Scalar meanCurvature(Scalar mu0, Scalar mu1)
NormalCycleComputer(ConstAlias< SurfaceMesh > aMesh)
ScalarMeasure computeMu0() const
NormalCycleFormula< RealPoint, RealVector > Formula
TensorMeasure computeMuXY() const
static Scalar GaussianCurvature(Scalar mu0, Scalar mu2)
SurfaceMeshMeasure< RealPoint, RealVector, RealTensor > TensorMeasure
ScalarMeasure computeMu2() const
ScalarMeasure computeMu1() const
SimpleMatrix< Scalar, dimension, dimension > RealTensor
TensorMeasure computeMuXYs() const
DGtal::SurfaceMesh< RealPoint, RealVector > SurfaceMesh
BOOST_STATIC_ASSERT((dimension==3))
static std::tuple< Scalar, Scalar, RealVector, RealVector > principalCurvatures(Scalar mu0, RealTensor muXY, const RealVector &N)
NormalCycleComputer< RealPoint, RealVector > Self
SurfaceMeshMeasure< RealPoint, RealVector, Scalar > ScalarMeasure