DGtal  1.4.2
CorrectedNormalCurrentComputer.h
1 
17 #pragma once
18 
31 #if defined(CorrectedNormalCurrentComputer_RECURSES)
32 #error Recursive header files inclusion detected in CorrectedNormalCurrentComputer.h
33 #else // defined(CorrectedNormalCurrentComputer_RECURSES)
35 #define CorrectedNormalCurrentComputer_RECURSES
36 
37 #if !defined CorrectedNormalCurrentComputer_h
39 #define CorrectedNormalCurrentComputer_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/CorrectedNormalCurrentFormula.h"
47 #include "DGtal/shapes/SurfaceMesh.h"
48 
49 
50 namespace DGtal
51 {
53  // template class CorrectedNormalCurrentComputer
68  template < typename TRealPoint, typename TRealVector >
70  {
71  typedef TRealPoint RealPoint;
72  typedef TRealVector RealVector;
74  static const Dimension dimension = RealPoint::dimension;
77  typedef typename RealVector::Component Scalar;
82  typedef std::vector< Scalar > Scalars;
83  typedef std::vector< RealPoint > RealPoints;
84  typedef std::vector< RealVector > RealVectors;
85  typedef std::vector< RealTensor > RealTensors;
86  typedef typename SurfaceMesh::Size Size;
87  typedef typename SurfaceMesh::Index Index;
88  typedef typename SurfaceMesh::Vertex Vertex;
89  typedef typename SurfaceMesh::Face Face;
90 
91 
102  bool unit_u = false );
103 
116 
117  //-------------------------------------------------------------------------
118  public:
121 
125  static
127  {
128  return ( mu0 != 0.0 ) ? mu1 / ( 2.0 * mu0 ) : 0.0;
129  }
130 
134  static
136  {
137  return ( mu0 != 0.0 ) ? mu2 / mu0 : 0.0;
138  }
139 
147  static
148  std::tuple< Scalar, Scalar, RealVector, RealVector >
150  {
151  muXY += muXY.transpose();
152  muXY *= 0.5;
153  const double coef_N = 1000.0 * mu0;
154  // Trick to force orthogonality to normal vector.
155  // (see @cite lachaud2020interpolated, section 2)
156  for ( int j = 0; j < 3; j++ )
157  for ( int k = 0; k < 3; k++ )
158  muXY( j, k ) += coef_N * N[ j ] * N[ k ];
159  RealTensor V;
160  RealVector L;
162  return std::make_tuple( ( mu0 != 0.0 ) ? -L[ 1 ] / mu0 : 0.0,
163  ( mu0 != 0.0 ) ? -L[ 0 ] / mu0 : 0.0,
164  V.column( 1 ),
165  V.column( 0 ) );
166  }
168 
169  // ------------------------- Public Datas ------------------------------
170  public:
171 
172  // ------------------------- Protected Datas ------------------------------
173  protected:
174 
179  bool myUnitU;
180 
181  // ------------------------- Private Datas --------------------------------
182  private:
183 
184  // ------------------------- Internals ------------------------------------
185  protected:
186 
207 
228 
229 
230  }; // end of class CorrectedNormalCurrentComputer
231 
232 } // namespace DGtal
233 
235 // Includes inline functions.
236 #include "CorrectedNormalCurrentComputer.ih"
237 // //
239 
240 #endif // !defined CorrectedNormalCurrentComputer_h
241 
242 #undef CorrectedNormalCurrentComputer_RECURSES
243 #endif // else defined(CorrectedNormalCurrentComputer_RECURSES)
244 
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.
Aim: implements basic MxN Matrix services (M,N>=1).
Definition: SimpleMatrix.h:76
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:136
Aim: Utility class to compute curvature measures induced by (1) a corrected normal current defined by...
SurfaceMeshMeasure< RealPoint, RealVector, Scalar > ScalarMeasure
ScalarMeasure computeMu0InterpolatedU() const
CorrectedNormalCurrentComputer< RealPoint, RealVector > Self
SurfaceMeshMeasure< RealPoint, RealVector, RealTensor > TensorMeasure
ScalarMeasure computeMu1ConstantU() const
const SurfaceMesh & myMesh
A reference to the mesh over which computations are done.
ScalarMeasure computeMu2ConstantU() const
ScalarMeasure computeMu1InterpolatedU() const
DGtal::SurfaceMesh< RealPoint, RealVector > SurfaceMesh
CorrectedNormalCurrentComputer(ConstAlias< SurfaceMesh > aMesh, bool unit_u=false)
SimpleMatrix< Scalar, dimension, dimension > RealTensor
ScalarMeasure computeMu0ConstantU() const
TensorMeasure computeMuXYInterpolatedU() const
ScalarMeasure computeMu2InterpolatedU() const
static std::tuple< Scalar, Scalar, RealVector, RealVector > principalCurvatures(Scalar mu0, RealTensor muXY, const RealVector &N)
CorrectedNormalCurrentFormula< RealPoint, RealVector > Formula
TensorMeasure computeMuXYConstantU() const
static Scalar meanCurvature(Scalar mu0, Scalar mu1)
static Scalar GaussianCurvature(Scalar mu0, Scalar mu2)
Aim: A helper class that provides static methods to compute corrected normal current formulas of curv...
Aim: stores an arbitrary measure on a SurfaceMesh object. The measure can be spread onto its vertices...
Aim: Represents an embedded mesh as faces and a list of vertices. Vertices may be shared among faces ...
Definition: SurfaceMesh.h:92
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