DGtal  0.9.3beta
Data Structures | Public Types | Public Member Functions | Private Member Functions | Private Attributes
DGtal::UmbrellaComputer< TDigitalSurfaceTracker > Class Template Reference

#include <DGtal/topology/UmbrellaComputer.h>

Inheritance diagram for DGtal::UmbrellaComputer< TDigitalSurfaceTracker >:
[legend]
Collaboration diagram for DGtal::UmbrellaComputer< TDigitalSurfaceTracker >:
[legend]

Data Structures

struct  State
 

Public Types

typedef TDigitalSurfaceTracker DigitalSurfaceTracker
 
typedef DigitalSurfaceTracker::DigitalSurfaceContainer DigitalSurfaceContainer
 
typedef DigitalSurfaceContainer::KSpace KSpace
 
typedef DigitalSurfaceContainer::Surfel Surfel
 
typedef DigitalSurfaceContainer::Size Size
 
typedef KSpace::SCell SCell
 

Public Member Functions

 ~UmbrellaComputer ()
 
 UmbrellaComputer ()
 
 UmbrellaComputer (const UmbrellaComputer &other)
 
UmbrellaComputeroperator= (const UmbrellaComputer &other)
 
void init (const DigitalSurfaceTracker &tracker, Dimension k, bool epsilon, Dimension j)
 
void setState (const State &aState)
 
void getState (State &aState) const
 
const Statestate () const
 
const KSpacespace () const
 
const Surfelsurfel () const
 
SCell separator () const
 
SCell pivot () const
 
Dimension orthDir () const
 
Dimension trackDir () const
 
bool trackOrientation () const
 
Dimension separatorDir () const
 
bool separatorOrientation () const
 
unsigned int next ()
 
unsigned int previous ()
 
bool adjacent ()
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CDigitalSurfaceTracker< TDigitalSurfaceTracker >))
 

Private Attributes

DigitalSurfaceTrackermyTracker
 
State myState
 

Detailed Description

template<typename TDigitalSurfaceTracker>
class DGtal::UmbrellaComputer< TDigitalSurfaceTracker >

Aim: Useful for computing umbrellas on 'DigitalSurface's, ie set of n-1 cells around a n-3 cell.

Description of class 'DigitalSurfaceUmbrellaComputer'

The current surfel (n-1 cell), or face, is denoted by s. The n-3 cell is called the pivot and denoted by +p. It is always a positive cell. There is also a current n-2 cell, called the separator and denoted by t, which is in the boundary of s and whose boundary contains +p.

Two directions specifies the separator and the pivot, the track direction j and the separator direction k. Moreover an orientation \( \epsilon=\pm 1 \) specifies one which side is the separator wrt the face. We have \( t = \Delta^{\epsilon}_k s, +p = \Delta^{\mu}_{j} t, \) where \( \mu \) is the direct orientation of t along j.

Turning around the pivot means moving the face and the separator once (in the track direction), such that the pivot is the same (ie +p), the track and separator directions being updated. Repeating this process a sufficient number of times brings the umbrella back in its original position, except in the case when the DigitalSurface has a boundary touching the pivot.

Uses delegation with DigitalSurfaceTracker.

Essentially a backport from ImaGene.

Template Parameters
TDigitalSurfaceTrackerthe type of the domain in which shapes are created.

Definition at line 87 of file UmbrellaComputer.h.

Member Typedef Documentation

template<typename TDigitalSurfaceTracker>
typedef DigitalSurfaceTracker::DigitalSurfaceContainer DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::DigitalSurfaceContainer

Definition at line 95 of file UmbrellaComputer.h.

template<typename TDigitalSurfaceTracker>
typedef TDigitalSurfaceTracker DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::DigitalSurfaceTracker

Definition at line 94 of file UmbrellaComputer.h.

template<typename TDigitalSurfaceTracker>
typedef DigitalSurfaceContainer::KSpace DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::KSpace

Definition at line 96 of file UmbrellaComputer.h.

template<typename TDigitalSurfaceTracker>
typedef KSpace::SCell DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::SCell

Definition at line 99 of file UmbrellaComputer.h.

template<typename TDigitalSurfaceTracker>
typedef DigitalSurfaceContainer::Size DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::Size

Definition at line 98 of file UmbrellaComputer.h.

template<typename TDigitalSurfaceTracker>
typedef DigitalSurfaceContainer::Surfel DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::Surfel

Definition at line 97 of file UmbrellaComputer.h.

Constructor & Destructor Documentation

template<typename TDigitalSurfaceTracker>
DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::~UmbrellaComputer ( )

