DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension > Class Template Reference

Aim: Describes digital adjacencies in a digital domain that are defined with the 1-norm and the infinity-norm. More...

#include <DomainMetricAdjacency.h>

Public Types

typedef Domain::Space Space
typedef Space::Point Point
typedef Space::Vector Vector

Public Member Functions

 DomainMetricAdjacency (const Domain &aDomain)
 DomainMetricAdjacency (const DomainMetricAdjacency &other)
 ~DomainMetricAdjacency ()
bool isAdjacentTo (const Point &p1, const Point &p2) const
bool isProperlyAdjacentTo (const Point &p1, const Point &p2) const
template<typename OutputIterator >
void writeNeighborhood (const Point &p, OutputIterator &out_it) const
template<typename OutputIterator >
void writeProperNeighborhood (const Point &p, OutputIterator &out_it) const
void selfDisplay (std::ostream &out) const
bool isValid () const

Protected Member Functions

 DomainMetricAdjacency ()

Private Member Functions

 BOOST_CONCEPT_ASSERT ((CDomain< Domain >))
DomainMetricAdjacencyoperator= (const DomainMetricAdjacency &other)

Private Attributes

const Domain & myDomain

Detailed Description

template<typename Domain, std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
class DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >

Aim: Describes digital adjacencies in a digital domain that are defined with the 1-norm and the infinity-norm.

Description of template class 'DomainMetricAdjacency'

It induces the classical 4 and 8 adjacencies in 2D, the 6, 18 and 26 adjacencies in 3D, and the $ \omega $ and $ \alpha $ adjacencies in nD.

Model of a CAdjacency.

Template Parameters:
Domain any domain of a digital space (see concept CDomain).
maxNorm1 defines which points are adjacent. More precisely, two points are adjacent iff their norm-infinity is less or equal than 1 and if their norm-1 is less or equal than maxNorm1.
Deprecated:
Use DomainAdjacency instead.

Member Typedef Documentation

template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
typedef Space::Point DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::Point
template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
typedef Domain::Space DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::Space
template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
typedef Space::Vector DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::Vector

Constructor & Destructor Documentation

template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::DomainMetricAdjacency ( const Domain &  aDomain  ) 

Constructor from domain.

Parameters:
aDomain any domain.
template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::DomainMetricAdjacency ( const DomainMetricAdjacency< Domain, maxNorm1, dimension > &  other  ) 

Copy constructor.

Parameters:
other the object to clone.
template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::~DomainMetricAdjacency (  ) 

Destructor.

template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::DomainMetricAdjacency (  )  [protected]

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


Member Function Documentation

template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::BOOST_CONCEPT_ASSERT ( (CDomain< Domain >)   )  [private]
template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
bool DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::isAdjacentTo ( const Point p1,
const Point p2 
) const
Parameters:
p1 any point in this space.
p2 any point in this space.
Returns:
'true' iff p1 is adjacent to p2 according to this adjacency relation.
template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
bool DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::isProperlyAdjacentTo ( const Point p1,
const Point p2 
) const
Parameters:
p1 any point in this space.
p2 any point in this space.
Returns:
'true' iff p1 is adjacent to p2 according to this adjacency relation and p1 != p2.
template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
bool DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::isValid (  )  const

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.
template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
DomainMetricAdjacency& DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::operator= ( const DomainMetricAdjacency< Domain, maxNorm1, dimension > &  other  )  [private]

Assignment.

Parameters:
other the object to copy.
Returns:
a reference on 'this'. Forbidden by default.
template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
void DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::selfDisplay ( std::ostream &  out  )  const

Writes/Displays the object on an output stream.

Parameters:
out the output stream where the object is written.
template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
template<typename OutputIterator >
void DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::writeNeighborhood ( const Point p,
OutputIterator &  out_it 
) const [inline]

Outputs the whole neighborhood of point [p] as a sequence of *out_it++ = ...

Template Parameters:
OutputIterator any output iterator (like std::back_insert_iterator< std::vector<int> >).
Parameters:
p any point of this space.
out_it any output iterator.
template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
template<typename OutputIterator >
void DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::writeProperNeighborhood ( const Point p,
OutputIterator &  out_it 
) const [inline]

Outputs the whole proper neighborhood of point [p] (thus without [p] itself) as a sequence of *out_it++ = ...

Template Parameters:
OutputIterator any output iterator (like std::back_insert_iterator< std::vector<int> >).
Parameters:
p any point of this space.
out_it any output iterator.

Field Documentation

template<typename Domain , std::size_t maxNorm1, std::size_t dimension = Domain::Space::staticDimension>
const Domain& DGtal::DomainMetricAdjacency< Domain, maxNorm1, dimension >::myDomain [private]

The associated domain.


The documentation for this class was generated from the following file:
Generated on Wed Sep 29 16:03:58 2010 for DGtal by  doxygen 1.6.3