girl::path Class Reference

Discrete path class. More...

#include <girl/girlPath.hpp>


Public Member Functions

 path (const girl::point &startPt=girl::point(0, 0))
 Default constructor.
 path (const girl::point &startPt, const std::deque< girl::direction > &dirs)
 Constructor.
 path (const girl::point &startPt, const girl::point &endPt, const std::deque< girl::direction > &dirs)
 Constructor.
 path (const girl::contour &c)
 Constructor.
void set (const girl::point &startPt, const std::deque< girl::direction > &dirs)
 Set path from a starting point startPt and a deque of directions dirs.
void set (const girl::point &startPt, const girl::point &endPt, const std::deque< girl::direction > &dirs)
 Set path from a starting point startPt ending at endPt, and with directions dirs.
bool isClosed () const
 Checks if path self is closed, that is start point and end point are equal.
girl::point startPt () const
 Gives starting point of path self.
girl::point endPt () const
 Gives end point of path self.
size_t length () const
 Path length, i.e. number of directions.
bool isValid () const
 Tells if the freemanCodePath is valid. that is two succesive directions are not in opposite way.
bool operator== (const path &o)
 equality operator
bool operator!= (const path &o)
 inequality operator
void invertOrientation ()
 Inverts orientation of freemanCodePath.
void add (girl::direction d)
 Adds a direction d to the end of path.
void append (const girl::path &p)
 Appends direction of path p.
void move (const girl::point &newStartPt)
 Moves starting point to new point newStartPt.
void crop (size_t startIndex, size_t length)
 Crop path to keep only length directions after the startIndex first directions.


Detailed Description

Discrete path class.

Constructor & Destructor Documentation

girl::path::path ( const girl::point startPt = girl::point(0, 0)  )  [inline]

Default constructor.

Constructs a path of length 0 starting and ending at startPt.

References isValid().

girl::path::path ( const girl::point startPt,
const std::deque< girl::direction > &  dirs 
)

Constructor.

Construct a path from a starting point startPt and a deque of directions dirs.

girl::path::path ( const girl::point startPt,
const girl::point endPt,
const std::deque< girl::direction > &  dirs 
) [inline]

Constructor.

Construct a path from a starting point startPt, ending at endPt, and with directions dirs.

Warning:
endPt must be the right end point, starting from startPt and following directions of dirs, else results are undefined.

girl::path::path ( const girl::contour c  )  [inline]

Constructor.

Construct a path from a contour.


Member Function Documentation

void girl::path::add ( girl::direction  d  ) 

Adds a direction d to the end of path.

End point is modified accordingly.

void girl::path::crop ( size_t  startIndex,
size_t  length 
)

Crop path to keep only length directions after the startIndex first directions.

We must have startIndex+length<=length().

void girl::path::invertOrientation (  ) 

Inverts orientation of freemanCodePath.

For example, a freemanCodePath with four directions Right, Up, Left, and Down, will be changed to Up, Right, Down, and Left.

start and end points are swaped.

size_t girl::path::length (  )  const [inline]

Path length, i.e. number of directions.

O(1).

void girl::path::move ( const girl::point newStartPt  ) 

Moves starting point to new point newStartPt.

End point is modified accordingly.

void girl::path::set ( const girl::point startPt,
const girl::point endPt,
const std::deque< girl::direction > &  dirs 
) [inline]

Set path from a starting point startPt ending at endPt, and with directions dirs.

Warning:
endPt must be the right end point, starting from startPt and following directions of dirs, else results are undefined.

References isValid(), and set().


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

Generated on Thu Jun 4 14:30:33 2009 for GIRL: General Image Representation Library by  doxygen 1.5.7.1