DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::ContourHelper Class Reference

Aim: a helper class to process sequences of points. More...

#include <DGtal/geometry/helpers/ContourHelper.h>

Public Member Functions

 ~ContourHelper ()
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Static Public Member Functions

template<typename TPoint >
static DGtal::PointVector< TPoint::dimension, double > getBarycenter (const std::vector< TPoint > &aSet)
 
template<typename TPoint >
static bool isCounterClockWise (const std::vector< TPoint > &aCurve)
 
template<typename TIterator , typename TOutputIterator >
static void pixels2pixels8C (const TIterator &itb, const TIterator &ite, TOutputIterator out)
 

Protected Member Functions

 ContourHelper ()
 

Private Member Functions

 ContourHelper (const ContourHelper &other)
 
ContourHelperoperator= (const ContourHelper &other)
 

Detailed Description

Aim: a helper class to process sequences of points.

Description of class 'ContourHelper'

Todo
Improve class.

Definition at line 60 of file ContourHelper.h.

Constructor & Destructor Documentation

◆ ~ContourHelper()

DGtal::ContourHelper::~ContourHelper ( )

Destructor.

◆ ContourHelper() [1/2]

DGtal::ContourHelper::ContourHelper ( )
protected

Constructor. Forbidden by default (protected to avoid g++ warnings).

◆ ContourHelper() [2/2]

DGtal::ContourHelper::ContourHelper ( const ContourHelper & other)
private

Copy constructor.

Parameters
otherthe object to clone. Forbidden by default.

Member Function Documentation

◆ getBarycenter()

template<typename TPoint >
static DGtal::PointVector< TPoint::dimension, double > DGtal::ContourHelper::getBarycenter ( const std::vector< TPoint > & aSet)
static

Compute the barycenter of a set of points.

Parameters
[in]aSetthe vector containing the set of points.
Returns
the resulting mean point.

Referenced by testContourHelper().

◆ isCounterClockWise()

template<typename TPoint >
static bool DGtal::ContourHelper::isCounterClockWise ( const std::vector< TPoint > & aCurve)
static

Checks if a polygonal curve given as a sequence of point is clockwise oriented or not.

Parameters
[in]aCurvethe vector containing the 2D polygonal curve.
Returns
'true' if the polygonal curve is counter clockwise oriented, 'false' otherwise.

Referenced by testContourHelper().

◆ isValid()

bool DGtal::ContourHelper::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ operator=()

ContourHelper & DGtal::ContourHelper::operator= ( const ContourHelper & other)
private

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.

◆ pixels2pixels8C()

template<typename TIterator , typename TOutputIterator >
static void DGtal::ContourHelper::pixels2pixels8C ( const TIterator & itb,
const TIterator & ite,
TOutputIterator out )
static

Transforms an input contour into an 8 connected contour. The contour is given from two iterators on points. If the input sequence contains some points not 4-connected, they are are ignored but the transformation continues on the next parts of the contour.

Parameters
[in]itbbegin iterator associated to the input contour.
[in]iteend iterator associated to the input contour.
[out]outoutput iterator associated to the resulting contour.

Referenced by testContourHelper().

◆ selfDisplay()

void DGtal::ContourHelper::selfDisplay ( std::ostream & out) const

Writes/Displays the object on an output stream.

Parameters
[out]outthe output stream where the object is written.

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