DGtal 1.3.0
Loading...
Searching...
No Matches
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

◆ argument_type

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

Definition at line 88 of file Point2ScalarFunctors.h.

◆ Point

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

Definition at line 86 of file Point2ScalarFunctors.h.

◆ Scalar

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

Definition at line 87 of file Point2ScalarFunctors.h.

◆ value_type

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

◆ BallConstantPointFunction()

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

Member Function Documentation

◆ operator()()

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.

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 }

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

Field Documentation

◆ myR2

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

◆ myV0

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

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