DGtal  1.5.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)
35 #define SaturatedSegmentation_RECURSES
36 
37 #if !defined SaturatedSegmentation_h
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 
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 
361  const ConstIterator& itb, const ConstIterator& ite);
363  const ConstIterator& itb, const ConstIterator& ite, IteratorType);
365  const ConstIterator& itb, const ConstIterator& ite, CirculatorType);
366 
375 
380 
385 
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)
Aim: Specific iterator to visit all the maximal segments of a saturated segmentation.
bool operator!=(const SegmentComputerIterator &aOther) const
SaturatedSegmentation::SegmentComputer SegmentComputer
bool doesIntersectNext(const ConstIterator &it, const ConstIterator &itb, const ConstIterator &ite)
const SaturatedSegmentation< TSegmentComputer > * myS
SegmentComputerIterator & operator=(const SegmentComputerIterator &aOther)
SegmentComputerIterator(const SegmentComputerIterator &aOther)
bool operator==(const SegmentComputerIterator &aOther) const
bool doesIntersectNext(const ConstIterator &it, const ConstIterator &itb, const ConstIterator &ite, IteratorType)
bool doesIntersectNext(const ConstIterator &it, const ConstIterator &itb, const ConstIterator &ite, CirculatorType)
SegmentComputerIterator(const SaturatedSegmentation< TSegmentComputer > *aSegmentation, const TSegmentComputer &aSegmentComputer, const bool &aFlag)
Aim: Computes the saturated segmentation, that is the whole set of maximal segments within a range gi...
SaturatedSegmentation & operator=(const SaturatedSegmentation &other)
SaturatedSegmentation::SegmentComputerIterator end() const
SaturatedSegmentation(const ConstIterator &itb, const ConstIterator &ite, const SegmentComputer &aSegmentComputer)
TSegmentComputer::Reverse ReverseSegmentComputer
void selfDisplay(std::ostream &out) const
SegmentComputer::ConstIterator ConstIterator
void setMode(const std::string &aMode)
SaturatedSegmentation(const SaturatedSegmentation &other)
SaturatedSegmentation::SegmentComputerIterator begin() const
void setSubRange(const ConstIterator &itb, const ConstIterator &ite)
ReverseSegmentComputer::ConstIterator ConstReverseIterator
BOOST_CONCEPT_ASSERT((concepts::CForwardSegmentComputer< TSegmentComputer >))
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
Aim: Defines the concept describing a forward segment computer. Like any model of CIncrementalSegment...