DGtal
0.6.devel
|
#include <GeometricalDCA.h>
Public Types | |
typedef TConstIterator | ConstIterator |
typedef GeometricalDCA < ConstIterator > | Self |
typedef GeometricalDCA < ReverseIterator < ConstIterator > > | Reverse |
typedef IteratorCirculatorTraits < ConstIterator >::Value | Pair |
typedef Pair::first_type | Point |
Public Member Functions | |
BOOST_STATIC_ASSERT ((ConceptUtils::SameType< typename Pair::first_type, typename Pair::second_type >::value)) | |
BOOST_STATIC_ASSERT ((Point::dimension==2)) | |
GeometricalDCA () | |
GeometricalDCA (const Self &other) | |
Self & | operator= (const Self &other) |
~GeometricalDCA () | |
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 |
bool | isStraight () const |
GeometricalDSSPtr | getGeometricalDSSPtr () const |
Circle | getSeparatingCircle () const |
void | init (const ConstIterator &anIt) |
bool | extendForward () |
bool | isExtendableForward () |
bool | extendBackward () |
bool | isExtendableBackward () |
void | selfDisplay (std::ostream &out) const |
std::string | className () const |
Private Types | |
typedef CowPtr< GeometricalDSS < ConstIterator > > | GeometricalDSSPtr |
typedef CircleFrom3Points< Point > | Circle |
typedef Point2ShapePredicate < Circle, false, true > | PInCirclePred |
typedef Point2ShapePredicate < Circle, true, true > | QInCirclePred |
Private Member Functions | |
template<typename TIterator > | |
bool | isCircularlySeparable (const TIterator &itb, const TIterator &ite, const Point &aPole, Point &Pf, Point &Pl, Point &Qf, Point &Ql) |
Private Attributes | |
ConstIterator | myBegin |
ConstIterator | myEnd |
GeometricalDSSPtr | mySegPtr |
Circle | myCircle |
bool | myFlagIsInit |
Aim: On-line recognition of a digital circular arcs (DCA) defined as a sequence of connected grid edges such that there is at least one (Euclidean) circle that separates the centers of the two incident pixels of each grid edge.
The algorithm iteratively calls a routine (isCircularlySeparable) that uses Preimage2D in order to compute the whole set of separating (Euclidean) circles passing through a given point. It returns 'false' if the set is empty and 'true' otherwise.
The algorithm may be divided into two steps:
For a DCA of \( n \) grid edges, a trivial upper bound of this algorithm is \( O(n^2) \) because the linear-time routine may be possibly called \( n \) times. But we observed in practice that the routine is called only a few times and that the algorithm is fast.
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 112 of file GeometricalDCA.h.
|
private |
Definition at line 133 of file GeometricalDCA.h.
typedef TConstIterator DGtal::GeometricalDCA< TConstIterator >::ConstIterator |
Definition at line 118 of file GeometricalDCA.h.
|
private |
Definition at line 132 of file GeometricalDCA.h.
typedef IteratorCirculatorTraits<ConstIterator>::Value DGtal::GeometricalDCA< TConstIterator >::Pair |
Definition at line 123 of file GeometricalDCA.h.
|
private |
Definition at line 137 of file GeometricalDCA.h.
typedef Pair::first_type DGtal::GeometricalDCA< TConstIterator >::Point |
Definition at line 126 of file GeometricalDCA.h.
|
private |
Definition at line 139 of file GeometricalDCA.h.
typedef GeometricalDCA<ReverseIterator<ConstIterator> > DGtal::GeometricalDCA< TConstIterator >::Reverse |
Definition at line 120 of file GeometricalDCA.h.
typedef GeometricalDCA<ConstIterator> DGtal::GeometricalDCA< TConstIterator >::Self |
Definition at line 119 of file GeometricalDCA.h.
|
inline |
|
inline |
Copy constructor.
other | the object to clone. |
Definition at line 51 of file GeometricalDCA.ih.
|
inline |
|
inline |
Definition at line 174 of file GeometricalDCA.ih.
Referenced by DGtal::Display2DFactory::draw().
DGtal::GeometricalDCA< TConstIterator >::BOOST_STATIC_ASSERT | ( | (ConceptUtils::SameType< typename Pair::first_type, typename Pair::second_type >::value) | ) |
DGtal::GeometricalDCA< TConstIterator >::BOOST_STATIC_ASSERT | ( | (Point::dimension==2) | ) |
|
inline |
Definition at line 623 of file GeometricalDCA.ih.
Referenced by DGtal::Display2DFactory::draw().
|
inline |
Definition at line 182 of file GeometricalDCA.ih.
Referenced by DGtal::Display2DFactory::draw().
|
inline |
Backward extension of the segment.
NB: linear in the size of the segment is the worst case
Definition at line 504 of file GeometricalDCA.ih.
|
inline |
Forward extension of the segment.
NB: linear in the size of the segment is the worst case
Definition at line 354 of file GeometricalDCA.ih.
|
inline |
Definition at line 198 of file GeometricalDCA.ih.
Referenced by DGtal::Display2DFactory::draw().
|
inline |
Definition at line 137 of file GeometricalDCA.ih.
|
inline |
Definition at line 146 of file GeometricalDCA.ih.
|
inline |
Definition at line 206 of file GeometricalDCA.ih.
Referenced by DGtal::Display2DFactory::draw().
|
inline |
Segment initialization
anIt | any iterator |
Definition at line 273 of file GeometricalDCA.ih.
References DGtal::GeometricalDCA< TConstIterator >::init().
Referenced by DGtal::GeometricalDCA< TConstIterator >::init().
|
inlineprivate |
Check if the two sets of points can be separated by circles passing through the given point aPole. If yes, return the four points of support of the partial preimage. The pole and either Pf and Ql or Qf and Pl implicitely describe a separating circle.
itb | begin iterator on STL pairs of 2D points. |
ite | end iterator on STL pairs of 2D points. |
aPole | the point the circles pass through. |
Pf | (returned) first inner point of support. |
Pl | (returned) last inner point of support. |
Qf | (returned) first outer point of support. |
Ql | (returned) last outer point of support. |
TIterator | type of iterator (normal or reverse type) |
Definition at line 218 of file GeometricalDCA.ih.
References DGtal::Preimage2D< Shape >::addBack(), DGtal::Preimage2D< Shape >::addFront(), DGtal::Preimage2D< Shape >::getLf(), DGtal::Preimage2D< Shape >::getLl(), DGtal::Preimage2D< Shape >::getUf(), and DGtal::Preimage2D< Shape >::getUl().
|
inline |
Backward extension test.
NB: linear in the size of the segment is the worst case
Definition at line 435 of file GeometricalDCA.ih.
|
inline |
Forward extension test.
NB: linear in the size of the segment is the worst case
Definition at line 293 of file GeometricalDCA.ih.
|
inline |
Definition at line 190 of file GeometricalDCA.ih.
Referenced by DGtal::Display2DFactory::draw().
|
inline |
Checks the validity/consistency of the object.
Definition at line 159 of file GeometricalDCA.ih.
References DGtal::GeometricalDCA< TConstIterator >::isValid().
Referenced by DGtal::Display2DFactory::draw(), DGtal::GeometricalDCA< TConstIterator >::isValid(), and DGtal::GeometricalDCA< TConstIterator >::operator==().
|
inline |
Difference operator
other | the object to compare with. |
NB: linear in the size of the segment
Definition at line 129 of file GeometricalDCA.ih.
|
inline |
Assignment.
other | the object to copy. |
Definition at line 60 of file GeometricalDCA.ih.
References DGtal::GeometricalDCA< TConstIterator >::myBegin, DGtal::GeometricalDCA< TConstIterator >::myCircle, DGtal::GeometricalDCA< TConstIterator >::myEnd, DGtal::GeometricalDCA< TConstIterator >::myFlagIsInit, and DGtal::GeometricalDCA< TConstIterator >::mySegPtr.
|
inline |
Equality operator
other | the object to compare with. |
NB: linear in the size of the segment
Definition at line 82 of file GeometricalDCA.ih.
References DGtal::GeometricalDCA< TConstIterator >::isValid(), DGtal::GeometricalDCA< TConstIterator >::myBegin, and DGtal::GeometricalDCA< TConstIterator >::myEnd.
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 596 of file GeometricalDCA.ih.
|
private |
segment begin iterator.
Definition at line 292 of file GeometricalDCA.h.
Referenced by DGtal::GeometricalDCA< TConstIterator >::operator=(), and DGtal::GeometricalDCA< TConstIterator >::operator==().
|
private |
Separating circle.
Definition at line 304 of file GeometricalDCA.h.
Referenced by DGtal::GeometricalDCA< TConstIterator >::operator=().
|
private |
segment end iterator.
Definition at line 296 of file GeometricalDCA.h.
Referenced by DGtal::GeometricalDCA< TConstIterator >::operator=(), and DGtal::GeometricalDCA< TConstIterator >::operator==().
|
private |
Flag equal to 'true' if mySegPtr has finished its extension 'false' otherwise.
Definition at line 309 of file GeometricalDCA.h.
Referenced by DGtal::GeometricalDCA< TConstIterator >::operator=().
|
private |
Pointer to the geometrical DSS.
Definition at line 300 of file GeometricalDCA.h.
Referenced by DGtal::GeometricalDCA< TConstIterator >::operator=().