Destructor.

template<typename TDigitalSurfaceTracker>
DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::UmbrellaComputer ( )

Constructor. The object is not valid.

template<typename TDigitalSurfaceTracker>
DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::UmbrellaComputer ( const UmbrellaComputer< TDigitalSurfaceTracker > &  other)

Copy constructor.

Parameters
otherthe object to clone.

Member Function Documentation

template<typename TDigitalSurfaceTracker>
bool DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::adjacent ( )

Go the adjacent umbrella, ie the one which shares the same faces around the separator but whose pivot is symmetric around the separator.

Returns
'true' if their was an adjacent umbrella, 'false' otherwise. (the umbrella is in the same state as before the call).
template<typename TDigitalSurfaceTracker>
DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::BOOST_CONCEPT_ASSERT ( (concepts::CDigitalSurfaceTracker< TDigitalSurfaceTracker >)  )
private
template<typename TDigitalSurfaceTracker>
void DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::getState ( State aState) const

Returns the state of the umbrella in the referenced object [state].

Parameters
aState(returns) the current umbrella state describing the face, the separator and the pivot.
template<typename TDigitalSurfaceTracker>
void DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::init ( const DigitalSurfaceTracker tracker,
Dimension  k,
bool  epsilon,
Dimension  j 
)

Initializes the umbrella with a 'DigitalSurfaceTracker'. Links the umbrella computer with a concrete surface and a surfel on it. Tells also where is the positive pivot to turn around.

Parameters
trackera tracker on a digital surface with a valid 'current()' surfel. (cloned). Specifies the initial surfel.
kthe separator direction different from [j] and the orthogonal direction to the surfel.
epsilonthe orientation where to find the separator pointing at the pivot.
jthe track direction where the next surfel of the umbrella is.
template<typename TDigitalSurfaceTracker>
bool DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TDigitalSurfaceTracker>
unsigned int DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::next ( )

Turns around the current pivot (positive turn).

Returns
0 if the move was impossible (nothing is updated) otherwise returns the move code of the face.
template<typename TDigitalSurfaceTracker>
UmbrellaComputer& DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::operator= ( const UmbrellaComputer< TDigitalSurfaceTracker > &  other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.
template<typename TDigitalSurfaceTracker>
Dimension DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::orthDir ( ) const
Returns
the orthogonal direction to the current surfel.
template<typename TDigitalSurfaceTracker>
SCell DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::pivot ( ) const
Returns
the pivot n-3 cell (always positively orientated).
template<typename TDigitalSurfaceTracker>
unsigned int DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::previous ( )

Turns around the current pivot (negative turn).

Returns
0 if the move was impossible (nothing is updated) otherwise returns the move code of the face.
template<typename TDigitalSurfaceTracker>
void DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.
template<typename TDigitalSurfaceTracker>
SCell DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::separator ( ) const
Returns
the separator n-2 cell.
template<typename TDigitalSurfaceTracker>
Dimension DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::separatorDir ( ) const
Returns
the separator direction.
template<typename TDigitalSurfaceTracker>
bool DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::separatorOrientation ( ) const
Returns
the separator orientation.
template<typename TDigitalSurfaceTracker>
void DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::setState ( const State aState)

Puts the umbrella in the state [state]. The umbrella must have been initialized with a 'DigitalSurfaceTracker' before and the state must be consistent with the tracker. In particular, the face of the state must lie on the same digital surface.

Parameters
aStatea state describing the face, the separator and the pivot.
template<typename TDigitalSurfaceTracker>
const KSpace& DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::space ( ) const

Accessor to the digital space.

template<typename TDigitalSurfaceTracker>
const State& DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::state ( ) const

Accessor to current state.

template<typename TDigitalSurfaceTracker>
const Surfel& DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::surfel ( ) const
Returns
the current surfel at which the umbrella is pointing.
template<typename TDigitalSurfaceTracker>
Dimension DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::trackDir ( ) const
Returns
the track direction (j).
template<typename TDigitalSurfaceTracker>
bool DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::trackOrientation ( ) const
Returns
the track orientation (mu).

Field Documentation

template<typename TDigitalSurfaceTracker>
State DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::myState
private

Current state for the umbrella.

Definition at line 286 of file UmbrellaComputer.h.

template<typename TDigitalSurfaceTracker>
DigitalSurfaceTracker* DGtal::UmbrellaComputer< TDigitalSurfaceTracker >::myTracker
private

Tracker used to move on the digital surface.

Definition at line 284 of file UmbrellaComputer.h.


The documentation for this class was generated from the following file: