DGtal 1.3.0
Loading...
Searching...
No Matches
GreedySegmentation.h
1
17#pragma once
18
31#if defined(GreedySegmentation_RECURSES)
32#error Recursive header files inclusion detected in GreedySegmentation.h
33#else // defined(GreedySegmentation_RECURSES)
35#define GreedySegmentation_RECURSES
36
37#if !defined GreedySegmentation_h
39#define GreedySegmentation_h
40
42// Inclusions
43#include <iostream>
44#include "DGtal/base/Common.h"
45#include "DGtal/geometry/curves/SegmentComputerUtils.h"
46#include "DGtal/geometry/curves/CForwardSegmentComputer.h"
47
49
50namespace DGtal
51{
52
54 // template class GreedySegmentation
148 template <typename TSegmentComputer>
150 {
151
152 public:
153
155 typedef TSegmentComputer SegmentComputer;
157
158 // ----------------------- Standard services ------------------------------
159 public:
160
161
162
164 // template class SegmentComputerIterator
170 {
171
172 // ------------------------- inner Types -----------------------
173
174 public:
177
178 // ------------------------- data -----------------------
179 private:
180
185
190
195
202
209
214
215
216
217 // ------------------------- Standard services -----------------------
218 public:
219 friend class GreedySegmentation<TSegmentComputer>;
220
221
222
233 const TSegmentComputer& aSegmentComputer,
234 const bool& aFlag );
235
236
242
249
254
259 bool isValid() const { return myFlagIsValid; }
260
261 // ------------------------- iteration services -------------------------
262 public:
263
268
269
274
275
280
288
294 void next();
295
296
303 bool operator==( const SegmentComputerIterator & aOther ) const;
304
311 bool operator!=( const SegmentComputerIterator & aOther ) const;
312
313 // ----------------------- accessors --------------------------------------
314
319 bool intersectNext() const;
320
325 bool intersectPrevious() const;
326
330 const ConstIterator begin() const;
331
335 const ConstIterator end() const;
336
337 // ----------------------- hidden services --------------------------------------
338
339 private:
340
348
358 const ConstIterator& itb, const ConstIterator& ite);
360 const ConstIterator& itb, const ConstIterator& ite, IteratorType);
362 const ConstIterator& itb, const ConstIterator& ite, CirculatorType);
363
372
373
374 };
375
376
377 // ----------------------- Interface --------------------------------------
378 public:
379
386
394 const ConstIterator& ite,
395 const SegmentComputer& aSegmentComputer);
396
404 void setSubRange(const ConstIterator& itb,
405 const ConstIterator& ite);
406
407
413 void setMode(const std::string& aMode);
414
415
420
426
432
433
438 void selfDisplay ( std::ostream & out ) const;
439
444 bool isValid() const;
445
446 // ------------------------- Protected Datas ------------------------------
447 private:
448 // ------------------------- Private Datas --------------------------------
449 private:
450
455
460
465
470
474 std::string myMode;
475
480
481 // ------------------------- Hidden services ------------------------------
482
483
484 private:
485
491
498
499 // ------------------------- Internals ------------------------------------
500 private:
501
502 }; // end of class GreedySegmentation
503
504
511 template <typename SegmentComputer>
512 std::ostream&
513 operator<< ( std::ostream & out, const GreedySegmentation<SegmentComputer> & object );
514
515} // namespace DGtal
516
517
519// Includes inline functions.
520#include "DGtal/geometry/curves/GreedySegmentation.ih"
521
522// //
524
525#endif // !defined GreedySegmentation_h
526
527#undef GreedySegmentation_RECURSES
528#endif // else defined(GreedySegmentation_RECURSES)
Aim: Specific iterator to visit all the segments of a greedy segmentation.
bool doesIntersectNext(const ConstIterator &it)
bool doesIntersectNext(const ConstIterator &it, const ConstIterator &itb, const ConstIterator &ite)
bool doesIntersectNext(const ConstIterator &it, const ConstIterator &itb, const ConstIterator &ite, IteratorType)
bool doesIntersectNext(const ConstIterator &it, const ConstIterator &itb, const ConstIterator &ite, CirculatorType)
bool operator==(const SegmentComputerIterator &aOther) const
bool operator!=(const SegmentComputerIterator &aOther) const
void longestSegment(const ConstIterator &it)
SegmentComputerIterator(const SegmentComputerIterator &aOther)
const SegmentComputer * operator->() const
SegmentComputerIterator(const GreedySegmentation< TSegmentComputer > *aSegmentation, const TSegmentComputer &aSegmentComputer, const bool &aFlag)
const GreedySegmentation< TSegmentComputer > * myS
const SegmentComputer & operator*() const
SegmentComputerIterator & operator=(const SegmentComputerIterator &aOther)
GreedySegmentation::SegmentComputer SegmentComputer
Aim: Computes the greedy segmentation of a range given by a pair of ConstIterators....
GreedySegmentation::SegmentComputerIterator end() const
GreedySegmentation & operator=(const GreedySegmentation &other)
void setMode(const std::string &aMode)
TSegmentComputer SegmentComputer
GreedySegmentation(const ConstIterator &itb, const ConstIterator &ite, const SegmentComputer &aSegmentComputer)
BOOST_CONCEPT_ASSERT((concepts::CForwardSegmentComputer< TSegmentComputer >))
void selfDisplay(std::ostream &out) const
GreedySegmentation::SegmentComputerIterator begin() const
void setSubRange(const ConstIterator &itb, const ConstIterator &ite)
SegmentComputer::ConstIterator ConstIterator
GreedySegmentation(const GreedySegmentation &other)
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
Aim: Defines the concept describing a forward segment computer. Like any model of CIncrementalSegment...