DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency > Class Template Reference

#include <DigitalTopology.h>

Public Types

typedef TForegroundAdjacency ForegroundAdjacency
typedef TBackgroundAdjacency BackgroundAdjacency
typedef ForegroundAdjacency::Point Point
typedef BackgroundAdjacency::Point BackPoint
typedef DigitalTopology
< BackgroundAdjacency,
ForegroundAdjacency
ReverseTopology

Public Member Functions

 BOOST_CONCEPT_ASSERT ((CAdjacency< ForegroundAdjacency >))
 BOOST_CONCEPT_ASSERT ((CAdjacency< BackgroundAdjacency >))
 DigitalTopology (const ForegroundAdjacency &aKappa, const BackgroundAdjacency &aLambda, DigitalTopologyProperties props=UNKNOWN_DT)
 ~DigitalTopology ()
 DigitalTopology (const DigitalTopology &other)
const ForegroundAdjacencykappa () const
const BackgroundAdjacencylambda () const
DigitalTopologyProperties properties () const
ReverseTopology reverseTopology () const
void selfDisplay (std::ostream &out) const
bool isValid () const

Protected Member Functions

 DigitalTopology ()

Private Member Functions

DigitalTopologyoperator= (const DigitalTopology &other)

Private Attributes

const ForegroundAdjacencymyKappa
const BackgroundAdjacencymyLambda
const DigitalTopologyProperties myProps

Detailed Description

template<typename TForegroundAdjacency, typename TBackgroundAdjacency>
class DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >

Aim: Represents a digital topology as a couple of adjacency relations.

Description of template class 'DigitalTopology' <p>     The most famous are the (4,8) and (8,4) topologies on Z^2 (see
seminal Rosenfeld paper). The two given adjacency relations
should be defined for all digital points used afterwards. For
instance, they should operate on points of the same dimension.
The first adjacency defines the foreground topology while the
second adjacency defines the background topology. The opposite
topology is the reverse couple. Both adjacencies should be
instantiable.

A digital topology is classically denoted by a couple

\( (\kappa,\lambda) \), which explains the notations in the class.

typedef SpaceND< int, 2 > Zi2;
typedef MetricAdjacency< Zi2, 1 > Adj4;
typedef MetricAdjacency< Zi2, 2 > Adj8;
Adj4 adj4;
Adj8 adj8;
typedef DigitalTopology< Adj4, Adj8 > DT48;
typedef DT48::ReverseTopology DT84;
DT48 dt( adj4, adj8, JORDAN_DT );
cout << dt << std::endl;
DT84 opp_dt = dt.reverseTopology();
cout << opp_dt << std::endl;
Template Parameters:
TForegroundAdjacencyany model of CAdjacency.
TBackgroundAdjacencyany model of CAdjacency.
Examples:
topology/3dBorderExtraction.cpp.

Definition at line 94 of file DigitalTopology.h.


Member Typedef Documentation

template<typename TForegroundAdjacency, typename TBackgroundAdjacency>
typedef TBackgroundAdjacency DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::BackgroundAdjacency

Definition at line 99 of file DigitalTopology.h.

template<typename TForegroundAdjacency, typename TBackgroundAdjacency>
typedef BackgroundAdjacency::Point DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::BackPoint

Definition at line 102 of file DigitalTopology.h.

template<typename TForegroundAdjacency, typename TBackgroundAdjacency>
typedef TForegroundAdjacency DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::ForegroundAdjacency

Definition at line 98 of file DigitalTopology.h.

template<typename TForegroundAdjacency, typename TBackgroundAdjacency>
typedef ForegroundAdjacency::Point DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::Point

Definition at line 100 of file DigitalTopology.h.

template<typename TForegroundAdjacency, typename TBackgroundAdjacency>
typedef DigitalTopology<BackgroundAdjacency,ForegroundAdjacency> DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::ReverseTopology

Opposite topology type.

Definition at line 111 of file DigitalTopology.h.


Constructor & Destructor Documentation

template<typename TForegroundAdjacency , typename TBackgroundAdjacency >
DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::DigitalTopology ( const ForegroundAdjacency aKappa,
const BackgroundAdjacency aLambda,
DigitalTopologyProperties  props = UNKNOWN_DT 
)
inline

Defines the digital topology (kappa,lambda).

Parameters:
aKappaa const reference to the adjacency object chosen for the foreground topology.
aLambdaa const reference to the adjacency object chosen for the background topology.
propsan hint of the properties of this digital topology, default is UNKNOWN.

