DGtal 1.3.0
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Private Member Functions | Private Attributes
DGtal::TangentFromDSS2DFunctor< DSS, LambdaFunction > Class Template Reference

#include <DGtal/geometry/curves/estimation/FunctorsLambdaMST.h>

Data Structures

struct  Value
 

Public Types

typedef PointVector< 2, double > RealVector
 
typedef DSS TDSS
 

Public Member Functions

Value operator() (const TDSS &aDSS, const int &indexOfPointInDSS, const int &dssLen) const
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CUnaryFunctor< LambdaFunction, double, double >))
 

Private Attributes

LambdaFunction lambdaFunctor
 

Detailed Description

template<typename DSS, typename LambdaFunction>
class DGtal::TangentFromDSS2DFunctor< DSS, LambdaFunction >

Description of class 'TangentFromDSS2DFunctor' – model of CLMSTTangentFromDSS. Aim: Provide a functor which calculate from digital straight segment its direction and eccentricity around a given point.

Template Parameters
DSSdigital straight segment recognition algorithm
LambdaFunctionmodel of CLambdaFunctor
See also
CLambdaFunctor.h

Definition at line 112 of file FunctorsLambdaMST.h.

Member Typedef Documentation

◆ RealVector

template<typename DSS , typename LambdaFunction >
typedef PointVector<2, double> DGtal::TangentFromDSS2DFunctor< DSS, LambdaFunction >::RealVector

Definition at line 117 of file FunctorsLambdaMST.h.

◆ TDSS

template<typename DSS , typename LambdaFunction >
typedef DSS DGtal::TangentFromDSS2DFunctor< DSS, LambdaFunction >::TDSS

Definition at line 118 of file FunctorsLambdaMST.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename DSS , typename LambdaFunction >
DGtal::TangentFromDSS2DFunctor< DSS, LambdaFunction >::BOOST_CONCEPT_ASSERT ( (concepts::CUnaryFunctor< LambdaFunction, double, double >)  )
private

◆ operator()()

template<typename DSS , typename LambdaFunction >
Value DGtal::TangentFromDSS2DFunctor< DSS, LambdaFunction >::operator() ( const TDSS aDSS,
const int &  indexOfPointInDSS,
const int &  dssLen 
) const
inline

Calculate a direction of the 2D DSS and an eccentricity of a given point in this DSS.

Parameters
aDSSdigital straight segment
indexOfPointInDSSindex of given point in aDSS
dssLenlength of aDSS

Definition at line 143 of file FunctorsLambdaMST.h.

144 {
145 Value result;
146 double norm = std::sqrt ( aDSS.a() * aDSS.a() + aDSS.b() * aDSS.b() );
147 result.second = lambdaFunctor ( (double)indexOfPointInDSS / (double)dssLen );
148 if ( norm > 0. )
149 {
150 result.first[0] = result.second * aDSS.b() / norm;
151 result.first[1] = result.second * aDSS.a() / norm;
152 }
153 else
154 {
155 result.first[0] = 0.;
156 result.first[1] = 0.;
157 }
158 return result;
159 }

References DGtal::TangentFromDSS2DFunctor< DSS, LambdaFunction >::lambdaFunctor.

Field Documentation

◆ lambdaFunctor

template<typename DSS , typename LambdaFunction >
LambdaFunction DGtal::TangentFromDSS2DFunctor< DSS, LambdaFunction >::lambdaFunctor
private

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