DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
CorrectedNormalCurrentComputer.h
1
16
17
#pragma once
18
30
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
TRealPo
int
,
typename
TRealVector >
69
struct
CorrectedNormalCurrentComputer
70
{
71
typedef
TRealPoint
RealPoint
;
72
typedef
TRealVector
RealVector
;
73
typedef
CorrectedNormalCurrentComputer< RealPoint, RealVector >
Self
;
74
static
const
Dimension
dimension
=
RealPoint::dimension
;
75
BOOST_STATIC_ASSERT
( (
dimension
== 3 ) );
76
typedef
DGtal::SurfaceMesh< RealPoint, RealVector >
SurfaceMesh
;
77
typedef
typename
RealVector::Component
Scalar
;
78
typedef
SimpleMatrix< Scalar, dimension, dimension >
RealTensor
;
79
typedef
CorrectedNormalCurrentFormula< RealPoint, RealVector >
Formula
;
80
typedef
SurfaceMeshMeasure< RealPoint, RealVector, Scalar >
ScalarMeasure
;
81
typedef
SurfaceMeshMeasure< RealPoint, RealVector, RealTensor >
TensorMeasure
;
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
101
CorrectedNormalCurrentComputer
(
ConstAlias< SurfaceMesh >
aMesh,
102
bool
unit_u =
false
);
103
106
ScalarMeasure
computeMu0
()
const
;
109
ScalarMeasure
computeMu1
()
const
;
112
ScalarMeasure
computeMu2
()
const
;
115
TensorMeasure
computeMuXY
()
const
;
116
117
//-------------------------------------------------------------------------
118
public
:
121
125
static
126
Scalar
meanCurvature
(
Scalar
mu0,
Scalar
mu1 )
127
{
128
return
( mu0 != 0.0 ) ? mu1 / ( 2.0 * mu0 ) : 0.0;
129
}
130
134
static
135
Scalar
GaussianCurvature
(
Scalar
mu0,
Scalar
mu2 )
136
{
137
return
( mu0 != 0.0 ) ? mu2 / mu0 : 0.0;
138
}
139
147
static
148
std::tuple< Scalar, Scalar, RealVector, RealVector >
149
principalCurvatures
(
Scalar
mu0,
RealTensor
muXY,
const
RealVector
& N )
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
;
161
EigenDecomposition< 3, double>::getEigenDecomposition
( muXY, V,
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
}
167
168
169
// ------------------------- Public Data ------------------------------
170
public
:
171
172
// ------------------------- Protected Data ------------------------------
173
protected
:
174
176
const
SurfaceMesh
&
myMesh
;
179
bool
myUnitU
;
180
181
// ------------------------- Private Data --------------------------------
182
private
:
183
184
// ------------------------- Internals ------------------------------------
185
protected
:
186
191
ScalarMeasure
computeMu0ConstantU
()
const
;
196
ScalarMeasure
computeMu1ConstantU
()
const
;
201
ScalarMeasure
computeMu2ConstantU
()
const
;
206
TensorMeasure
computeMuXYConstantU
()
const
;
207
212
ScalarMeasure
computeMu0InterpolatedU
()
const
;
217
ScalarMeasure
computeMu1InterpolatedU
()
const
;
222
ScalarMeasure
computeMu2InterpolatedU
()
const
;
227
TensorMeasure
computeMuXYInterpolatedU
()
const
;
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)
DGtal::ConstAlias
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition
ConstAlias.h:187
DGtal::EigenDecomposition::getEigenDecomposition
static void getEigenDecomposition(const Matrix &matrix, Matrix &eigenVectors, Vector &eigenValues)
Compute both eigen vectors and eigen values from an input matrix.
DGtal::PointVector< dim, double >::Component
double Component
Definition
PointVector.h:614
DGtal::PointVector< 3, double >::dimension
static const Dimension dimension
Definition
PointVector.h:626
DGtal::SimpleMatrix< Scalar, dimension, dimension >
DGtal::SimpleMatrix::column
ColumnVector column(const DGtal::Dimension j) const
DGtal::SimpleMatrix::transpose
SimpleMatrix< Component, TN, TM > transpose() const
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::Dimension
DGtal::uint32_t Dimension
Definition
Common.h:119
DGtal::ProbingMode::L
@ L
Definition
PlaneProbingTetrahedronEstimator.h:63
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::dimension
static const Dimension dimension
Definition
CorrectedNormalCurrentComputer.h:74
DGtal::CorrectedNormalCurrentComputer::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((dimension==3))
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::ScalarMeasure
SurfaceMeshMeasure< RealPoint, RealVector, Scalar > ScalarMeasure
Definition
CorrectedNormalCurrentComputer.h:80
DGtal::CorrectedNormalCurrentComputer::computeMu0InterpolatedU
ScalarMeasure computeMu0InterpolatedU() const
DGtal::CorrectedNormalCurrentComputer::Self
CorrectedNormalCurrentComputer< RealPoint, RealVector > Self
Definition
CorrectedNormalCurrentComputer.h:73
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::TensorMeasure
SurfaceMeshMeasure< RealPoint, RealVector, RealTensor > TensorMeasure
Definition
CorrectedNormalCurrentComputer.h:81
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::RealVectors
std::vector< RealVector > RealVectors
Definition
CorrectedNormalCurrentComputer.h:84
DGtal::CorrectedNormalCurrentComputer::computeMu1ConstantU
ScalarMeasure computeMu1ConstantU() const
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::myMesh
const SurfaceMesh & myMesh
Definition
CorrectedNormalCurrentComputer.h:176
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::myUnitU
bool myUnitU
Definition
CorrectedNormalCurrentComputer.h:179
DGtal::CorrectedNormalCurrentComputer::RealVector
TRealVector RealVector
Definition
CorrectedNormalCurrentComputer.h:72
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::Face
SurfaceMesh::Face Face
Definition
CorrectedNormalCurrentComputer.h:89
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::RealTensors
std::vector< RealTensor > RealTensors
Definition
CorrectedNormalCurrentComputer.h:85
DGtal::CorrectedNormalCurrentComputer::computeMu2ConstantU
ScalarMeasure computeMu2ConstantU() const
DGtal::CorrectedNormalCurrentComputer::computeMu1InterpolatedU
ScalarMeasure computeMu1InterpolatedU() const
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::Scalars
std::vector< Scalar > Scalars
Definition
CorrectedNormalCurrentComputer.h:82
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::SurfaceMesh
DGtal::SurfaceMesh< RealPoint, RealVector > SurfaceMesh
Definition
CorrectedNormalCurrentComputer.h:76
DGtal::CorrectedNormalCurrentComputer::CorrectedNormalCurrentComputer
CorrectedNormalCurrentComputer(ConstAlias< SurfaceMesh > aMesh, bool unit_u=false)
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::RealTensor
SimpleMatrix< Scalar, dimension, dimension > RealTensor
Definition
CorrectedNormalCurrentComputer.h:78
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::Scalar
RealVector::Component Scalar
Definition
CorrectedNormalCurrentComputer.h:77
DGtal::CorrectedNormalCurrentComputer::computeMu0ConstantU
ScalarMeasure computeMu0ConstantU() const
DGtal::CorrectedNormalCurrentComputer::computeMuXYInterpolatedU
TensorMeasure computeMuXYInterpolatedU() const
DGtal::CorrectedNormalCurrentComputer::computeMu1
ScalarMeasure computeMu1() const
DGtal::CorrectedNormalCurrentComputer::computeMu2
ScalarMeasure computeMu2() const
DGtal::CorrectedNormalCurrentComputer::computeMu2InterpolatedU
ScalarMeasure computeMu2InterpolatedU() const
DGtal::CorrectedNormalCurrentComputer::principalCurvatures
static std::tuple< Scalar, Scalar, RealVector, RealVector > principalCurvatures(Scalar mu0, RealTensor muXY, const RealVector &N)
Definition
CorrectedNormalCurrentComputer.h:149
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::Formula
CorrectedNormalCurrentFormula< RealPoint, RealVector > Formula
Definition
CorrectedNormalCurrentComputer.h:79
DGtal::CorrectedNormalCurrentComputer::RealPoint
TRealPoint RealPoint
Definition
CorrectedNormalCurrentComputer.h:71
DGtal::CorrectedNormalCurrentComputer::computeMuXYConstantU
TensorMeasure computeMuXYConstantU() const
DGtal::CorrectedNormalCurrentComputer::meanCurvature
static Scalar meanCurvature(Scalar mu0, Scalar mu1)
Definition
CorrectedNormalCurrentComputer.h:126
DGtal::CorrectedNormalCurrentComputer::GaussianCurvature
static Scalar GaussianCurvature(Scalar mu0, Scalar mu2)
Definition
CorrectedNormalCurrentComputer.h:135
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::Vertex
SurfaceMesh::Vertex Vertex
Definition
CorrectedNormalCurrentComputer.h:88
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::Index
SurfaceMesh::Index Index
Definition
CorrectedNormalCurrentComputer.h:87
DGtal::CorrectedNormalCurrentComputer::computeMuXY
TensorMeasure computeMuXY() const
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::Size
SurfaceMesh::Size Size
Definition
CorrectedNormalCurrentComputer.h:86
DGtal::CorrectedNormalCurrentComputer::computeMu0
ScalarMeasure computeMu0() const
DGtal::CorrectedNormalCurrentComputer< RealPoint, RealVector >::RealPoints
std::vector< RealPoint > RealPoints
Definition
CorrectedNormalCurrentComputer.h:83
DGtal::CorrectedNormalCurrentFormula< RealPoint, RealVector >
DGtal::SurfaceMeshMeasure< RealPoint, RealVector, Scalar >
DGtal::SurfaceMesh< RealPoint, RealVector >
DGtal::SurfaceMesh< RealPoint, RealVector >::Index
std::size_t Index
Definition
SurfaceMesh.h:105
DGtal::SurfaceMesh< RealPoint, RealVector >::Face
Index Face
Definition
SurfaceMesh.h:106
DGtal::SurfaceMesh< RealPoint, RealVector >::Size
std::size_t Size
Definition
SurfaceMesh.h:103
DGtal::SurfaceMesh< RealPoint, RealVector >::Vertex
Index Vertex
Definition
SurfaceMesh.h:108
src
DGtal
geometry
meshes
CorrectedNormalCurrentComputer.h
Generated on
for DGtal by
1.18.0