DGtal  1.0.0

Aim: Given a domain and an adjacency, limits the given adjacency to the specified domain for all adjacency and neighborhood computations. More...

#include <DGtal/topology/DomainAdjacency.h>

[legend]
[legend]

## Data Structures

struct  VertexMap

## Public Types

typedef TDomain::Space Space

typedef TDomain::Point Point

typedef TDomain Domain

typedef functors::DomainPredicate< DomainPredicate

typedef Point Vertex

typedef Space::Size Size

typedef DigitalSetSelector< Domain, SMALL_DS+HIGH_ITER_DS >::Type VertexSet

## Public Member Functions

const Domaindomain () const

const Predicatepredicate () const

bool isAdjacentTo (const Point &p1, const Point &p2) const

bool isProperlyAdjacentTo (const Point &p1, const Point &p2) const

Size bestCapacity () const

Size degree (const Vertex &v) const

template<typename OutputIterator >
void writeNeighbors (OutputIterator &it, const Vertex &v) const

template<typename OutputIterator , typename VertexPredicate >
void writeNeighbors (OutputIterator &it, const Vertex &v, const VertexPredicate &pred) const

void selfDisplay (std::ostream &out) const

bool isValid () const

## Private Member Functions

BOOST_CONCEPT_ASSERT ((concepts::CDomain< TDomain >))

Predicate myPred

## Detailed Description

Aim: Given a domain and an adjacency, limits the given adjacency to the specified domain for all adjacency and neighborhood computations.

This class is useful for limiting adjacencies that are defined for unlimited spaces.

Template Parameters
 TDomain the type of the domain. TAdjacency the type of the adjacency.

Definition at line 73 of file DomainAdjacency.h.

## Member Typedef Documentation

Definition at line 81 of file DomainAdjacency.h.

## ◆ Domain

Definition at line 85 of file DomainAdjacency.h.

## ◆ Point

Definition at line 82 of file DomainAdjacency.h.

## ◆ Predicate

Definition at line 86 of file DomainAdjacency.h.

## ◆ Size

Definition at line 90 of file DomainAdjacency.h.

## ◆ Space

Definition at line 80 of file DomainAdjacency.h.

## ◆ Vertex

Definition at line 89 of file DomainAdjacency.h.

## ◆ VertexSet

Definition at line 92 of file DomainAdjacency.h.

## Constructor & Destructor Documentation

Constructor.

Parameters

Copy constructor.

Parameters
 other the object to clone.

Destructor.

protected

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

## ◆ bestCapacity()

Returns
maximum number of neighbors for this adjacency

private

private

## ◆ degree()

 Size DGtal::DomainAdjacency< TDomain, TAdjacency >::degree ( const Vertex & v ) const
Parameters
 v any vertex
Returns
the number of neighbors of this vertex

## ◆ domain()

Returns
a const reference to the associated domain.

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.

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.

## ◆ isValid()

Checks the validity/consistency of the object.

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

## ◆ operator=()

private

Assignment.

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

## ◆ predicate()

Returns
a const reference on the predicate which can check if a given point belongs to the domain.

Useful if you want to restrict your neighborhood.

## ◆ selfDisplay()

Writes/Displays the object on an output stream.

Parameters
 out the output stream where the object is written.

## ◆ writeNeighbors() [1/2]

template<typename OutputIterator >
 void DGtal::DomainAdjacency< TDomain, TAdjacency >::writeNeighbors ( OutputIterator & it, const Vertex & v ) const

Writes the neighbors of a vertex using an output iterator

Template Parameters
 OutputIterator the type of an output iterator writing in a container of vertices.
Parameters
 it the output iterator v the vertex whose neighbors will be writen

## ◆ writeNeighbors() [2/2]

template<typename OutputIterator , typename VertexPredicate >
 void DGtal::DomainAdjacency< TDomain, TAdjacency >::writeNeighbors ( OutputIterator & it, const Vertex & v, const VertexPredicate & pred ) const

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

Template Parameters
 OutputIterator the type of an output iterator writing in a container of vertices. VertexPredicate the type of the predicate
Parameters
 it the output iterator v the vertex whose neighbors will be written pred the predicate that must be satisfied

## Field Documentation

private

Definition at line 234 of file DomainAdjacency.h.