DGtal
0.6.devel
|
#include <GeometricalDSS.h>
Public Types | |
typedef TConstIterator | ConstIterator |
typedef GeometricalDSS < ConstIterator > | Self |
typedef GeometricalDSS < ReverseIterator < ConstIterator > > | Reverse |
typedef IteratorCirculatorTraits < ConstIterator >::Value | Pair |
typedef Pair::first_type | Point |
typedef StraightLineFrom2Points< Point > | StraightLine |
typedef Preimage2D< StraightLine > | Preimage |
typedef CowPtr< Preimage > | PreimagePtr |
Public Member Functions | |
BOOST_STATIC_ASSERT ((ConceptUtils::SameType< typename Pair::first_type, typename Pair::second_type >::value)) | |
GeometricalDSS () | |
GeometricalDSS (const Self &other) | |
Self & | operator= (const Self &other) |
~GeometricalDSS () | |
bool | operator== (const Self &other) const |
bool | operator!= (const Self &other) const |
Self | getSelf () const |
Reverse | getReverse () const |
bool | isValid () const |
ConstIterator | begin () const |
ConstIterator | end () const |
Point | getUf () const |
Point | getUl () const |
Point | getLf () const |
Point | getLl () const |
bool | isClockwiseOriented () const |
void | getParameters (double &alpha, double &beta, double &gamma) const |
void | projects (double &x, double &y, const double &alpha, const double &beta, const double &gamma) const |
void | init (const ConstIterator &anIt) |
bool | extendForward () |
bool | isExtendableForward () |
bool | isConcave () |
bool | isConvex () |
bool | extendBackward () |
bool | isExtendableBackward () |
bool | isOppositeEndConcave () |
bool | isOppositeEndConvex () |
void | selfDisplay (std::ostream &out) const |
std::string | className () const |
Private Attributes | |
ConstIterator | myBegin |
ConstIterator | myEnd |
PreimagePtr | myPreimagePtr |
bool | myFlagIsInit |
bool | myFlagIsCW |
Aim: On-line recognition of a digital straight segment (DSS) defined as a sequence of connected grid edges such that there is at least one straight line that separates the centers of the two incident pixels of each grid edge.
The algorithm computes and maintains the preimage of the whole set of separating straight lines in linear time using Preimage2D and the algorithm of O'Rourke (1981).
This class is a model of the concept CBidirectionalSegmentComputer.
It should be used with the Curve object (defined in StdDefs.h) and its IncidentPointsRange as follows:
TConstIterator | ConstIterator type on STL pairs of 2D points |
Definition at line 92 of file GeometricalDSS.h.
typedef TConstIterator DGtal::GeometricalDSS< TConstIterator >::ConstIterator |
Definition at line 98 of file GeometricalDSS.h.
typedef IteratorCirculatorTraits<ConstIterator>::Value DGtal::GeometricalDSS< TConstIterator >::Pair |
Definition at line 103 of file GeometricalDSS.h.
typedef Pair::first_type DGtal::GeometricalDSS< TConstIterator >::Point |
Definition at line 104 of file GeometricalDSS.h.
typedef Preimage2D<StraightLine> DGtal::GeometricalDSS< TConstIterator >::Preimage |
Definition at line 113 of file GeometricalDSS.h.
typedef CowPtr<Preimage> DGtal::GeometricalDSS< TConstIterator >::PreimagePtr |
Definition at line 114 of file GeometricalDSS.h.
typedef GeometricalDSS<ReverseIterator<ConstIterator> > DGtal::GeometricalDSS< TConstIterator >::Reverse |
Definition at line 100 of file GeometricalDSS.h.
typedef GeometricalDSS<ConstIterator> DGtal::GeometricalDSS< TConstIterator >::Self |
Definition at line 99 of file GeometricalDSS.h.
typedef StraightLineFrom2Points<Point> DGtal::GeometricalDSS< TConstIterator >::StraightLine |
Definition at line 112 of file GeometricalDSS.h.
|
inline |
|
inline |
Copy constructor.
other | the object to clone. |
Definition at line 50 of file GeometricalDSS.ih.
|
inline |
|
inline |
Definition at line 160 of file GeometricalDSS.ih.
Referenced by DGtal::Display2DFactory::draw().
DGtal::GeometricalDSS< TConstIterator >::BOOST_STATIC_ASSERT | ( | (ConceptUtils::SameType< typename Pair::first_type, typename Pair::second_type >::value) | ) |
|
inline |
Default drawing style object.
Definition at line 517 of file GeometricalDSS.ih.
|
inline |
Definition at line 168 of file GeometricalDSS.ih.
Referenced by DGtal::Display2DFactory::draw().
|
inline |
Backward extension of the segment.
Definition at line 448 of file GeometricalDSS.ih.
|
inline |
Forward extension of the segment.
Definition at line 379 of file GeometricalDSS.ih.
|
inline |
Definition at line 194 of file GeometricalDSS.ih.
|
inline |
Definition at line 203 of file GeometricalDSS.ih.
|
inline |
Get the parameters of one separating straight line
alpha | (returned) x-component of the normal |
beta | (returned) y-component of the normal |
gamma | (returned) intercept |
Definition at line 221 of file GeometricalDSS.ih.
Referenced by DGtal::Display2DFactory::draw().
|
inline |
Definition at line 123 of file GeometricalDSS.ih.
|
inline |
Definition at line 132 of file GeometricalDSS.ih.
|
inline |
Definition at line 176 of file GeometricalDSS.ih.
|
inline |
Definition at line 185 of file GeometricalDSS.ih.
|
inline |
|
inline |
Definition at line 212 of file GeometricalDSS.ih.
|
inline |
Decide whether the extension of the segment would result in a concave part or not.
NB: a true returned value implies that isExtendableForward() returns 'false'
Definition at line 258 of file GeometricalDSS.ih.
|
inline |
Decide whether the extension of the segment would result in a convex part or not.
NB: a true returned value implies that isExtendableForward() returns 'false'
Definition at line 280 of file GeometricalDSS.ih.
|
inline |
Backward extension test.
Definition at line 418 of file GeometricalDSS.ih.
|
inline |
Forward extension test.
Definition at line 351 of file GeometricalDSS.ih.
|
inline |
Decide whether the extension of the segment would result in a concave part or not.
NB: a true returned value implies that isExtendableBackward() returns 'false'
Definition at line 302 of file GeometricalDSS.ih.
|
inline |
Decide whether the extension of the segment would result in a convex part or not.
NB: a true returned value implies that isExtendableBackward() returns 'false'
Definition at line 326 of file GeometricalDSS.ih.
|
inline |
Checks the validity/consistency of the object.
Definition at line 145 of file GeometricalDSS.ih.
References DGtal::GeometricalDSS< TConstIterator >::isValid().
Referenced by DGtal::GeometricalDSS< TConstIterator >::isValid(), and DGtal::GeometricalDSS< TConstIterator >::operator==().
|
inline |
Difference operator
other | the object to compare with. |
Definition at line 115 of file GeometricalDSS.ih.
|
inline |
Assignment.
other | the object to copy. |
Definition at line 59 of file GeometricalDSS.ih.
References DGtal::GeometricalDSS< TConstIterator >::myBegin, DGtal::GeometricalDSS< TConstIterator >::myEnd, DGtal::GeometricalDSS< TConstIterator >::myFlagIsCW, DGtal::GeometricalDSS< TConstIterator >::myFlagIsInit, and DGtal::GeometricalDSS< TConstIterator >::myPreimagePtr.
|
inline |
Equality operator
other | the object to compare with. |
Definition at line 81 of file GeometricalDSS.ih.
References DGtal::GeometricalDSS< TConstIterator >::isValid(), DGtal::GeometricalDSS< TConstIterator >::myBegin, DGtal::GeometricalDSS< TConstIterator >::myEnd, and DGtal::GeometricalDSS< TConstIterator >::myPreimagePtr.
|
inline |
Projects the point ( x , y ) onto the straight line of parameters ( alpha , beta , gamma )
x | (returned) x-coordinate of the point |
y | (returned) y-coordinate of the point |
alpha | x-component of the direction vector |
beta | y-component of the direction vector |
gamma | intercept |
Definition at line 230 of file GeometricalDSS.ih.
Referenced by DGtal::Display2DFactory::draw().
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 492 of file GeometricalDSS.ih.
|
private |
segment begin iterator.
Definition at line 342 of file GeometricalDSS.h.
Referenced by DGtal::GeometricalDSS< TConstIterator >::operator=(), and DGtal::GeometricalDSS< TConstIterator >::operator==().
|
private |
segment end iterator.
Definition at line 346 of file GeometricalDSS.h.
Referenced by DGtal::GeometricalDSS< TConstIterator >::operator=(), and DGtal::GeometricalDSS< TConstIterator >::operator==().
|
private |
Flag equal to 'true' if the pairs of points are clockwise oriented, 'false' otherwise.
Definition at line 360 of file GeometricalDSS.h.
Referenced by DGtal::GeometricalDSS< TConstIterator >::operator=().
|
private |
Flag equal to 'true' if the segment contains at least two pairs (the orientation is known) and 'false' otherwise.
Definition at line 355 of file GeometricalDSS.h.
Referenced by DGtal::GeometricalDSS< TConstIterator >::operator=().
|
private |
Pointer to the preimage.
Definition at line 350 of file GeometricalDSS.h.
Referenced by DGtal::GeometricalDSS< TConstIterator >::operator=(), and DGtal::GeometricalDSS< TConstIterator >::operator==().