DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
StabbingCircleComputer.h
1
16
17
#pragma once
18
30
31
#if defined(StabbingCircleComputer_RECURSES)
32
#error Recursive header files inclusion detected in StabbingCircleComputer.h
33
#else
// defined(StabbingCircleComputer_RECURSES)
35
#define StabbingCircleComputer_RECURSES
36
37
#if !defined StabbingCircleComputer_h
39
#define StabbingCircleComputer_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/StabbingLineComputer.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
#include "boost/iterator/reverse_iterator.hpp"
55
57
58
namespace
DGtal
59
{
60
62
// template class StabbingCircleComputer
112
template
<
typename
TConstIterator>
113
class
StabbingCircleComputer
114
{
115
116
public
:
117
118
//required types
119
typedef
TConstIterator
ConstIterator
;
120
typedef
StabbingCircleComputer<ConstIterator>
Self
;
121
typedef
StabbingCircleComputer<ReverseIterator<ConstIterator>
>
Reverse
;
122
123
//point type
124
typedef
typename
IteratorCirculatorTraits<ConstIterator>::Value
Pair
;
125
//Pair::first_type and Pair::second_type should be the same type;
126
BOOST_STATIC_ASSERT
((
concepts::ConceptUtils::SameType<typename Pair::first_type, typename Pair::second_type >::value
));
127
typedef
typename
Pair::first_type
Point
;
128
BOOST_STATIC_ASSERT
(( Point::dimension == 2 ));
129
130
private
:
131
132
//other types used for the recognition
133
typedef
CowPtr<StabbingLineComputer<ConstIterator>
>
StabbingLineComputerPtr
;
134
typedef
CircleFrom3Points<Point>
Circle
;
135
136
//Predicates used to decide whether the current circle is still separating or not
137
typedef
functors::Point2ShapePredicate<Circle,false,true>
138
PInCirclePred
;
139
typedef
functors::Point2ShapePredicate<Circle,true,true>
140
QInCirclePred
;
141
142
// ----------------------- Standard services ------------------------------
143
public
:
144
148
StabbingCircleComputer
();
149
154
StabbingCircleComputer
(
const
Self
& other );
155
161
Self
&
operator=
(
const
Self
& other );
162
166
~StabbingCircleComputer
();
167
175
bool
operator==
(
const
Self
& other)
const
;
176
184
bool
operator!=
(
const
Self
& other)
const
;
185
189
Self
getSelf
()
const
;
190
194
Reverse
getReverse
()
const
;
195
196
197
// ----------------------- Interface --------------------------------------
198
public
:
199
204
bool
isValid
()
const
;
205
209
ConstIterator
begin
()
const
;
210
214
ConstIterator
end
()
const
;
215
216
//------------------ accessors -------------------------------
217
222
bool
isStraight
()
const
;
223
229
StabbingLineComputerPtr
getStabbingLineComputerPtr
()
const
;
230
234
Circle
getSeparatingCircle
()
const
;
235
236
// ----------------------- growth operations --------------------------------------
237
242
void
init
(
const
ConstIterator
& anIt);
243
249
bool
extendFront
();
250
256
bool
isExtendableFront
();
257
263
bool
extendBack
();
264
270
bool
isExtendableBack
();
271
272
//------------------ display -------------------------------
277
void
selfDisplay
( std::ostream & out )
const
;
278
279
283
std::string
className
()
const
;
284
285
286
// ------------------------- Protected Data ------------------------------
287
private
:
288
// ------------------------- Private Data --------------------------------
289
private
:
293
ConstIterator
myBegin
;
297
ConstIterator
myEnd
;
301
StabbingLineComputerPtr
mySegPtr
;
305
Circle
myCircle
;
310
bool
myFlagIsInit
;
311
312
// ------------------------- Hidden services ------------------------------
313
protected
:
314
315
316
private
:
317
318
319
// ------------------------- Internals ------------------------------------
320
private
:
321
341
template
<
typename
TIterator>
342
bool
isCircularlySeparable
(
const
TIterator& itb,
const
TIterator& ite,
343
const
Point
& aPole,
344
Point
& Pf,
Point
& Pl,
Point
& Qf,
Point
& Ql);
345
346
// ------------------------- Private Data --------------------------------
347
private
:
348
349
350
};
// end of class StabbingCircleComputer
351
352
359
template
<
typename
TConstIterator>
360
std::ostream&
361
operator<<
( std::ostream & out,
const
StabbingCircleComputer<TConstIterator>
&
object
);
362
363
}
// namespace DGtal
364
365
367
// Includes inline functions.
368
#include "DGtal/geometry/curves/StabbingCircleComputer.ih"
369
370
// //
372
373
#endif
// !defined StabbingCircleComputer_h
374
375
#undef StabbingCircleComputer_RECURSES
376
#endif
// else defined(StabbingCircleComputer_RECURSES)
DGtal::CircleFrom3Points
Aim: Represents a circle uniquely defined by three 2D points and that is able to return for any given...
Definition
CircleFrom3Points.h:67
DGtal::CowPtr
Aim: Copy on write shared pointer.
Definition
CowPtr.h:68
DGtal::StabbingCircleComputer
Aim: On-line recognition of a digital circular arcs (DCA) defined as a sequence of connected grid edg...
Definition
StabbingCircleComputer.h:114
DGtal::StabbingCircleComputer< ConstIterator >::StabbingLineComputerPtr
CowPtr< StabbingLineComputer< ConstIterator > > StabbingLineComputerPtr
Definition
StabbingCircleComputer.h:133
DGtal::StabbingCircleComputer::operator==
bool operator==(const Self &other) const
DGtal::StabbingCircleComputer::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::StabbingCircleComputer< ConstIterator >::Pair
IteratorCirculatorTraits< ConstIterator >::Value Pair
Definition
StabbingCircleComputer.h:124
DGtal::StabbingCircleComputer::Self
StabbingCircleComputer< ConstIterator > Self
Definition
StabbingCircleComputer.h:120
DGtal::StabbingCircleComputer::begin
ConstIterator begin() const
DGtal::StabbingCircleComputer::isExtendableFront
bool isExtendableFront()
DGtal::StabbingCircleComputer::isCircularlySeparable
bool isCircularlySeparable(const TIterator &itb, const TIterator &ite, const Point &aPole, Point &Pf, Point &Pl, Point &Qf, Point &Ql)
DGtal::StabbingCircleComputer::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< typename Pair::first_type, typename Pair::second_type >::value))
DGtal::StabbingCircleComputer::getSelf
Self getSelf() const
DGtal::StabbingCircleComputer< ConstIterator >::QInCirclePred
functors::Point2ShapePredicate< Circle, true, true > QInCirclePred
Definition
StabbingCircleComputer.h:140
DGtal::StabbingCircleComputer::extendFront
bool extendFront()
DGtal::StabbingCircleComputer::isStraight
bool isStraight() const
DGtal::StabbingCircleComputer< ConstIterator >::PInCirclePred
functors::Point2ShapePredicate< Circle, false, true > PInCirclePred
Definition
StabbingCircleComputer.h:138
DGtal::StabbingCircleComputer< ConstIterator >::myEnd
ConstIterator myEnd
Definition
StabbingCircleComputer.h:297
DGtal::StabbingCircleComputer::isValid
bool isValid() const
DGtal::StabbingCircleComputer::init
void init(const ConstIterator &anIt)
DGtal::StabbingCircleComputer::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((Point::dimension==2))
DGtal::StabbingCircleComputer::operator!=
bool operator!=(const Self &other) const
DGtal::StabbingCircleComputer::getReverse
Reverse getReverse() const
DGtal::StabbingCircleComputer::extendBack
bool extendBack()
DGtal::StabbingCircleComputer::StabbingCircleComputer
StabbingCircleComputer(const Self &other)
DGtal::StabbingCircleComputer::StabbingCircleComputer
StabbingCircleComputer()
DGtal::StabbingCircleComputer::operator=
Self & operator=(const Self &other)
DGtal::StabbingCircleComputer< ConstIterator >::mySegPtr
StabbingLineComputerPtr mySegPtr
Definition
StabbingCircleComputer.h:301
DGtal::StabbingCircleComputer< ConstIterator >::myFlagIsInit
bool myFlagIsInit
Definition
StabbingCircleComputer.h:310
DGtal::StabbingCircleComputer< ConstIterator >::myCircle
Circle myCircle
Definition
StabbingCircleComputer.h:305
DGtal::StabbingCircleComputer::className
std::string className() const
DGtal::StabbingCircleComputer::getSeparatingCircle
Circle getSeparatingCircle() const
DGtal::StabbingCircleComputer< ConstIterator >::myBegin
ConstIterator myBegin
Definition
StabbingCircleComputer.h:293
DGtal::StabbingCircleComputer::getStabbingLineComputerPtr
StabbingLineComputerPtr getStabbingLineComputerPtr() const
DGtal::StabbingCircleComputer< ConstIterator >::Point
Pair::first_type Point
Definition
StabbingCircleComputer.h:127
DGtal::StabbingCircleComputer::ConstIterator
TConstIterator ConstIterator
Definition
StabbingCircleComputer.h:119
DGtal::StabbingCircleComputer::end
ConstIterator end() const
DGtal::StabbingCircleComputer< ConstIterator >::Circle
CircleFrom3Points< Point > Circle
Definition
StabbingCircleComputer.h:134
DGtal::StabbingCircleComputer::isExtendableBack
bool isExtendableBack()
DGtal::StabbingCircleComputer< ConstIterator >::Reverse
StabbingCircleComputer< ReverseIterator< ConstIterator > > Reverse
Definition
StabbingCircleComputer.h:121
DGtal::StabbingCircleComputer::~StabbingCircleComputer
~StabbingCircleComputer()
DGtal::functors::Point2ShapePredicate
Aim: Predicate returning 'true' iff a given point is in the 'interior' of a given shape,...
Definition
Point2ShapePredicate.h:96
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::IteratorCirculatorTraits::Value
IC::value_type Value
Definition
IteratorCirculatorTraits.h:303
DGtal::concepts::ConceptUtils::SameType::value
static const bool value
Definition
ConceptUtils.h:107
src
DGtal
geometry
curves
StabbingCircleComputer.h
Generated on
for DGtal by
1.18.0