DGtal  1.5.beta
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 <DGtal/topology/MetricAdjacency.h>

Data Structures

struct  VertexMap
 

Public Types

typedef TSpace Space
 
typedef Space::Point Point
 
typedef MetricAdjacency< Space, maxNorm1, dimension > Adjacency
 
typedef Space::Vector Vector
 
typedef Point Vertex
 
typedef Space::Size Size
 
typedef std::set< VertexVertexSet
 

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)
 
static Size bestCapacity ()
 
static Size degree (const Vertex &v)
 
template<typename OutputIterator >
static void writeNeighbors (OutputIterator &it, const Vertex &v)
 
template<typename OutputIterator , typename VertexPredicate >
static void writeNeighbors (OutputIterator &it, const Vertex &v, const VertexPredicate &pred)
 
static void selfDisplay (std::ostream &out)
 
static bool isValid ()
 

Static Protected Member Functions

static Size computeCapacity ()
 

Private Member Functions

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

Detailed Description

template<typename TSpace, Dimension maxNorm1, Dimension dimension = TSpace::dimension>
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 concepts::CAdjacency.

Template Parameters
TSpaceany digital space (see concept CSpace).
maxNorm1defines 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

Definition at line 79 of file MetricAdjacency.h.

Member Typedef Documentation

◆ Adjacency

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
typedef MetricAdjacency<Space, maxNorm1, dimension> DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::Adjacency

Definition at line 87 of file MetricAdjacency.h.

◆ Point

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
typedef Space::Point DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::Point

Definition at line 86 of file MetricAdjacency.h.

◆ Size

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
typedef Space::Size DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::Size

Definition at line 94 of file MetricAdjacency.h.

◆ Space

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
typedef TSpace DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::Space

Definition at line 85 of file MetricAdjacency.h.

◆ Vector

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
typedef Space::Vector DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::Vector

Definition at line 90 of file MetricAdjacency.h.

◆ Vertex

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
typedef Point DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::Vertex

Definition at line 93 of file MetricAdjacency.h.

◆ VertexSet

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
typedef std::set<Vertex> DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::VertexSet

Definition at line 95 of file MetricAdjacency.h.

Constructor & Destructor Documentation

◆ MetricAdjacency() [1/2]

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::MetricAdjacency ( )

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

◆ ~MetricAdjacency()

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::~MetricAdjacency ( )

Destructor.

◆ MetricAdjacency() [2/2]

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::MetricAdjacency ( const MetricAdjacency< TSpace, maxNorm1, dimension > &  other)
private

Copy constructor.

Parameters
otherthe object to clone. Forbidden by default.

Member Function Documentation

◆ bestCapacity()

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
static Size DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::bestCapacity ( )
static
Returns
maximum number of neighbors for this adjacency

◆ BOOST_CONCEPT_ASSERT()

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::BOOST_CONCEPT_ASSERT ( (concepts::CSpace< TSpace >)  )
private

◆ computeCapacity()

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
static Size DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::computeCapacity ( )
staticprotected

◆ degree()

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
static Size DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::degree ( const Vertex v)
static
Parameters
vany vertex
Returns
the number of neighbors of this vertex

◆ isAdjacentTo()

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
static bool DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::isAdjacentTo ( const Point p1,
const Point p2 
)
static
Parameters
p1any point in this space.
p2any point in this space.
Returns
'true' iff p1 is adjacent to p2 according to this adjacency relation.

◆ isProperlyAdjacentTo()

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
static bool DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::isProperlyAdjacentTo ( const Point p1,
const Point p2 
)
static
Parameters
p1any point in this space.
p2any point in this space.
Returns
'true' iff p1 is adjacent to p2 according to this adjacency relation and p1 != p2.

◆ isValid()

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
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.

◆ operator=()

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
MetricAdjacency& DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::operator= ( const MetricAdjacency< TSpace, maxNorm1, dimension > &  other)
private

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.

◆ selfDisplay()

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
static void DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::selfDisplay ( std::ostream &  out)
static

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ writeNeighbors() [1/2]

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
template<typename OutputIterator >
static void DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::writeNeighbors ( OutputIterator &  it,
const Vertex v 
)
static

Writes the neighbors of a vertex using an output iterator

Template Parameters
OutputIteratorthe type of an output iterator writing in a container of vertices.
Parameters
itthe output iterator
vthe vertex whose neighbors will be writen

◆ writeNeighbors() [2/2]

template<typename TSpace , Dimension maxNorm1, Dimension dimension = TSpace::dimension>
template<typename OutputIterator , typename VertexPredicate >
static void DGtal::MetricAdjacency< TSpace, maxNorm1, dimension >::writeNeighbors ( OutputIterator &  it,
const Vertex v,
const VertexPredicate &  pred 
)
static

Writes the neighbors of a vertex which satisfy a predicate using an output iterator

Template Parameters
OutputIteratorthe type of an output iterator writing in a container of vertices.
VertexPredicatethe type of the predicate
Parameters
itthe output iterator
vthe vertex whose neighbors will be written
predthe predicate that must be satisfied

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