34 #if defined(SegmentComputerUtils_RECURSES)
35 #error Recursive header files inclusion detected in SegmentComputerUtils.h
38 #define SegmentComputerUtils_RECURSES
40 #if !defined SegmentComputerUtils_h
42 #define SegmentComputerUtils_h
45 #include "DGtal/base/Circulator.h"
70 template <
typename SC>
121 template<
typename IC>
131 unsigned int k = c/2;
150 template<
typename IC>
163 template <
typename SC>
166 while ( (s.end() != end)
167 && (s.extendFront()) ) {}
173 template <
typename SC>
178 while ( (s.extendFront())
179 && (s.end() != newEnd) ) {}
187 template <
typename SC>
197 template <
typename SC>
200 while ( (s.begin() != begin)
201 && (s.extendBack()) ) {}
202 if (s.begin() == begin) s.extendBack();
208 template <
typename SC>
211 boost::ignore_unused_variable_warning( begin );
214 while ( (s.extendBack())
215 && (s.begin() != newBegin) ) {}
224 template <
typename SC>
235 template <
typename SC>
242 bool flagForward =
true;
248 if ( s.end() != end ) flagOk = s.extendFront();
252 if ( s.begin() != begin ) flagOk = s.extendBack();
257 if (s.begin() != begin ) {
258 if (s.extendBack())
return !s.extendFront();
269 template <
typename SC>
275 boost::ignore_unused_variable_warning( begin );
276 boost::ignore_unused_variable_warning( end );
279 bool flagForward =
true;
282 while ( (flagOk) && ( s.end() != s.begin() ) ) {
285 flagOk = s.extendFront();
288 flagOk = s.extendBack();
304 template <
typename SC>
322 template <
typename SC>
325 if ( isNotEmpty<typename SC::ConstIterator>(s.end(),end) ) {
326 while ( (! s.isExtendableFront() )
327 &&(s.retractBack() ) ) {}
329 while ( s.retractBack() ) {}
340 template <
typename SC>
343 if ( isNotEmpty<typename SC::ConstIterator>(s.begin(),begin) ) {
344 while ( (! s.isExtendableBack() )
345 &&(s.retractFront() ) ) {}
347 while ( s.retractFront() ) {}
358 template <
typename SC>
373 template <
typename SC>
390 template <
typename SC>
411 template <
typename SC>
420 typedef typename SC::Reverse ReverseSegmentComputer;
423 if ( isNotEmpty<ConstIterator>(i,end) ) {
427 ConstReverseIterator rit( it );
428 ConstReverseIterator rend( begin );
429 ReverseSegmentComputer r( s.getReverse() );
448 template <
typename SC>
470 template <
typename SC>
489 template <
typename SC>
507 template <
typename SC>
513 firstMaximalSegment<SC>(s, i, begin, end,
528 template <
typename SC>
537 typedef typename SC::Reverse ReverseSegmentComputer;
550 if ( isNotEmpty<ConstIterator>(s.end(),end) ) {
554 ConstReverseIterator rit( it );
555 ConstReverseIterator rend( s.begin() );
556 ReverseSegmentComputer r( s.getReverse() );
559 ASSERT( newBegin != s.begin() );
586 template <
typename SC>
622 template <
typename SC>
641 template <
typename SC>
659 template <
typename SC>
665 mostCenteredMaximalSegment<SC>(s, i, begin, end,
680 template <
typename SC>
689 typedef typename SC::Reverse ReverseSegmentComputer;
698 ConstReverseIterator rit( it );
699 ConstReverseIterator rend( begin );
700 ReverseSegmentComputer r( s.getReverse() );
716 template <
typename SC>
738 template <
typename SC>
757 template <
typename SC>
775 template <
typename SC>
781 lastMaximalSegment<SC>(s, i, begin, end,
796 template <
typename SC>
812 template <
typename SC>
827 template <
typename SC>
841 if ( i == s.end() ) {
842 if ( isNotEmpty<ConstIterator>(i, end) ) {
860 template <
typename SC>
875 template <
typename SC>
879 nextMaximalSegment<SC>(s, end,
894 template <
typename SC>
899 if ( isNotEmpty<typename SC::ConstIterator>(s.begin(),begin) )
911 template <
typename SC>
916 if ( isNotEmpty<typename SC::ConstIterator>(s.begin(),begin) )
927 template <
typename SC>
942 if ( i == s.begin() ) {
943 if ( isNotEmpty<ConstIterator>(i, begin) ) {
962 template <
typename SC>
977 template <
typename SC>
994 #undef SegmentComputerUtils_RECURSES
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.
void oppositeEndMaximalRetraction(SC &s, const typename SC::ConstIterator &begin)
void lastMaximalSegment(SC &s, const typename SC::ConstIterator &i, const typename SC::ConstIterator &begin, const typename SC::ConstIterator &end, DGtal::ForwardSegmentComputer)
void mostCenteredMaximalSegment(SC &s, const typename SC::ConstIterator &i, const typename SC::ConstIterator &begin, const typename SC::ConstIterator &end, DGtal::ForwardSegmentComputer)
void longestSegment(SC &s, const typename SC::ConstIterator &i, const typename SC::ConstIterator &end, IteratorType)
void oppositeEndMaximalExtension(SC &s, const typename SC::ConstIterator &begin, IteratorType)
void maximalExtension(SC &s, const typename SC::ConstIterator &end, IteratorType)
bool isNotEmpty(const IC &itb, const IC &ite)
IC getMiddleIterator(const IC &itb, const IC &ite, RandomAccessCategory)
void nextMaximalSegment(SC &s, const typename SC::ConstIterator &end, DGtal::ForwardSegmentComputer)
void maximalRetraction(SC &s, const typename SC::ConstIterator &end)
bool maximalSymmetricExtension(SC &s, const typename SC::ConstIterator &begin, const typename SC::ConstIterator &end, IteratorType)
void previousMaximalSegment(SC &s, const typename SC::ConstIterator &begin, DGtal::ForwardSegmentComputer)
void firstMaximalSegment(SC &s, const typename SC::ConstIterator &i, const typename SC::ConstIterator &begin, const typename SC::ConstIterator &end, DGtal::ForwardSegmentComputer)
ToDGtalCategory< typename boost::iterator_category< IC >::type >::Category Category
Aim: Provides the category of the segment computer {ForwardSegmentComputer,BidirectionalSegmentComp...
ForwardSegmentComputer Category