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
GeometricalDCA.h
1
17
#pragma once
18
31
#if defined(GeometricalDCA_RECURSES)
32
#error Recursive header files inclusion detected in GeometricalDCA.h
33
#else // defined(GeometricalDCA_RECURSES)
34
35
#define GeometricalDCA_RECURSES
36
37
#if !defined GeometricalDCA_h
38
39
#define GeometricalDCA_h
40
42
// Inclusions
43
#include <iostream>
44
#include "DGtal/base/Common.h"
45
#include "DGtal/base/CowPtr.h"
46
#include "DGtal/base/ConceptUtils.h"
47
#include "DGtal/geometry/curves/SegmentComputerUtils.h"
48
49
#include "DGtal/geometry/curves/GeometricalDSS.h"
50
#include "DGtal/shapes/fromPoints/CircleFrom2Points.h"
51
#include "DGtal/geometry/tools/Preimage2D.h"
52
#include "DGtal/shapes/fromPoints/CircleFrom3Points.h"
53
#include "DGtal/shapes/fromPoints/Point2ShapePredicate.h"
54
56
57
namespace
DGtal
58
{
59
61
// template class GeometricalDCA
111
template
<
typename
TConstIterator>
112
class
GeometricalDCA
113
{
114
115
public
:
116
117
//requiered types
118
typedef
TConstIterator
ConstIterator
;
119
typedef
GeometricalDCA<ConstIterator>
Self
;
120
typedef
GeometricalDCA<ReverseIterator<ConstIterator>
>
Reverse
;
121
122
//point type
123
typedef
typename
IteratorCirculatorTraits<ConstIterator>::Value
Pair
;
124
//Pair::first_type and Pair::second_type should be the same type;
125
BOOST_STATIC_ASSERT
((
ConceptUtils::SameType<typename Pair::first_type, typename Pair::second_type >::value
));
126
typedef
typename
Pair::first_type
Point
;
127
BOOST_STATIC_ASSERT
(( Point::dimension == 2 ));
128
129
private
:
130
131
//other types used for the recognition
132
typedef
CowPtr<GeometricalDSS<ConstIterator>
>
GeometricalDSSPtr
;
133
typedef
CircleFrom3Points<Point>
Circle
;
134
135
//Predicates used to decide whether the current circle is still seperating or not
136
typedef
Point2ShapePredicate<Circle,false,true>
137
PInCirclePred
;
138
typedef
Point2ShapePredicate<Circle,true,true>
139
QInCirclePred
;
140
141
// ----------------------- Standard services ------------------------------
142
public
:
143
147
GeometricalDCA
();
148
153
GeometricalDCA
(
const
Self
& other );
154
160
Self
&
operator=
(
const
Self
& other );
161
165
~GeometricalDCA
();
166
174
bool
operator==
(
const
Self
& other)
const
;
175
183
bool
operator!=
(
const
Self
& other)
const
;
184
188
Self
getSelf
()
const
;
189
193
Reverse
getReverse
()
const
;
194
195
196
// ----------------------- Interface --------------------------------------
197
public
:
198
203
bool
isValid
()
const
;
204
208
ConstIterator
begin
()
const
;
209
213
ConstIterator
end
()
const
;
214
215
//------------------ accessors -------------------------------
216
221
bool
isStraight
()
const
;
222
228
GeometricalDSSPtr
getGeometricalDSSPtr
()
const
;
229
233
Circle
getSeparatingCircle
()
const
;
234
235
// ----------------------- growth operations --------------------------------------
236
241
void
init
(
const
ConstIterator
& anIt);
242
248
bool
extendForward
();
249
255
bool
isExtendableForward
();
256
262
bool
extendBackward
();
263
269
bool
isExtendableBackward
();
270
271
//------------------ display -------------------------------
276
void
selfDisplay
( std::ostream & out )
const
;
277
278
282
std::string
className
()
const
;
283
284
285
// ------------------------- Protected Datas ------------------------------
286
private
:
287
// ------------------------- Private Datas --------------------------------
288
private
:
292
ConstIterator
myBegin
;
296
ConstIterator
myEnd
;
300
GeometricalDSSPtr
mySegPtr
;
304
Circle
myCircle
;
309
bool
myFlagIsInit
;
310
311
// ------------------------- Hidden services ------------------------------
312
protected
:
313
314
315
private
:
316
317
318
// ------------------------- Internals ------------------------------------
319
private
:
320
340
template
<
typename
TIterator>
341
bool
isCircularlySeparable
(
const
TIterator& itb,
const
TIterator& ite,
342
const
Point
& aPole,
343
Point
& Pf,
Point
& Pl,
Point
& Qf,
Point
& Ql);
344
345
// ------------------------- Private Datas --------------------------------
346
private
:
347
348
349
};
// end of class GeometricalDCA
350
351
358
template
<
typename
TConstIterator>
359
std::ostream&
360
operator<< ( std::ostream & out, const GeometricalDCA<TConstIterator> & object );
361
362
}
// namespace DGtal
363
364
366
// Includes inline functions.
367
#include "DGtal/geometry/curves/GeometricalDCA.ih"
368
369
// //
371
372
#endif // !defined GeometricalDCA_h
373
374
#undef GeometricalDCA_RECURSES
375
#endif // else defined(GeometricalDCA_RECURSES)
Generated on Wed Dec 19 2012 19:10:24 for DGtal by
1.8.1.1