DGtal  0.9.4beta
Public Types | Public Member Functions | Private Attributes
DGtal::functors::ShapeGeometricFunctors::ShapeNormalVectorFunctor< TShape > Struct Template Reference

#include <DGtal/shapes/ShapeGeometricFunctors.h>

Collaboration diagram for DGtal::functors::ShapeGeometricFunctors::ShapeNormalVectorFunctor< TShape >:
[legend]

Public Types

typedef TShape Shape
 
typedef Shape::RealPoint RealPoint
 
typedef Shape::RealVector RealVector
 
typedef RealPoint Argument
 
typedef RealVector::Component Scalar
 
typedef RealVector Quantity
 
typedef Quantity Value
 

Public Member Functions

 ShapeNormalVectorFunctor (ConstAlias< Shape > aShape=0)
 
void attach (ConstAlias< Shape > aShape)
 
Quantity operator() (const RealPoint &p) const
 

Private Attributes

CountedConstPtrOrConstPtr< ShapemyShape
 

Detailed Description

template<typename TShape>
struct DGtal::functors::ShapeGeometricFunctors::ShapeNormalVectorFunctor< TShape >

Aim: A functor RealPoint -> Quantity that returns the normal vector at given point.

Description of template class 'ShapeNormalVectorFunctor'

Template Parameters
TShapethe type of the shape where geometric estimation are made. It must have methods gradient.

Definition at line 114 of file ShapeGeometricFunctors.h.

Member Typedef Documentation

Definition at line 118 of file ShapeGeometricFunctors.h.

Definition at line 120 of file ShapeGeometricFunctors.h.

template<typename TShape >
typedef Shape::RealPoint DGtal::functors::ShapeGeometricFunctors::ShapeNormalVectorFunctor< TShape >::RealPoint

Definition at line 116 of file ShapeGeometricFunctors.h.

template<typename TShape >
typedef Shape::RealVector DGtal::functors::ShapeGeometricFunctors::ShapeNormalVectorFunctor< TShape >::RealVector

Definition at line 117 of file ShapeGeometricFunctors.h.

Definition at line 119 of file ShapeGeometricFunctors.h.

template<typename TShape >
typedef TShape DGtal::functors::ShapeGeometricFunctors::ShapeNormalVectorFunctor< TShape >::Shape

Definition at line 115 of file ShapeGeometricFunctors.h.

Definition at line 121 of file ShapeGeometricFunctors.h.

Constructor & Destructor Documentation

Constructor. A shape may also be attached at construction.

Parameters
aShapethe shape of interest. The alias can be secured if a some counted pointer is handed.

Definition at line 129 of file ShapeGeometricFunctors.h.

129 : myShape( aShape ) {}
CountedConstPtrOrConstPtr< Shape > myShape
The shape of interest.

Member Function Documentation

template<typename TShape >
void DGtal::functors::ShapeGeometricFunctors::ShapeNormalVectorFunctor< TShape >::attach ( ConstAlias< Shape aShape)
inline

Attach a shape.

Parameters
aShapethe shape of interest. The alias can be secured if a some counted pointer is handed.

Definition at line 137 of file ShapeGeometricFunctors.h.

References DGtal::functors::ShapeGeometricFunctors::ShapeNormalVectorFunctor< TShape >::myShape.

138  {
139  myShape = aShape;
140  }
CountedConstPtrOrConstPtr< Shape > myShape
The shape of interest.
template<typename TShape >
Quantity DGtal::functors::ShapeGeometricFunctors::ShapeNormalVectorFunctor< TShape >::operator() ( const RealPoint p) const
inline

Map operator RealPoint -> RealVector giving the normal vector.

Parameters
pany point on the shape.
Returns
the normal at point p (as the normalized gradient).

Definition at line 147 of file ShapeGeometricFunctors.h.

References DGtal::functors::ShapeGeometricFunctors::ShapeNormalVectorFunctor< TShape >::myShape.

148  {
149  RealVector v = myShape->gradient( p );
150  Scalar norm = v.norm();
151  return ( norm != 0 ) ? v / norm : v;
152  }
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:141
CountedConstPtrOrConstPtr< Shape > myShape
The shape of interest.
double norm(const NormType type=L_2) const

Field Documentation


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