DGtal
0.6.devel
Main Page
Related Pages
Modules
Namespaces
Data Structures
Examples
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
src
DGtal
geometry
curves
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>
153
class
SaturatedSegmentation
154
{
155
156
public
:
157
158
BOOST_CONCEPT_ASSERT
((
CForwardSegmentComputer<TSegmentComputer>
));
159
typedef
TSegmentComputer
SegmentComputer
;
160
typedef
typename
SegmentComputer::ConstIterator
ConstIterator
;
161
162
private
:
163
164
typedef
typename
TSegmentComputer::Reverse
ReverseSegmentComputer
;
165
typedef
typename
ReverseSegmentComputer::ConstIterator
ConstReverseIterator
;
166
167
// ----------------------- Standard services ------------------------------
168
public
:
169
170
171
173
// template class SegmentComputerIterator
179
class
SegmentComputerIterator
180
{
181
182
// ------------------------- inner Types -----------------------
183
184
public
:
185
typedef
typename
SaturatedSegmentation::SegmentComputer
SegmentComputer
;
186
typedef
typename
SegmentComputer::ConstIterator
ConstIterator
;
187
188
// ------------------------- data -----------------------
189
private
:
190
194
const
SaturatedSegmentation<TSegmentComputer>
*
myS
;
195
199
SegmentComputer
mySegmentComputer
;
200
204
bool
myFlagIsValid
;
205
209
ConstIterator
myLastMaximalSegmentBegin
;
213
ConstIterator
myLastMaximalSegmentEnd
;
214
220
bool
myFlagIntersectNext
;
221
227
bool
myFlagIntersectPrevious
;
228
233
bool
myFlagIsLast
;
234
235
236
237
// ------------------------- Standard services -----------------------
238
public
:
239
friend
class
SaturatedSegmentation
<TSegmentComputer>;
240
241
242
251
SegmentComputerIterator
(
const
SaturatedSegmentation<TSegmentComputer>
*aSegmentation,
252
const
TSegmentComputer& aSegmentComputer,
253
const
bool
& aFlag );
254
255
260
SegmentComputerIterator
(
const
SegmentComputerIterator
& aOther );
261
267
SegmentComputerIterator
&
operator=
(
const
SegmentComputerIterator
& aOther );
268
272
~SegmentComputerIterator
();
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
304
SegmentComputerIterator
&
operator++
();
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
384
void
initFirstMaximalSegment
();
385
389
void
initLastMaximalSegment
();
390
391
};
392
393
//-------------------------------------------------------------------------
394
// end class SegmentComputerIterator
395
//-------------------------------------------------------------------------
396
397
398
// ----------------------- Interface --------------------------------------
399
public
:
400
406
SaturatedSegmentation
() {};
407
414
SaturatedSegmentation
(
const
ConstIterator& itb,
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
440
~SaturatedSegmentation
();
441
446
typename
SaturatedSegmentation::SegmentComputerIterator
begin
()
const
;
447
452
typename
SaturatedSegmentation::SegmentComputerIterator
end
()
const
;
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
475
ConstIterator
myBegin
;
476
480
ConstIterator
myEnd
;
481
485
ConstIterator
myStart
;
486
490
ConstIterator
myStop
;
491
495
std::string
myMode
;
496
500
SegmentComputer
mySegmentComputer
;
501
502
// ------------------------- Hidden services ------------------------------
503
504
505
private
:
506
511
SaturatedSegmentation
(
const
SaturatedSegmentation
& other );
512
518
SaturatedSegmentation
&
operator=
(
const
SaturatedSegmentation
& other );
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)
Generated on Wed Dec 19 2012 19:10:33 for DGtal by
1.8.1.1