DGtal  0.9.3beta
Public Types | Public Member Functions | Protected Member Functions | Private Attributes
DGtal::ImplicitPolynomial3Shape< TSpace > Class Template Reference

#include <DGtal/shapes/implicit/ImplicitPolynomial3Shape.h>

Collaboration diagram for DGtal::ImplicitPolynomial3Shape< TSpace >:
[legend]

Public Types

typedef ImplicitPolynomial3Shape< TSpace > Self
 
typedef TSpace Space
 
typedef Space::RealPoint RealPoint
 
typedef Space::RealVector RealVector
 
typedef RealPoint::Coordinate Ring
 
typedef Space::Integer Integer
 
typedef MPolynomial< 3, RingPolynomial3
 
typedef Ring Value
 

Public Member Functions

 BOOST_STATIC_ASSERT ((Space::dimension==3))
 
 ImplicitPolynomial3Shape (const Polynomial3 &poly)
 
ImplicitPolynomial3Shapeoperator= (const ImplicitPolynomial3Shape &other)
 
 ~ImplicitPolynomial3Shape ()
 
void init (const Polynomial3 &poly)
 
double operator() (const RealPoint &aPoint) const
 
bool isInside (const RealPoint &aPoint) const
 
Orientation orientation (const RealPoint &aPoint) const
 
RealVector gradient (const RealPoint &aPoint) const
 
double meanCurvature (const RealPoint &aPoint) const
 
double gaussianCurvature (const RealPoint &aPoint) const
 
void principalCurvatures (const RealPoint &aPoint, double &k1, double &k2) const
 
RealPoint nearestPoint (const RealPoint &aPoint, const double accuracy, const int maxIter, const double gamma) const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Member Functions

 ImplicitPolynomial3Shape ()
 

Private Attributes

Polynomial3 myPolynomial
 
Polynomial3 myFx
 
Polynomial3 myFy
 
Polynomial3 myFz
 
Polynomial3 myFxx
 
Polynomial3 myFxy
 
Polynomial3 myFxz
 
Polynomial3 myFyx
 
Polynomial3 myFyy
 
Polynomial3 myFyz
 
Polynomial3 myFzx
 
Polynomial3 myFzy
 
Polynomial3 myFzz
 
Polynomial3 myUpPolynome
 
Polynomial3 myLowPolynome
 

Detailed Description

template<typename TSpace>
class DGtal::ImplicitPolynomial3Shape< TSpace >

Aim: model of CEuclideanOrientedShape concepts to create a shape from a polynomial.

Description of template class 'ImplicitPolynomial3Shape'

Model of CImplicitFunction

Template Parameters
TSpacethe Digital space definition.
Examples:
topology/trackImplicitPolynomialSurfaceToOFF.cpp.

Definition at line 67 of file ImplicitPolynomial3Shape.h.

Member Typedef Documentation

template<typename TSpace >
typedef Space::Integer DGtal::ImplicitPolynomial3Shape< TSpace >::Integer

Definition at line 76 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
typedef MPolynomial< 3, Ring > DGtal::ImplicitPolynomial3Shape< TSpace >::Polynomial3

Definition at line 77 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
typedef Space::RealPoint DGtal::ImplicitPolynomial3Shape< TSpace >::RealPoint

Definition at line 73 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
typedef Space::RealVector DGtal::ImplicitPolynomial3Shape< TSpace >::RealVector

Definition at line 74 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
typedef RealPoint::Coordinate DGtal::ImplicitPolynomial3Shape< TSpace >::Ring

Definition at line 75 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
typedef ImplicitPolynomial3Shape<TSpace> DGtal::ImplicitPolynomial3Shape< TSpace >::Self

Definition at line 71 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
typedef TSpace DGtal::ImplicitPolynomial3Shape< TSpace >::Space

Definition at line 72 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
typedef Ring DGtal::ImplicitPolynomial3Shape< TSpace >::Value

Definition at line 78 of file ImplicitPolynomial3Shape.h.

Constructor & Destructor Documentation

template<typename TSpace >
DGtal::ImplicitPolynomial3Shape< TSpace >::ImplicitPolynomial3Shape ( const Polynomial3 poly)

Constructor from an arbitrary polynomial.

Parameters
polyany multivariate polynomial (the number of variables is the dimension of the space)
template<typename TSpace >
DGtal::ImplicitPolynomial3Shape< TSpace >::~ImplicitPolynomial3Shape ( )

Destructor.

template<typename TSpace >
DGtal::ImplicitPolynomial3Shape< TSpace >::ImplicitPolynomial3Shape ( )
protected

Constructor. Forbidden by default (protected to avoid g++ warnings).

Member Function Documentation

