DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
UmbrellaComputer.h
1
16
17
#pragma once
18
30
31
#if defined(UmbrellaComputer_RECURSES)
32
#error Recursive header files inclusion detected in UmbrellaComputer.h
33
#else
// defined(UmbrellaComputer_RECURSES)
35
#define UmbrellaComputer_RECURSES
36
37
#if !defined UmbrellaComputer_h
39
#define UmbrellaComputer_h
40
42
// Inclusions
43
#include <iostream>
44
#include "DGtal/base/Common.h"
45
#include "DGtal/topology/CDigitalSurfaceTracker.h"
47
48
namespace
DGtal
49
{
50
52
// template class UmbrellaComputer
85
template
<
typename
TDigitalSurfaceTracker>
86
class
UmbrellaComputer
87
{
88
// Concept checks
89
BOOST_CONCEPT_ASSERT
((
concepts::CDigitalSurfaceTracker<TDigitalSurfaceTracker>
) );
90
91
// ----------------------- public types ------------------------------
92
public
:
93
typedef
TDigitalSurfaceTracker
DigitalSurfaceTracker
;
94
typedef
typename
DigitalSurfaceTracker::DigitalSurfaceContainer
DigitalSurfaceContainer
;
95
typedef
typename
DigitalSurfaceContainer::KSpace
KSpace
;
96
typedef
typename
DigitalSurfaceContainer::Surfel
Surfel
;
97
typedef
typename
DigitalSurfaceContainer::Size
Size
;
98
typedef
typename
KSpace::SCell
SCell
;
99
104
struct
State
105
{
107
Surfel
surfel
;
109
Dimension
k
;
111
bool
epsilon
;
113
Dimension
j
;
114
inline
State
(){}
115
inline
State
(
const
Surfel
& _surfel,
116
Dimension
_k,
bool
_epsilon,
Dimension
_j )
117
:
surfel
( _surfel ),
k
( _k ),
epsilon
( _epsilon ),
j
( _j )
118
{}
119
inline
bool
operator==
(
const
State
& other )
const
120
{
121
return
(
surfel
== other.
surfel
)
122
&& (
k
== other.
k
)
123
&& (
epsilon
== other.
epsilon
)
124
&& (
j
== other.
j
);
125
}
126
inline
bool
operator<
(
const
State
& other )
const
127
{
128
return
(
surfel
< other.
surfel
)
129
|| ( (
surfel
== other.
surfel
)
130
&& ( (
k
< other.
k
)
131
|| ( (
k
== other.
k
)
132
&& ( (
epsilon
< other.
epsilon
)
133
|| ( (
epsilon
== other.
epsilon
)
134
&& (
j
< other.
j
) ) ) ) ) );
135
}
136
};
137
138
// ----------------------- Standard services ------------------------------
139
public
:
140
142
~UmbrellaComputer
();
143
145
UmbrellaComputer
();
146
151
UmbrellaComputer
(
const
UmbrellaComputer
& other );
152
158
UmbrellaComputer
&
159
operator=
(
const
UmbrellaComputer
& other );
160
177
void
init
(
const
DigitalSurfaceTracker
& tracker,
178
Dimension
k,
bool
epsilon,
Dimension
j );
179
188
void
setState
(
const
State & aState );
189
196
void
getState
( State & aState )
const
;
197
199
const
State &
state
()
const
;
200
202
const
KSpace
&
space
()
const
;
203
204
// ----------------------- Accessor services ------------------------------
205
public
:
206
208
const
Surfel
&
surfel
()
const
;
209
211
SCell
separator
()
const
;
212
214
SCell
pivot
()
const
;
215
217
Dimension
orthDir
()
const
;
218
220
Dimension
trackDir
()
const
;
221
223
bool
trackOrientation
()
const
;
224
226
Dimension
separatorDir
()
const
;
227
229
bool
separatorOrientation
()
const
;
230
231
// ----------------------- Pivoting services ------------------------------
232
public
:
233
240
unsigned
int
next
();
241
248
unsigned
int
previous
();
249
258
bool
adjacent
();
259
260
261
262
// ----------------------- Interface --------------------------------------
263
public
:
264
269
void
selfDisplay
( std::ostream & out )
const
;
270
275
bool
isValid
()
const
;
276
277
// ------------------------- Protected Data ------------------------------
278
private
:
279
// ------------------------- Private Data --------------------------------
280
private
:
281
283
DigitalSurfaceTracker
*
myTracker
;
285
State
myState
;
286
287
// ------------------------- Hidden services ------------------------------
288
protected
:
289
290
// ------------------------- Internals ------------------------------------
291
private
:
292
293
};
// end of class UmbrellaComputer
294
295
302
template
<
typename
TDigitalSurfaceTracker>
303
std::ostream&
304
operator<<
( std::ostream & out,
const
UmbrellaComputer<TDigitalSurfaceTracker>
&
object
);
305
306
}
// namespace DGtal
307
308
310
// Includes inline functions.
311
#include "DGtal/topology/UmbrellaComputer.ih"
312
313
// //
315
316
#endif
// !defined UmbrellaComputer_h
317
318
#undef UmbrellaComputer_RECURSES
319
#endif
// else defined(UmbrellaComputer_RECURSES)
DGtal::KhalimskySpaceND< 3, Integer >::SCell
SignedKhalimskyCell< dim, Integer > SCell
Definition
KhalimskySpaceND.h:417
DGtal::UmbrellaComputer
Aim: Useful for computing umbrellas on 'DigitalSurface's, ie set of n-1 cells around a n-3 cell.
Definition
UmbrellaComputer.h:87
DGtal::UmbrellaComputer< DigitalSurfaceTracker >::myState
State myState
Definition
UmbrellaComputer.h:285
DGtal::UmbrellaComputer::orthDir
Dimension orthDir() const
DGtal::UmbrellaComputer< DigitalSurfaceTracker >::DigitalSurfaceTracker
DigitalSurfaceTracker DigitalSurfaceTracker
Definition
UmbrellaComputer.h:93
DGtal::UmbrellaComputer::~UmbrellaComputer
~UmbrellaComputer()
Destructor.
DGtal::UmbrellaComputer::separatorDir
Dimension separatorDir() const
DGtal::UmbrellaComputer::trackOrientation
bool trackOrientation() const
DGtal::UmbrellaComputer< DigitalSurfaceTracker >::Surfel
DigitalSurfaceContainer::Surfel Surfel
Definition
UmbrellaComputer.h:96
DGtal::UmbrellaComputer::setState
void setState(const State &aState)
DGtal::UmbrellaComputer::getState
void getState(State &aState) const
DGtal::UmbrellaComputer< DigitalSurfaceTracker >::KSpace
DigitalSurfaceContainer::KSpace KSpace
Definition
UmbrellaComputer.h:95
DGtal::UmbrellaComputer::adjacent
bool adjacent()
DGtal::UmbrellaComputer< DigitalSurfaceTracker >::Size
DigitalSurfaceContainer::Size Size
Definition
UmbrellaComputer.h:97
DGtal::UmbrellaComputer::UmbrellaComputer
UmbrellaComputer()
Constructor. The object is not valid.
DGtal::UmbrellaComputer::isValid
bool isValid() const
DGtal::UmbrellaComputer::trackDir
Dimension trackDir() const
DGtal::UmbrellaComputer::operator=
UmbrellaComputer & operator=(const UmbrellaComputer &other)
DGtal::UmbrellaComputer::next
unsigned int next()
DGtal::UmbrellaComputer::surfel
const Surfel & surfel() const
DGtal::UmbrellaComputer::pivot
SCell pivot() const
DGtal::UmbrellaComputer< DigitalSurfaceTracker >::SCell
KSpace::SCell SCell
Definition
UmbrellaComputer.h:98
DGtal::UmbrellaComputer::separator
SCell separator() const
DGtal::UmbrellaComputer::init
void init(const DigitalSurfaceTracker &tracker, Dimension k, bool epsilon, Dimension j)
DGtal::UmbrellaComputer::previous
unsigned int previous()
DGtal::UmbrellaComputer< DigitalSurfaceTracker >::myTracker
DigitalSurfaceTracker * myTracker
Definition
UmbrellaComputer.h:283
DGtal::UmbrellaComputer< DigitalSurfaceTracker >::DigitalSurfaceContainer
DigitalSurfaceTracker::DigitalSurfaceContainer DigitalSurfaceContainer
Definition
UmbrellaComputer.h:94
DGtal::UmbrellaComputer::UmbrellaComputer
UmbrellaComputer(const UmbrellaComputer &other)
DGtal::UmbrellaComputer::separatorOrientation
bool separatorOrientation() const
DGtal::UmbrellaComputer::space
const KSpace & space() const
Accessor to the digital space.
DGtal::UmbrellaComputer::state
const State & state() const
Accessor to current state.
DGtal::UmbrellaComputer::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CDigitalSurfaceTracker< TDigitalSurfaceTracker >))
DGtal::UmbrellaComputer::selfDisplay
void selfDisplay(std::ostream &out) const
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::Dimension
DGtal::uint32_t Dimension
Definition
Common.h:119
DGtal::UmbrellaComputer::State::State
State()
Definition
UmbrellaComputer.h:114
DGtal::UmbrellaComputer::State::surfel
Surfel surfel
Current surfel.
Definition
UmbrellaComputer.h:107
DGtal::UmbrellaComputer::State::j
Dimension j
Track direction (j != k), j in sDirs(surfel).
Definition
UmbrellaComputer.h:113
DGtal::UmbrellaComputer::State::State
State(const Surfel &_surfel, Dimension _k, bool _epsilon, Dimension _j)
Definition
UmbrellaComputer.h:115
DGtal::UmbrellaComputer::State::k
Dimension k
Direction to find separator, k in sDirs(surfel).
Definition
UmbrellaComputer.h:109
DGtal::UmbrellaComputer::State::operator<
bool operator<(const State &other) const
Definition
UmbrellaComputer.h:126
DGtal::UmbrellaComputer::State::epsilon
bool epsilon
Orientation to find separator (true = positively along k-axis).
Definition
UmbrellaComputer.h:111
DGtal::UmbrellaComputer::State::operator==
bool operator==(const State &other) const
Definition
UmbrellaComputer.h:119
DGtal::concepts::CDigitalSurfaceTracker
Aim:
Definition
CDigitalSurfaceTracker.h:86
src
DGtal
topology
UmbrellaComputer.h
Generated on
for DGtal by
1.18.0