Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions

DGtal::MetricAdjacency< TSpace, maxNorm1, dimension > Class Template Reference

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

#include <MetricAdjacency.h>

Public Types

typedef TSpace Space
typedef Space::Point Point
typedef MetricAdjacency< Space,
maxNorm1, dimension > 
Adjacency
typedef Space::Vector Vector

Public Member Functions

 MetricAdjacency ()
 ~MetricAdjacency ()

Static Public Member Functions

static bool isAdjacentTo (const Point &p1, const Point &p2)
static bool isProperlyAdjacentTo (const Point &p1, const Point &p2)
template<typename OutputIterator , typename PointPredicate >
static void writeNeighborhood (const Point &p, OutputIterator &out_it, const PointPredicate &pred)
template<typename OutputIterator >
static void writeNeighborhood (const Point &p, OutputIterator &out_it)
template<typename OutputIterator , typename PointPredicate >
static void writeProperNeighborhood (const Point &p, OutputIterator &out_it, const PointPredicate &pred)
template<typename OutputIterator >
static void writeProperNeighborhood (const Point &p, OutputIterator &out_it)
static void selfDisplay (std::ostream &out)
static bool isValid ()

Private Member Functions

 BOOST_CONCEPT_ASSERT ((CSpace< TSpace >))
 MetricAdjacency (const MetricAdjacency &other)
MetricAdjacencyoperator= (const MetricAdjacency &other)

Detailed Description

template<typename TSpace, std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
class DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >

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

Description of template class 'MetricAdjacency'

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:
TSpace any digital space (see concept CSpace).
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.
See also:
testAdjacency.cpp

Member Typedef Documentation

template<typename TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
typedef MetricAdjacency<Space, maxNorm1, dimension> DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::Adjacency
template<typename TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
typedef Space::Point DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::Point
template<typename TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
typedef TSpace DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::Space
template<typename TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
typedef Space::Vector DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::Vector

Constructor & Destructor Documentation

template<typename TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::MetricAdjacency (  ) 

Constructor. Does nothing. Due to the symmetry and translation invariance of this digital topology, all methods are static.

template<typename TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::~MetricAdjacency (  ) 

Destructor.

template<typename TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::MetricAdjacency ( const MetricAdjacency< TSpace, maxNorm1, dimension > &  other  )  [private]

Copy constructor.

Parameters:
other the object to clone. Forbidden by default.

Member Function Documentation

template<typename TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::BOOST_CONCEPT_ASSERT ( (CSpace< TSpace >)   )  [private]
template<typename TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
static bool DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::isAdjacentTo ( const Point p1,
const Point p2 
) [static]
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 TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
static bool DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::isProperlyAdjacentTo ( const Point p1,
const Point p2 
) [static]
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 TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
static bool DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::isValid (  )  [static]

Checks the validity/consistency of the object.

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

Assignment.

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

Writes/Displays the object on an output stream.

Parameters:
out the output stream where the object is written.
template<typename TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
template<typename OutputIterator , typename PointPredicate >
static void DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::writeNeighborhood ( const Point p,
OutputIterator &  out_it,
const PointPredicate &  pred 
) [static]

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

Template Parameters:
OutputIterator any output iterator (like std::back_insert_iterator< std::vector<int> >).
PointPredicate any predicate type.
Parameters:
p any point of this space.
out_it any output iterator.
pred the predicate.
template<typename TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
template<typename OutputIterator >
static void DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::writeNeighborhood ( const Point p,
OutputIterator &  out_it 
) [static]

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 TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
template<typename OutputIterator >
static void DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::writeProperNeighborhood ( const Point p,
OutputIterator &  out_it 
) [static]

Outputs the whole neighborhood of point [p] (except 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.
template<typename TSpace , std::size_t maxNorm1, std::size_t dimension = TSpace::staticDimension>
template<typename OutputIterator , typename PointPredicate >
static void DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::writeProperNeighborhood ( const Point p,
OutputIterator &  out_it,
const PointPredicate &  pred 
) [static]

Outputs the whole neighborhood of point [p] (except p itself) satisfying the given predicate as a sequence of *out_it++ = ...

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

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