DGtal  1.1.0
ImplicitPolynomial3Shape.h
1
17 #pragma once
18
31 #if defined(ImplicitPolynomial3Shape_RECURSES)
32 #error Recursive header files inclusion detected in ImplicitPolynomial3Shape.h
33 #else // defined(ImplicitPolynomial3Shape_RECURSES)
34
35 #define ImplicitPolynomial3Shape_RECURSES
36
37 #if !defined ImplicitPolynomial3Shape_h
38
39 #define ImplicitPolynomial3Shape_h
40
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/BasicFunctors.h"
46 #include "DGtal/base/CPredicate.h"
47 #include "DGtal/kernel/NumberTraits.h"
48 #include "DGtal/math/MPolynomial.h"
49 #include "DGtal/shapes/implicit/CImplicitFunction.h"
51
52 namespace DGtal
53 {
54
56
66  template < typename TSpace >
68  {
69
70  public:
72  typedef TSpace Space;
73  typedef typename Space::RealPoint RealPoint;
74  typedef typename Space::RealVector RealVector;
75  typedef typename RealPoint::Coordinate Ring;
76  typedef typename Space::Integer Integer;
78  typedef Ring Value;
79
81
89
96
101
108  void init( const Polynomial3 & poly );
109
110  // ----------------------- Interface --------------------------------------
111  public:
112
117  double operator()(const RealPoint &aPoint) const;
118
123  bool isInside(const RealPoint &aPoint) const;
124
132
137  inline
139
140 // ------------------------------------------------------------ Added by Anis Benyoub
141
152  inline
153  double meanCurvature( const RealPoint &aPoint ) const;
154
155
169  inline
170  double gaussianCurvature( const RealPoint &aPoint ) const;
171
180  inline
182  double & k1, double & k2 ) const;
183
197  inline
199  RealVector& d1, RealVector& d2 ) const;
200
213  inline
215  const double accuracy = 0.0001,
216  const int maxIter = 20,
217  const double gamma = 0.5 ) const;
218
219
220
221  // ----------------------- Interface --------------------------------------
222  public:
223
228  void selfDisplay ( std::ostream & out ) const;
229
234  bool isValid() const;
235
236  // ------------------------- Protected Datas ------------------------------
237  private:
238  // ------------------------- Private Datas --------------------------------
239  private:
242
243  // Partial deriatives
247
251
255
259
260
261  // Precomputed Polynoms useful for curvature computations
264
265
266  // ------------------------- Hidden services ------------------------------
267  protected:
268
274
275  private:
276
277
278  }; // end of class ImplicitPolynomial3Shape
279
280
287  template <typename T>
288  std::ostream &
289  operator<< ( std::ostream & out, const ImplicitPolynomial3Shape<T> & object );
290
291 } // namespace DGtal
292
293
295 // Includes inline functions.
296 #include "DGtal/shapes/implicit/ImplicitPolynomial3Shape.ih"
297
298 // //
300
301 #endif // !defined ImplicitPolynomial3Shape_h
302
303 #undef ImplicitPolynomial3Shape_RECURSES
304 #endif // else defined(ImplicitPolynomial3Shape_RECURSES)
DGtal::ImplicitPolynomial3Shape::principalDirections
void principalDirections(const RealPoint &aPoint, RealVector &d1, RealVector &d2) const
DGtal::ImplicitPolynomial3Shape::myLowPolynome
Polynomial3 myLowPolynome
Definition: ImplicitPolynomial3Shape.h:263
DGtal::ImplicitPolynomial3Shape::Space
TSpace Space
Definition: ImplicitPolynomial3Shape.h:72
DGtal::ImplicitPolynomial3Shape::operator=
ImplicitPolynomial3Shape & operator=(const ImplicitPolynomial3Shape &other)
DGtal::PointVector::Coordinate
Component Coordinate
Type for Point elements.
Definition: PointVector.h:617
DGtal::ImplicitPolynomial3Shape::meanCurvature
double meanCurvature(const RealPoint &aPoint) const
DGtal::ImplicitPolynomial3Shape::myPolynomial
Polynomial3 myPolynomial
The 3-polynomial defining the implicit shape.
Definition: ImplicitPolynomial3Shape.h:241
DGtal::ImplicitPolynomial3Shape::myFzx
Polynomial3 myFzx
Definition: ImplicitPolynomial3Shape.h:256
aPoint
const Point aPoint(3, 4)
DGtal::ImplicitPolynomial3Shape::myFxx
Polynomial3 myFxx
Definition: ImplicitPolynomial3Shape.h:248
DGtal::ImplicitPolynomial3Shape::Self
ImplicitPolynomial3Shape< TSpace > Self
Definition: ImplicitPolynomial3Shape.h:71
DGtal::ImplicitPolynomial3Shape::init
void init(const Polynomial3 &poly)
DGtal::ImplicitPolynomial3Shape::orientation
Orientation orientation(const RealPoint &aPoint) const
DGtal::ImplicitPolynomial3Shape::~ImplicitPolynomial3Shape
~ImplicitPolynomial3Shape()
DGtal::ImplicitPolynomial3Shape::Polynomial3
MPolynomial< 3, Ring > Polynomial3
Definition: ImplicitPolynomial3Shape.h:77
DGtal::ImplicitPolynomial3Shape::myFyx
Polynomial3 myFyx
Definition: ImplicitPolynomial3Shape.h:252
DGtal::ImplicitPolynomial3Shape::isValid
bool isValid() const
DGtal::ImplicitPolynomial3Shape::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((Space::dimension==3))
DGtal::ImplicitPolynomial3Shape::Integer
Space::Integer Integer
Definition: ImplicitPolynomial3Shape.h:76
DGtal::ImplicitPolynomial3Shape::myFyz
Polynomial3 myFyz
Definition: ImplicitPolynomial3Shape.h:254
DGtal::Orientation
Orientation
Definition: Common.h:138
DGtal::ImplicitPolynomial3Shape::myFxy
Polynomial3 myFxy
Definition: ImplicitPolynomial3Shape.h:249
DGtal::ImplicitPolynomial3Shape::gaussianCurvature
double gaussianCurvature(const RealPoint &aPoint) const
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::ImplicitPolynomial3Shape::RealPoint
Space::RealPoint RealPoint
Definition: ImplicitPolynomial3Shape.h:73
DGtal::ImplicitPolynomial3Shape::Value
Ring Value
Definition: ImplicitPolynomial3Shape.h:78
DGtal::SpaceND::dimension
static const Dimension dimension
static constants to store the dimension.
Definition: SpaceND.h:132
DGtal::ImplicitPolynomial3Shape::myUpPolynome
Polynomial3 myUpPolynome
Definition: ImplicitPolynomial3Shape.h:262
DGtal::ImplicitPolynomial3Shape
Aim: model of CEuclideanOrientedShape concepts to create a shape from a polynomial.
Definition: ImplicitPolynomial3Shape.h:68
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::ImplicitPolynomial3Shape::RealVector
Space::RealVector RealVector
Definition: ImplicitPolynomial3Shape.h:74
DGtal::ImplicitPolynomial3Shape::myFzz
Polynomial3 myFzz
Definition: ImplicitPolynomial3Shape.h:258
DGtal::ImplicitPolynomial3Shape::myFx
Polynomial3 myFx
Definition: ImplicitPolynomial3Shape.h:244
DGtal::ImplicitPolynomial3Shape::principalCurvatures
void principalCurvatures(const RealPoint &aPoint, double &k1, double &k2) const
DGtal::ImplicitPolynomial3Shape::isInside
bool isInside(const RealPoint &aPoint) const
DGtal::ImplicitPolynomial3Shape::myFzy
Polynomial3 myFzy
Definition: ImplicitPolynomial3Shape.h:257
DGtal::ImplicitPolynomial3Shape::myFxz
Polynomial3 myFxz
Definition: ImplicitPolynomial3Shape.h:250
DGtal::ImplicitPolynomial3Shape::myFz
Polynomial3 myFz
Definition: ImplicitPolynomial3Shape.h:246
DGtal::ImplicitPolynomial3Shape::ImplicitPolynomial3Shape
ImplicitPolynomial3Shape(const Polynomial3 &poly)
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:593
DGtal::ImplicitPolynomial3Shape::ImplicitPolynomial3Shape
ImplicitPolynomial3Shape()
DGtal::MPolynomial< 3, Ring >
DGtal::ImplicitPolynomial3Shape::myFyy
Polynomial3 myFyy
Definition: ImplicitPolynomial3Shape.h:253
DGtal::ImplicitPolynomial3Shape::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::ImplicitPolynomial3Shape::operator()
double operator()(const RealPoint &aPoint) const
DGtal::ImplicitPolynomial3Shape::myFy
Polynomial3 myFy
Definition: ImplicitPolynomial3Shape.h:245
DGtal::ImplicitPolynomial3Shape::nearestPoint
RealPoint nearestPoint(const RealPoint &aPoint, const double accuracy=0.0001, const int maxIter=20, const double gamma=0.5) const
DGtal::SpaceND::Integer
TInteger Integer
Arithmetic ring induced by (+,-,*) and Integer numbers.
Definition: SpaceND.h:102
DGtal::ImplicitPolynomial3Shape::Ring
RealPoint::Coordinate Ring
Definition: ImplicitPolynomial3Shape.h:75