DGtal  0.9.3beta
Public Types | Public Member Functions | Data Fields
DGtal::functors::BallConstantPointFunction< TPoint, TScalar > Struct Template Reference

#include <DGtal/kernel/Point2ScalarFunctors.h>

Public Types

typedef TPoint Point
 
typedef TScalar Scalar
 
typedef Point argument_type
 
typedef Scalar value_type
 

Public Member Functions

 BallConstantPointFunction (Scalar v0, Scalar r)
 
Scalar operator() (const Point &p) const
 

Data Fields

Scalar myV0
 
Scalar myR2
 

Detailed Description

template<typename TPoint, typename TScalar>
struct DGtal::functors::BallConstantPointFunction< TPoint, TScalar >

The ball constant function of value v0 between norm 0 and r, 0 elsewhere. A function Point -> Scalar.

Examples:
geometry/surfaces/dvcm-2d-curvature.cpp.

Definition at line 85 of file Point2ScalarFunctors.h.

Member Typedef Documentation

template<typename TPoint , typename TScalar >
typedef Point DGtal::functors::BallConstantPointFunction< TPoint, TScalar >::argument_type

Definition at line 88 of file Point2ScalarFunctors.h.

template<typename TPoint , typename TScalar >
typedef TPoint DGtal::functors::BallConstantPointFunction< TPoint, TScalar >::Point

Definition at line 86 of file Point2ScalarFunctors.h.

template<typename TPoint , typename TScalar >
typedef TScalar DGtal::functors::BallConstantPointFunction< TPoint, TScalar >::Scalar

Definition at line 87 of file Point2ScalarFunctors.h.

template<typename TPoint , typename TScalar >
typedef Scalar DGtal::functors::BallConstantPointFunction< TPoint, TScalar >::value_type

Definition at line 89 of file Point2ScalarFunctors.h.

Constructor & Destructor Documentation

template<typename TPoint , typename TScalar >
DGtal::functors::BallConstantPointFunction< TPoint, TScalar >::BallConstantPointFunction ( Scalar  v0,
Scalar  r 
)
inline

Member Function Documentation

template<typename TPoint , typename TScalar >
Scalar DGtal::functors::BallConstantPointFunction< TPoint, TScalar >::operator() ( const Point p) const
inline

Definition at line 97 of file Point2ScalarFunctors.h.

References DGtal::functors::BallConstantPointFunction< TPoint, TScalar >::myV0, and DGtal::functions::square().

98  {
99  Scalar d = 0;
100  for ( typename Point::ConstIterator it = p.begin(), itE = p.end(); it != itE; ++it )
101  d += functions::square( (Scalar) *it );
102  return ( d > myR2 ) ? 0.0 : myV0;
103  }

Field Documentation

template<typename TPoint , typename TScalar >
Scalar DGtal::functors::BallConstantPointFunction< TPoint, TScalar >::myR2

Definition at line 92 of file Point2ScalarFunctors.h.

template<typename TPoint , typename TScalar >
Scalar DGtal::functors::BallConstantPointFunction< TPoint, TScalar >::myV0

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