DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Data Structures | Public Types | Public Member Functions | Private Member Functions | Private Attributes
DGtal::deprecated::MaximalSegments< TSegment > Class Template Reference

#include <MaximalSegments.h>

Inheritance diagram for DGtal::deprecated::MaximalSegments< TSegment >:
Inheritance graph
[legend]

Data Structures

class  SegmentIterator

Public Types

typedef TSegment Segment
typedef TSegment::Reverse ReverseSegment
typedef TSegment::ConstIterator Iterator
typedef
ReverseSegment::ConstIterator 
ReverseIterator

Public Member Functions

 MaximalSegments ()
 MaximalSegments (const Iterator &beginIt, const Iterator &endIt, const Segment &aSegment, const bool &aFlag)
void init (const Iterator &beginIt, const Iterator &endIt, const Segment &aSegment, const bool &aFlag)
 ~MaximalSegments ()
MaximalSegments::SegmentIterator begin ()
MaximalSegments::SegmentIterator end ()
void selfDisplay (std::ostream &out) const
bool isValid () const

Private Member Functions

 MaximalSegments (const MaximalSegments &other)
MaximalSegmentsoperator= (const MaximalSegments &other)

Private Attributes

Iterator myBegin
Iterator myEnd
Iterator myFirstMaximalSegmentBack
Segment mySegment
bool isClosed

Detailed Description

template<typename TSegment>
class DGtal::deprecated::MaximalSegments< TSegment >

Aim: Computes the set of maximal segments of a sequence. Maximal segments are segments that cannot be included in other segments. This class is a model of CDecomposition.

Warning:
This class is deprecated since SaturatedSegmentation has been created. This class is however used now in testMaximalSegments.cpp , MostCenteredMaximalSegmentEstimator.h and displayContours.cpp

Description of template class 'MaximalSegments'

This class is templated by 'TSegment', a model of CBidirectionnalSegmentComputer, i.e. an object that is able to manage the on-line recognition of a given class of segments (4-connected DSS, 8-connected DSS, thick segment, etc.) 'TSegment' must have an internal type 'Iterator' that is a means of of accessing the sequence elements. 'TSegment' must have the methods init(), extendForward() and extendBackward(), taking an input parameter of type 'Iterator'. The last two methods must return a boolean equal to TRUE if the extension is possible and has been successfully performed and FALSE otherwise.

In the short example below, the parameters of the maximal 8-connected DSSs of a sequence stored in a STL vector are sent to the standard output. The set of maximal DSSs of a sequence is also called tangential cover.

//types definition
typedef PointVector<2,int> Point;
typedef std::vector<Point> Sequence;
typedef Sequence::iterator Iterator;
typedef ArithmeticalDSS<Iterator,int,8> DSSComputer;
typedef MaximalSegments<DSS> Cover;
//sequence of input points
Sequence curve;
curve.push_back(Point(1,1));
curve.push_back(Point(2,1));
curve.push_back(Point(3,2));
curve.push_back(Point(4,2));
curve.push_back(Point(5,2));
curve.push_back(Point(6,2));
curve.push_back(Point(7,2));
curve.push_back(Point(8,1));
curve.push_back(Point(9,1));
//Segmentation
DSSComputer algo;
Cover theCover(curve.begin(), curve.end(), algo, false);
Cover::SegmentIterator i = theCover.begin();
for ( ; i != theCover.end(); ++i) {
DSS currentSegment(*i);
trace.info() << currentSegment << std::endl; //standard output
}

Definition at line 109 of file MaximalSegments.h.


Member Typedef Documentation

template<typename TSegment>
typedef TSegment::ConstIterator DGtal::deprecated::MaximalSegments< TSegment >::Iterator

Definition at line 116 of file MaximalSegments.h.

template<typename TSegment>
typedef ReverseSegment::ConstIterator DGtal::deprecated::MaximalSegments< TSegment >::ReverseIterator

Definition at line 117 of file MaximalSegments.h.

template<typename TSegment>
typedef TSegment::Reverse DGtal::deprecated::MaximalSegments< TSegment >::ReverseSegment

Definition at line 115 of file MaximalSegments.h.

template<typename TSegment>
typedef TSegment DGtal::deprecated::MaximalSegments< TSegment >::Segment

Definition at line 114 of file MaximalSegments.h.


Constructor & Destructor Documentation

template<typename TSegment>
DGtal::deprecated::MaximalSegments< TSegment >::MaximalSegments ( )
inline

Default constructor.

Definition at line 347 of file MaximalSegments.h.