Definition at line 66 of file DigitalTopology.ih.

: myKappa( aKappa ), myLambda( aLambda ),
myProps( props )
{
}
template<typename TForegroundAdjacency , typename TBackgroundAdjacency >
DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::~DigitalTopology ( )
inline

Destructor.

Definition at line 47 of file DigitalTopology.ih.

{
}
template<typename TForegroundAdjacency , typename TBackgroundAdjacency >
DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::DigitalTopology ( const DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency > &  other)
inline

Copy constructor.

Parameters:
otherthe object to clone.

Definition at line 83 of file DigitalTopology.ih.

: myKappa( other.myKappa ), myLambda( other.myLambda ),
myProps( other.myProps )
{
}
template<typename TForegroundAdjacency, typename TBackgroundAdjacency>
DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::DigitalTopology ( )
protected

Constructor. Forbidden by default (protected to avoid g++ warnings).


Member Function Documentation

template<typename TForegroundAdjacency, typename TBackgroundAdjacency>
DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::BOOST_CONCEPT_ASSERT ( (CAdjacency< ForegroundAdjacency >)  )
template<typename TForegroundAdjacency, typename TBackgroundAdjacency>
DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::BOOST_CONCEPT_ASSERT ( (CAdjacency< BackgroundAdjacency >)  )
template<typename TForegroundAdjacency , typename TBackgroundAdjacency >
bool DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::isValid ( ) const
inline

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.

Definition at line 168 of file DigitalTopology.ih.

{
return true;
}
template<typename TForegroundAdjacency , typename TBackgroundAdjacency >
const TForegroundAdjacency & DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::kappa ( ) const
inline
Returns:
a const reference to the foreground connectedness.

Definition at line 96 of file DigitalTopology.ih.

{
return myKappa;
}
template<typename TForegroundAdjacency , typename TBackgroundAdjacency >
const TBackgroundAdjacency & DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::lambda ( ) const
inline
Returns:
a const reference to the background connectedness.

Definition at line 107 of file DigitalTopology.ih.

{
return myLambda;
}
template<typename TForegroundAdjacency, typename TBackgroundAdjacency>
DigitalTopology& DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::operator= ( const DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency > &  other)
private

Assignment.

Parameters:
otherthe object to copy.
Returns:
a reference on 'this'. Forbidden by default.
template<typename TForegroundAdjacency , typename TBackgroundAdjacency >
DGtal::DigitalTopologyProperties DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::properties ( ) const
inline
Returns:
JORDAN iff the topology is Jordan, NOT_JORDAN iff the topology is known to be NOT_JORDAN, UNKNOWN otherwise.

Definition at line 119 of file DigitalTopology.ih.

{
return myProps;
}
template<typename TForegroundAdjacency , typename TBackgroundAdjacency >
DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::ReverseTopology DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::reverseTopology ( ) const
inline
Returns:
a digital topology object which is the reverse topology of this (ie.

\[ (\lambda,\kappa) \]

.

Definition at line 133 of file DigitalTopology.ih.

template<typename TForegroundAdjacency , typename TBackgroundAdjacency >
void DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::selfDisplay ( std::ostream &  out) const
inline

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.

Definition at line 149 of file DigitalTopology.ih.

References DGtal::JORDAN_DT, DGtal::NOT_JORDAN_DT, and DGtal::UNKNOWN_DT.

{
out << "[DigitalTopology kappa=" << myKappa
<< " lambda=" << myLambda;
if ( properties() == JORDAN_DT ) out << " [Jordan]";
else if ( properties() == NOT_JORDAN_DT ) out << " [Not Jordan]";
else if ( properties() == UNKNOWN_DT ) out << " [Unknown]";
else out << properties();
out << " ]";
}

Field Documentation

template<typename TForegroundAdjacency, typename TBackgroundAdjacency>
const ForegroundAdjacency& DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::myKappa
private

a const reference to the adjacency object chosen for the foreground topology.

Definition at line 187 of file DigitalTopology.h.

template<typename TForegroundAdjacency, typename TBackgroundAdjacency>
const BackgroundAdjacency& DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::myLambda
private

a const reference to the adjacency object chosen for the background topology.

Definition at line 193 of file DigitalTopology.h.

template<typename TForegroundAdjacency, typename TBackgroundAdjacency>
const DigitalTopologyProperties DGtal::DigitalTopology< TForegroundAdjacency, TBackgroundAdjacency >::myProps
private

an hint of the properties of this digital topology, default is UNKNOWN.

Definition at line 199 of file DigitalTopology.h.


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