DGtal  1.3.beta
SaturatedSegmentation.h
1 
17 #pragma once
18 
31 #if defined(SaturatedSegmentation_RECURSES)
32 #error Recursive header files inclusion detected in SaturatedSegmentation.h
33 #else // defined(SaturatedSegmentation_RECURSES)
34 
35 #define SaturatedSegmentation_RECURSES
36 
37 #if !defined SaturatedSegmentation_h
38 
39 #define SaturatedSegmentation_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 
46 #include "DGtal/geometry/curves/SegmentComputerUtils.h"
47 #include "DGtal/geometry/curves/CForwardSegmentComputer.h"
48 
50 
51 namespace DGtal
52 {
53 
55  // template class SaturatedSegmentation
152  template <typename TSegmentComputer>
154  {
155 
156  public:
157 
159  typedef TSegmentComputer SegmentComputer;
161 
162  private:
163 
164  typedef typename TSegmentComputer::Reverse ReverseSegmentComputer;
166 
167  // ----------------------- Standard services ------------------------------
168  public:
169 
170 
171 
173  // template class SegmentComputerIterator
180  {
181 
182  // ------------------------- inner Types -----------------------
183 
184  public:
187 
188  // ------------------------- data -----------------------
189  private:
190 
195 
200 
205 
214 
221 
228 
234 
235 
236 
237  // ------------------------- Standard services -----------------------
238  public:
239  friend class SaturatedSegmentation<TSegmentComputer>;
240 
241 
242 
252  const TSegmentComputer& aSegmentComputer,
253  const bool& aFlag );
254 
255 
261 
268 
273 
278  bool isValid() const { return myFlagIsValid; }
279 
280  // ------------------------- iteration services -------------------------
281  public:
282 
286  const SegmentComputer& operator*() const;
287 
291  SegmentComputer get() const;
292 
296  const SegmentComputer* operator->() const;
297 
305 
312  bool operator==( const SegmentComputerIterator & aOther ) const;
313 
320  bool operator!=( const SegmentComputerIterator & aOther ) const;
321 
322  // ----------------------- accessors --------------------------------------
323 
328  bool intersectNext() const;
329 
334  bool intersectPrevious() const;
335 
339  const ConstIterator begin() const;
340 
344  const ConstIterator end() const;
345 
346  // ----------------------- hidden services --------------------------------------
347 
348  private:
349 
350 
351 
360  bool doesIntersectNext(const ConstIterator& it,
361  const ConstIterator& itb, const ConstIterator& ite);
362  bool doesIntersectNext(const ConstIterator& it,
363  const ConstIterator& itb, const ConstIterator& ite, IteratorType);
364  bool doesIntersectNext(const ConstIterator& it,
365  const ConstIterator& itb, const ConstIterator& ite, CirculatorType);
366 
374  bool doesIntersectNext(const ConstIterator& it);
375 
379  void nextMaximalSegment();
380 
385 
389  void initLastMaximalSegment();
390 
391  };
392 
393  //-------------------------------------------------------------------------
394  // end class SegmentComputerIterator
395  //-------------------------------------------------------------------------
396 
397 
398  // ----------------------- Interface --------------------------------------
399  public:
400 
407 
415  const ConstIterator& ite,
416  const SegmentComputer& aSegmentComputer);
417 
425  void setSubRange(const ConstIterator& itb,
426  const ConstIterator& ite);
427 
428 
434  void setMode(const std::string& aMode);
435 
436 
441 
447 
453 
454 
459  void selfDisplay ( std::ostream & out ) const;
460 
465  bool isValid() const;
466 
467  // ------------------------- Protected Datas ------------------------------
468  private:
469  // ------------------------- Private Datas --------------------------------
470  private:
471 
476 
481 
486 
491 
495  std::string myMode;
496 
501 
502  // ------------------------- Hidden services ------------------------------
503 
504 
505  private:
506 
512 
519 
520  // ------------------------- Internals ------------------------------------
521  private:
522 
523  }; // end of class SaturatedSegmentation
524 
525 
532  template <typename SegmentComputer>
533  std::ostream&
534  operator<< ( std::ostream & out, const SaturatedSegmentation<SegmentComputer> & object );
535 
536 } // namespace DGtal
537 
538 
540 // Includes inline functions.
541 #include "DGtal/geometry/curves/SaturatedSegmentation.ih"
542 
543 // //
545 
546 #endif // !defined SaturatedSegmentation_h
547 
548 #undef SaturatedSegmentation_RECURSES
549 #endif // else defined(SaturatedSegmentation_RECURSES)
DGtal::SaturatedSegmentation::~SaturatedSegmentation
~SaturatedSegmentation()
DGtal::SaturatedSegmentation::SegmentComputerIterator::nextMaximalSegment
void nextMaximalSegment()
ConstIterator
MyDigitalSurface::ConstIterator ConstIterator
Definition: greedy-plane-segmentation-ex2.cpp:93
DGtal::SaturatedSegmentation::SegmentComputerIterator::operator==
bool operator==(const SegmentComputerIterator &aOther) const
SegmentComputer
ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 > SegmentComputer
Definition: testArithmeticalDSSComputerOnSurfels.cpp:55
DGtal::SaturatedSegmentation::myBegin
ConstIterator myBegin
Definition: SaturatedSegmentation.h:475
DGtal::SaturatedSegmentation::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CForwardSegmentComputer< TSegmentComputer >))
DGtal::SaturatedSegmentation::isValid
bool isValid() const
DGtal::SaturatedSegmentation::SegmentComputerIterator::myFlagIntersectNext
bool myFlagIntersectNext
Definition: SaturatedSegmentation.h:220
DGtal::SaturatedSegmentation::SegmentComputerIterator::SegmentComputerIterator
SegmentComputerIterator(const SaturatedSegmentation< TSegmentComputer > *aSegmentation, const TSegmentComputer &aSegmentComputer, const bool &aFlag)
DGtal::SaturatedSegmentation::SaturatedSegmentation
SaturatedSegmentation()
Definition: SaturatedSegmentation.h:406
DGtal::SaturatedSegmentation::end
SaturatedSegmentation::SegmentComputerIterator end() const
DGtal::SaturatedSegmentation::myStop
ConstIterator myStop
Definition: SaturatedSegmentation.h:490
DGtal::SaturatedSegmentation::setMode
void setMode(const std::string &aMode)
DGtal::SaturatedSegmentation::begin
SaturatedSegmentation::SegmentComputerIterator begin() const
DGtal::SaturatedSegmentation::SegmentComputerIterator::operator*
const SegmentComputer & operator*() const
DGtal::SaturatedSegmentation::SegmentComputerIterator::myLastMaximalSegmentEnd
ConstIterator myLastMaximalSegmentEnd
Definition: SaturatedSegmentation.h:213
DGtal::SaturatedSegmentation::operator=
SaturatedSegmentation & operator=(const SaturatedSegmentation &other)
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::SaturatedSegmentation::SegmentComputerIterator
Aim: Specific iterator to visit all the maximal segments of a saturated segmentation.
Definition: SaturatedSegmentation.h:179
DGtal::SaturatedSegmentation::SegmentComputerIterator::myFlagIntersectPrevious
bool myFlagIntersectPrevious
Definition: SaturatedSegmentation.h:227
DGtal::ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 >::ConstIterator
std::vector< Z2i::Point >::const_iterator ConstIterator
Definition: ArithmeticalDSSComputer.h:95
DGtal::SaturatedSegmentation::SegmentComputerIterator::get
SegmentComputer get() const
DGtal::SaturatedSegmentation::SegmentComputerIterator::operator!=
bool operator!=(const SegmentComputerIterator &aOther) const
DGtal::SaturatedSegmentation::SegmentComputerIterator::begin
const ConstIterator begin() const
DGtal::SaturatedSegmentation::SegmentComputerIterator::~SegmentComputerIterator
~SegmentComputerIterator()
DGtal::SaturatedSegmentation::SegmentComputerIterator::end
const ConstIterator end() const
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::SaturatedSegmentation::SegmentComputer
TSegmentComputer SegmentComputer
Definition: SaturatedSegmentation.h:159
DGtal::SaturatedSegmentation::setSubRange
void setSubRange(const ConstIterator &itb, const ConstIterator &ite)
DGtal::SaturatedSegmentation::SegmentComputerIterator::myFlagIsLast
bool myFlagIsLast
Definition: SaturatedSegmentation.h:233
DGtal::SaturatedSegmentation::SegmentComputerIterator::operator++
SegmentComputerIterator & operator++()
DGtal::SaturatedSegmentation::SegmentComputerIterator::myS
const SaturatedSegmentation< TSegmentComputer > * myS
Definition: SaturatedSegmentation.h:194
DGtal::SaturatedSegmentation::SegmentComputerIterator::operator=
SegmentComputerIterator & operator=(const SegmentComputerIterator &aOther)
DGtal::SaturatedSegmentation::SegmentComputerIterator::myLastMaximalSegmentBegin
ConstIterator myLastMaximalSegmentBegin
Definition: SaturatedSegmentation.h:209
DGtal::SaturatedSegmentation::SegmentComputerIterator::SegmentComputer
SaturatedSegmentation::SegmentComputer SegmentComputer
Definition: SaturatedSegmentation.h:185
DGtal::SaturatedSegmentation::myStart
ConstIterator myStart
Definition: SaturatedSegmentation.h:485
DGtal::CirculatorType
Definition: IteratorCirculatorTraits.h:52
DGtal::SaturatedSegmentation::ReverseSegmentComputer
TSegmentComputer::Reverse ReverseSegmentComputer
Definition: SaturatedSegmentation.h:164
DGtal::SaturatedSegmentation::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::SaturatedSegmentation::SegmentComputerIterator::initFirstMaximalSegment
void initFirstMaximalSegment()
DGtal::concepts::CForwardSegmentComputer
Aim: Defines the concept describing a forward segment computer. Like any model of CIncrementalSegment...
Definition: CForwardSegmentComputer.h:101
DGtal::IteratorType
Definition: IteratorCirculatorTraits.h:51
DGtal::SaturatedSegmentation::myEnd
ConstIterator myEnd
Definition: SaturatedSegmentation.h:480
DGtal::SaturatedSegmentation::ConstReverseIterator
ReverseSegmentComputer::ConstIterator ConstReverseIterator
Definition: SaturatedSegmentation.h:165
DGtal::SaturatedSegmentation::ConstIterator
SegmentComputer::ConstIterator ConstIterator
Definition: SaturatedSegmentation.h:160
DGtal::SaturatedSegmentation::SegmentComputerIterator::isValid
bool isValid() const
Definition: SaturatedSegmentation.h:278
DGtal::SaturatedSegmentation::SegmentComputerIterator::ConstIterator
SegmentComputer::ConstIterator ConstIterator
Definition: SaturatedSegmentation.h:186
DGtal::SaturatedSegmentation::SegmentComputerIterator::intersectPrevious
bool intersectPrevious() const
DGtal::SaturatedSegmentation
Aim: Computes the saturated segmentation, that is the whole set of maximal segments within a range gi...
Definition: SaturatedSegmentation.h:153
DGtal::SaturatedSegmentation::SegmentComputerIterator::intersectNext
bool intersectNext() const
DGtal::SaturatedSegmentation::mySegmentComputer
SegmentComputer mySegmentComputer
Definition: SaturatedSegmentation.h:500
DGtal::SaturatedSegmentation::myMode
std::string myMode
Definition: SaturatedSegmentation.h:495
DGtal::SaturatedSegmentation::SegmentComputerIterator::mySegmentComputer
SegmentComputer mySegmentComputer
Definition: SaturatedSegmentation.h:199
DGtal::SaturatedSegmentation::SegmentComputerIterator::operator->
const SegmentComputer * operator->() const
DGtal::SaturatedSegmentation::SegmentComputerIterator::myFlagIsValid
bool myFlagIsValid
Definition: SaturatedSegmentation.h:204
DGtal::SaturatedSegmentation::SegmentComputerIterator::doesIntersectNext
bool doesIntersectNext(const ConstIterator &it, const ConstIterator &itb, const ConstIterator &ite)
DGtal::SaturatedSegmentation::SegmentComputerIterator::initLastMaximalSegment
void initLastMaximalSegment()