GJK_nD
 All Classes Files Functions Typedefs Friends Pages
Public Types | Public Member Functions | Friends | List of all members
DLL::Segment< DLL_Model > Class Template Reference

Represents a potentially growable piece of DLL (wrt. DLL_Model). More...

#include <Segment.hpp>

Public Types

typedef std::pair< size_t, size_t > Coordinates
 The coordinates type of each pixel of the curve. More...
 
typedef std::vector< CoordinatesCurve
 The type of a curve. More...
 

Public Member Functions

 Segment ()
 
bool addPoint (const Coordinates &xy)
 
bool isValid () const
 
const CurvegetCurve () const
 

Friends

template<typename U >
std::ostream & operator<< (std::ostream &out, const Segment< U > &dll)
 

Detailed Description

template<typename DLL_Model>
class DLL::Segment< DLL_Model >

Represents a potentially growable piece of DLL (wrt. DLL_Model).

The Segment class represents a piece of a 8-connected DLL that can incrementaly grow by addition of points. At the same time, 4-connected neigbhors of the segment's points are marked as forbidden points and must stay out of the DLL.

Template Parameters
DLL_Modelthe underlying DLL type of the segment. It must provide:

Member Typedef Documentation

template<typename DLL_Model >
typedef std::pair<size_t, size_t> DLL::Segment< DLL_Model >::Coordinates

The coordinates type of each pixel of the curve.

template<typename DLL_Model >
typedef std::vector<Coordinates> DLL::Segment< DLL_Model >::Curve

The type of a curve.

Constructor & Destructor Documentation

template<typename DLL_Model >
DLL::Segment< DLL_Model >::Segment ( )
inline

Construct an empty Segment, not yet valid, but growable.

Member Function Documentation

template<typename DLL_Model >
bool DLL::Segment< DLL_Model >::addPoint ( const Coordinates xy)

Add the point xy to the current segment and implicitely update the set of forbidden points of the underlying DLL.

Returns
true if we can continue to add points to the segment and false otherwise
template<typename DLL_Model >
const Curve& DLL::Segment< DLL_Model >::getCurve ( ) const
inline

Return the set of points that compose the segment.

template<typename DLL_Model >
bool DLL::Segment< DLL_Model >::isValid ( ) const
inline

Return true if the segments (i.e. this piece of DLL) is valid and false otherwise (i.e. the DLL does not contains more than 2 points).

Friends And Related Function Documentation

template<typename DLL_Model >
template<typename U >
std::ostream& operator<< ( std::ostream &  out,
const Segment< U > &  dll 
)
friend

Print the characteristics of the dll segment on the out stream.


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