template<typename TSpace >
DGtal::ImplicitPolynomial3Shape< TSpace >::BOOST_STATIC_ASSERT ( (Space::dimension==3)  )
template<typename TSpace >
double DGtal::ImplicitPolynomial3Shape< TSpace >::gaussianCurvature ( const RealPoint aPoint) const
inline

Gaussian curvature estimation at aPoint

Precondition
aPoint must be close to the surface.
Parameters
aPointany point in the Euclidean space.
Returns
the gaussian curvature value of the polynomial at aPoint.
template<typename TSpace >
RealVector DGtal::ImplicitPolynomial3Shape< TSpace >::gradient ( const RealPoint aPoint) const
inline
Parameters
aPointany point in the Euclidean space.
Returns
the gradient vector of the polynomial at aPoint.
template<typename TSpace >
void DGtal::ImplicitPolynomial3Shape< TSpace >::init ( const Polynomial3 poly)

Initialize from an arbitrary polynomial.

Parameters
polyany multivariate polynomial (the number of variables is the dimension of the space)
template<typename TSpace >
bool DGtal::ImplicitPolynomial3Shape< TSpace >::isInside ( const RealPoint aPoint) const
Parameters
aPointany point in the Euclidean space.
Returns
'true' if the polynomial value is < 0.
template<typename TSpace >
bool DGtal::ImplicitPolynomial3Shape< TSpace >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TSpace >
double DGtal::ImplicitPolynomial3Shape< TSpace >::meanCurvature ( const RealPoint aPoint) const
inline

Mean curvature estimation. This computation is based on the hessian formula of the mean curvature k=(∇F ∗ H (F ) ∗ ∇F T − |∇F |^2 *Trace(H (F ))/2|∇F |^3

Precondition
a Point must be close to the surface.
Parameters
aPointany point in the Euclidean space.
Returns
the mean curvature value of the polynomial at aPoint.
template<typename TSpace >
RealPoint DGtal::ImplicitPolynomial3Shape< TSpace >::nearestPoint ( const RealPoint aPoint,
const double  accuracy,
const int  maxIter,
const double  gamma 
) const
inline

Perform a gradient descent in order to move a point aPoint closer to the implicit surface. More precisely, we use a sequence: x_n = x_(n-1) - gamma.gradient(x_(n-1). The descent is stopped if maxIter is reached or if |x_n - x_(n-1)| < accuracy.

Parameters
aPointany point in the Euclidean space.
accuracydistance criterion to stop the descent.
maxIterfixes the maximum number of steps.
gammacoefficient associated with the gradient.
Returns
the nearest point on the surface to the one given in parameter.
template<typename TSpace >
double DGtal::ImplicitPolynomial3Shape< TSpace >::operator() ( const RealPoint aPoint) const
Parameters
aPointany point in the Euclidean space.
Returns
the value of the polynomial at aPoint.
template<typename TSpace >
ImplicitPolynomial3Shape& DGtal::ImplicitPolynomial3Shape< TSpace >::operator= ( const ImplicitPolynomial3Shape< TSpace > &  other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.
template<typename TSpace >
Orientation DGtal::ImplicitPolynomial3Shape< TSpace >::orientation ( const RealPoint aPoint) const
Parameters
aPointany point in the Euclidean space.
Returns
INSIDE if the polynomial value is < 0, OUTSIDE if > 0, ON otherwise.
template<typename TSpace >
void DGtal::ImplicitPolynomial3Shape< TSpace >::principalCurvatures ( const RealPoint aPoint,
double &  k1,
double &  k2 
) const
inline

Principal curvature estimation at aPoint

Precondition
aPoint must be close to the surface.
Parameters
[in]aPointany point in the Euclidean space.
[out]k1first principal curvature
[out]k2second principal curvature
template<typename TSpace >
void DGtal::ImplicitPolynomial3Shape< TSpace >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

Field Documentation

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFx
private

Definition at line 221 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFxx
private

Definition at line 225 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFxy
private

Definition at line 226 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFxz
private

Definition at line 227 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFy
private

Definition at line 222 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFyx
private

Definition at line 229 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFyy
private

Definition at line 230 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFyz
private

Definition at line 231 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFz
private

Definition at line 223 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFzx
private

Definition at line 233 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFzy
private

Definition at line 234 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myFzz
private

Definition at line 235 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myLowPolynome
private

Definition at line 240 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myPolynomial
private

The 3-polynomial defining the implicit shape.

Definition at line 218 of file ImplicitPolynomial3Shape.h.

template<typename TSpace >
Polynomial3 DGtal::ImplicitPolynomial3Shape< TSpace >::myUpPolynome
private

Definition at line 239 of file ImplicitPolynomial3Shape.h.


The documentation for this class was generated from the following file: