File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
DGtal::functors::ShapeGeometricFunctors::ShapeNormalVectorFunctor< TShape > Struct Template Reference

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

#include <DGtal/shapes/ShapeGeometricFunctors.h>

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
 The shape of interest.

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

◆ Argument

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

Definition at line 118 of file ShapeGeometricFunctors.h.

◆ Quantity

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

Definition at line 120 of file ShapeGeometricFunctors.h.

◆ RealPoint

◆ RealVector

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

Definition at line 117 of file ShapeGeometricFunctors.h.

◆ Scalar

Definition at line 119 of file ShapeGeometricFunctors.h.

◆ Shape

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

Definition at line 115 of file ShapeGeometricFunctors.h.

◆ Value

Definition at line 121 of file ShapeGeometricFunctors.h.

Constructor & Destructor Documentation

◆ ShapeNormalVectorFunctor()

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

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 ) {}
Aim: A functor RealPoint -> Quantity that returns the normal vector at given point.
CountedConstPtrOrConstPtr< Shape > myShape
The shape of interest.

References myShape.

Member Function Documentation

◆ attach()

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.

138 {
139 myShape = aShape;
140 }

References myShape.

◆ operator()()

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.

148 {
149 RealVector v = myShape->gradient( p );
150 Scalar norm = v.norm();
151 return ( norm != 0 ) ? v / norm : v;
152 }

References myShape, and DGtal::PointVector< dim, TEuclideanRing, TContainer >::norm().

Field Documentation

◆ myShape

The shape of interest.

Definition at line 156 of file ShapeGeometricFunctors.h.

Referenced by attach(), operator()(), and ShapeNormalVectorFunctor().


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