{};
template<typename TSegment >
DGtal::deprecated::MaximalSegments< TSegment >::MaximalSegments ( const Iterator aBegin,
const Iterator aEnd,
const Segment aSegment,
const bool &  aFlag 
)

Constructor. Nb: The sequence is processed as a closed one by default.

Parameters:
begin,beginiterator on a sequence
end,enditerator on a sequence
aSegment,asegment computer
aFlaga boolean equal to TRUE to decompose the digital curve as a closed one, FALSE otherwise

Constructor.

Definition at line 469 of file MaximalSegments.ih.

: myBegin(aBegin),
myEnd(aEnd),
mySegment(aSegment),
isClosed(aFlag)
{
}
template<typename TSegment >
DGtal::deprecated::MaximalSegments< TSegment >::~MaximalSegments ( )
inline

Destructor.

Definition at line 507 of file MaximalSegments.ih.

{
}
template<typename TSegment>
DGtal::deprecated::MaximalSegments< TSegment >::MaximalSegments ( const MaximalSegments< TSegment > &  other)
private

Copy constructor.

Parameters:
otherthe object to clone.

Member Function Documentation

template<typename TSegment >
DGtal::deprecated::MaximalSegments< TSegment >::SegmentIterator DGtal::deprecated::MaximalSegments< TSegment >::begin ( )
inline

Iterator service.

Returns:
an iterator pointing on the first segment of a sequence.

Iterator service.

Returns:
an iterator pointing on the first maximal segment of the sequence.

Definition at line 519 of file MaximalSegments.ih.

Referenced by DGtal::deprecated::MaximalSegments< TSegment >::SegmentIterator::extensionInLoop().

{
return SegmentIterator(this, myBegin, mySegment);
}
template<typename TSegment >
DGtal::deprecated::MaximalSegments< TSegment >::SegmentIterator DGtal::deprecated::MaximalSegments< TSegment >::end ( )
inline

Iterator service.

Returns:
an iterator pointing after the last segment of a sequence.

Iterator service.

Returns:
an iterator pointing after the last maximal segment of the sequence.

Definition at line 532 of file MaximalSegments.ih.

{
return SegmentIterator(this, myEnd, mySegment);
}
template<typename TSegment >
void DGtal::deprecated::MaximalSegments< TSegment >::init ( const Iterator aBegin,
const Iterator aEnd,
const Segment aSegment,
const bool &  aFlag 
)
inline

Init. Nb: The sequence is processed as a closed one by default.

Parameters:
begin,beginiterator on a sequence
end,enditerator on a sequence
aSegment,asegment computer
aFlaga boolean equal to TRUE to decompose the digital curve as a closed one, FALSE otherwise

Init.

Definition at line 488 of file MaximalSegments.ih.

{
myBegin = aBegin;
myEnd = aEnd;
mySegment = aSegment;
isClosed = aFlag;
}
template<typename TSegment >
bool DGtal::deprecated::MaximalSegments< TSegment >::isValid ( ) const
inline

Checks the validity/consistency of the object.

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

Definition at line 557 of file MaximalSegments.ih.

{
return true;
}
template<typename TSegment>
MaximalSegments& DGtal::deprecated::MaximalSegments< TSegment >::operator= ( const MaximalSegments< TSegment > &  other)
private

Assignment.

Parameters:
otherthe object to copy.
Returns:
a reference on 'this'.
template<typename TSegment >
void DGtal::deprecated::MaximalSegments< TSegment >::selfDisplay ( std::ostream &  out) const
inline

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.

Definition at line 545 of file MaximalSegments.ih.

{
out << "[MaximalSegments]";
}

Field Documentation

template<typename TSegment>
bool DGtal::deprecated::MaximalSegments< TSegment >::isClosed
private

boolean equal to TRUE if the sequence has to be processed as closed, FALSE otherwise

Definition at line 438 of file MaximalSegments.h.

template<typename TSegment>
Iterator DGtal::deprecated::MaximalSegments< TSegment >::myBegin
private

begin iterator (pointing at the first element)

Definition at line 416 of file MaximalSegments.h.

template<typename TSegment>
Iterator DGtal::deprecated::MaximalSegments< TSegment >::myEnd
private

end iterator (pointing after the last element)

Definition at line 421 of file MaximalSegments.h.

Referenced by DGtal::deprecated::MaximalSegments< TSegment >::SegmentIterator::SegmentIterator().

template<typename TSegment>
Iterator DGtal::deprecated::MaximalSegments< TSegment >::myFirstMaximalSegmentBack
private

back iterator (first element) of the first maximal segment

Definition at line 427 of file MaximalSegments.h.

template<typename TSegment>
Segment DGtal::deprecated::MaximalSegments< TSegment >::mySegment
private

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