DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
StabbingLineComputer.h
1
16
17
#pragma once
18
30
31
#if defined(StabbingLineComputer_RECURSES)
32
#error Recursive header files inclusion detected in StabbingLineComputer.h
33
#else
// defined(StabbingLineComputer_RECURSES)
35
#define StabbingLineComputer_RECURSES
36
37
#if !defined StabbingLineComputer_h
39
#define StabbingLineComputer_h
40
42
// Inclusions
43
#include <iostream>
44
#include "DGtal/base/Common.h"
45
#include <boost/static_assert.hpp>
46
#include "DGtal/base/CowPtr.h"
47
#include "DGtal/base/ConceptUtils.h"
48
#include "DGtal/base/ReverseIterator.h"
49
#include "DGtal/geometry/curves/SegmentComputerUtils.h"
50
51
#include "DGtal/geometry/tools/Preimage2D.h"
52
#include "DGtal/shapes/fromPoints/StraightLineFrom2Points.h"
53
55
56
namespace
DGtal
57
{
58
60
// template class StabbingLineComputer
91
template
<
typename
TConstIterator>
92
class
StabbingLineComputer
93
{
94
95
public
:
96
97
//required types
98
typedef
TConstIterator
ConstIterator
;
99
typedef
StabbingLineComputer<ConstIterator>
Self
;
100
typedef
StabbingLineComputer<ReverseIterator<ConstIterator>
>
Reverse
;
101
102
//point type
103
typedef
typename
IteratorCirculatorTraits<ConstIterator>::Value
Pair
;
104
typedef
typename
Pair::first_type
Point
;
105
106
//Pair::first_type and Pair::second_type should be the same type;
107
BOOST_STATIC_ASSERT
( (
concepts::ConceptUtils::SameType
108
<
typename
Pair::first_type,
typename
Pair::second_type >
109
::value ) );
110
111
//preimage
112
typedef
StraightLineFrom2Points<Point>
StraightLine
;
113
typedef
Preimage2D<StraightLine>
Preimage
;
114
typedef
CowPtr<Preimage>
PreimagePtr
;
115
116
// ----------------------- Standard services ------------------------------
117
public
:
118
122
StabbingLineComputer
();
123
128
StabbingLineComputer
(
const
Self
& other );
129
135
Self
&
operator=
(
const
Self
& other );
136
140
~StabbingLineComputer
();
141
147
bool
operator==
(
const
Self
& other)
const
;
148
154
bool
operator!=
(
const
Self
& other)
const
;
155
159
Self
getSelf
()
const
;
160
164
Reverse
getReverse
()
const
;
165
166
167
// ----------------------- Interface --------------------------------------
168
public
:
169
174
bool
isValid
()
const
;
175
179
ConstIterator
begin
()
const
;
180
184
ConstIterator
end
()
const
;
185
186
// ----------------------- accessors --------------------------------------
187
191
Point
Uf
()
const
;
192
196
Point
Ul
()
const
;
197
201
Point
Lf
()
const
;
202
206
Point
Ll
()
const
;
207
211
212
PreimagePtr
getPreimage
()
const
;
213
217
bool
isClockwiseOriented
()
const
;
218
225
void
getParameters
(
double
& alpha,
double
& beta,
double
& gamma)
const
;
226
236
void
projects
(
double
& x,
double
& y,
237
const
double
& alpha,
const
double
& beta,
const
double
& gamma)
const
;
238
239
// ----------------------- growth operations --------------------------------------
240
245
void
init
(
const
ConstIterator
& anIt);
246
253
bool
extendFront
();
254
261
bool
isExtendableFront
();
262
272
bool
isConcave
();
273
283
bool
isConvex
();
284
291
bool
extendBack
();
292
299
bool
isExtendableBack
();
300
310
bool
isOppositeEndConcave
();
311
321
bool
isOppositeEndConvex
();
322
323
//------------------ display -------------------------------
328
void
selfDisplay
( std::ostream & out )
const
;
329
334
//DrawableWithBoard2D* defaultStyle( std::string mode="" ) const;
335
339
std::string
className
()
const
;
340
341
// ------------------------- Protected Data ------------------------------
342
private
:
343
// ------------------------- Private Data --------------------------------
344
private
:
348
ConstIterator
myBegin
;
352
ConstIterator
myEnd
;
356
PreimagePtr
myPreimagePtr
;
361
bool
myFlagIsInit
;
366
bool
myFlagIsCW
;
367
368
// ------------------------- Hidden services ------------------------------
369
protected
:
370
371
372
private
:
373
374
375
376
// ------------------------- Internals ------------------------------------
377
private
:
378
379
// ------------------------- Private Data --------------------------------
380
private
:
381
382
};
// end of class StabbingLineComputer
383
384
391
template
<
typename
TConstIterator>
392
std::ostream&
393
operator<<
( std::ostream & out,
const
StabbingLineComputer<TConstIterator>
&
object
);
394
395
}
// namespace DGtal
396
397
399
// Includes inline functions.
400
#include "DGtal/geometry/curves/StabbingLineComputer.ih"
401
402
// //
404
405
#endif
// !defined StabbingLineComputer_h
406
407
#undef StabbingLineComputer_RECURSES
408
#endif
// else defined(StabbingLineComputer_RECURSES)
DGtal::CowPtr
Aim: Copy on write shared pointer.
Definition
CowPtr.h:68
DGtal::Preimage2D
Aim: Computes the preimage of the 2D Euclidean shapes crossing a sequence of n straight segments in O...
Definition
Preimage2D.h:94
DGtal::StabbingLineComputer
Aim: On-line recognition of a digital straight segment (DSS) defined as a sequence of connected grid ...
Definition
StabbingLineComputer.h:93
DGtal::StabbingLineComputer::isOppositeEndConcave
bool isOppositeEndConcave()
DGtal::StabbingLineComputer::operator==
bool operator==(const Self &other) const
DGtal::StabbingLineComputer::StabbingLineComputer
StabbingLineComputer(const Self &other)
DGtal::StabbingLineComputer< ConstIterator >::Pair
IteratorCirculatorTraits< ConstIterator >::Value Pair
Definition
StabbingLineComputer.h:103
DGtal::StabbingLineComputer::getPreimage
PreimagePtr getPreimage() const
DGtal::StabbingLineComputer::~StabbingLineComputer
~StabbingLineComputer()
DGtal::StabbingLineComputer::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< typename Pair::first_type, typename Pair::second_type > ::value))
DGtal::StabbingLineComputer< ConstIterator >::myPreimagePtr
PreimagePtr myPreimagePtr
Definition
StabbingLineComputer.h:356
DGtal::StabbingLineComputer::extendFront
bool extendFront()
DGtal::StabbingLineComputer::isExtendableFront
bool isExtendableFront()
DGtal::StabbingLineComputer::projects
void projects(double &x, double &y, const double &alpha, const double &beta, const double &gamma) const
DGtal::StabbingLineComputer::isOppositeEndConvex
bool isOppositeEndConvex()
DGtal::StabbingLineComputer< ConstIterator >::Point
Pair::first_type Point
Definition
StabbingLineComputer.h:104
DGtal::StabbingLineComputer::getReverse
Reverse getReverse() const
DGtal::StabbingLineComputer::Ul
Point Ul() const
DGtal::StabbingLineComputer::isExtendableBack
bool isExtendableBack()
DGtal::StabbingLineComputer::isClockwiseOriented
bool isClockwiseOriented() const
DGtal::StabbingLineComputer::operator=
Self & operator=(const Self &other)
DGtal::StabbingLineComputer::getSelf
Self getSelf() const
DGtal::StabbingLineComputer< ConstIterator >::myFlagIsCW
bool myFlagIsCW
Definition
StabbingLineComputer.h:366
DGtal::StabbingLineComputer::end
ConstIterator end() const
DGtal::StabbingLineComputer< ConstIterator >::myEnd
ConstIterator myEnd
Definition
StabbingLineComputer.h:352
DGtal::StabbingLineComputer< ConstIterator >::StraightLine
StraightLineFrom2Points< Point > StraightLine
Definition
StabbingLineComputer.h:112
DGtal::StabbingLineComputer::StabbingLineComputer
StabbingLineComputer()
DGtal::StabbingLineComputer::isConvex
bool isConvex()
DGtal::StabbingLineComputer::begin
ConstIterator begin() const
DGtal::StabbingLineComputer::ConstIterator
TConstIterator ConstIterator
Definition
StabbingLineComputer.h:98
DGtal::StabbingLineComputer< ConstIterator >::myBegin
ConstIterator myBegin
Definition
StabbingLineComputer.h:348
DGtal::StabbingLineComputer::className
std::string className() const
DGtal::StabbingLineComputer::Ll
Point Ll() const
DGtal::StabbingLineComputer< ConstIterator >::PreimagePtr
CowPtr< Preimage > PreimagePtr
Definition
StabbingLineComputer.h:114
DGtal::StabbingLineComputer::isConcave
bool isConcave()
DGtal::StabbingLineComputer< ConstIterator >::Preimage
Preimage2D< StraightLine > Preimage
Definition
StabbingLineComputer.h:113
DGtal::StabbingLineComputer< ConstIterator >::Reverse
StabbingLineComputer< ReverseIterator< ConstIterator > > Reverse
Definition
StabbingLineComputer.h:100
DGtal::StabbingLineComputer::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::StabbingLineComputer::Lf
Point Lf() const
DGtal::StabbingLineComputer::init
void init(const ConstIterator &anIt)
DGtal::StabbingLineComputer::isValid
bool isValid() const
DGtal::StabbingLineComputer::Self
StabbingLineComputer< ConstIterator > Self
Definition
StabbingLineComputer.h:99
DGtal::StabbingLineComputer::extendBack
bool extendBack()
DGtal::StabbingLineComputer::operator!=
bool operator!=(const Self &other) const
DGtal::StabbingLineComputer::Uf
Point Uf() const
DGtal::StabbingLineComputer::getParameters
void getParameters(double &alpha, double &beta, double &gamma) const
DGtal::StabbingLineComputer< ConstIterator >::myFlagIsInit
bool myFlagIsInit
Definition
StabbingLineComputer.h:361
DGtal::StraightLineFrom2Points
Aim: Represents a straight line uniquely defined by two 2D points and that is able to return for any ...
Definition
StraightLineFrom2Points.h:69
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
Definition
ConceptUtils.h:107
src
DGtal
geometry
curves
StabbingLineComputer.h
Generated on
for DGtal by
1.18.0