DGtal 1.3.0
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DGtal::DomainAdjacency< TDomain, TAdjacency > Class Template Reference

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>

Data Structures

struct  VertexMap
 

Public Types

typedef TDomain::Space Space
 
typedef TAdjacency Adjacency
 
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

 DomainAdjacency (ConstAlias< Domain > aDomain, ConstAlias< Adjacency > adjacency)
 
 DomainAdjacency (const DomainAdjacency &other)
 
 ~DomainAdjacency ()
 
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
 

Protected Member Functions

 DomainAdjacency ()
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CDomain< TDomain >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CAdjacency< TAdjacency >))
 
DomainAdjacencyoperator= (const DomainAdjacency &other)
 

Private Attributes

Predicate myPred
 
const AdjacencymyAdjacency
 

Detailed Description

template<typename TDomain, typename TAdjacency>
class DGtal::DomainAdjacency< TDomain, TAdjacency >

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

Description of template class 'DomainAdjacency'

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

Model of CAdjacency.

Template Parameters
TDomainthe type of the domain.
TAdjacencythe type of the adjacency.

Definition at line 73 of file DomainAdjacency.h.

Member Typedef Documentation

◆ Adjacency

template<typename TDomain , typename TAdjacency >
typedef TAdjacency DGtal::DomainAdjacency< TDomain, TAdjacency >::Adjacency

Definition at line 81 of file DomainAdjacency.h.

◆ Domain

template<typename TDomain , typename TAdjacency >
typedef TDomain DGtal::DomainAdjacency< TDomain, TAdjacency >::Domain

Definition at line 85 of file DomainAdjacency.h.

◆ Point

template<typename TDomain , typename TAdjacency >
typedef TDomain::Point DGtal::DomainAdjacency< TDomain, TAdjacency >::Point

Definition at line 82 of file DomainAdjacency.h.

◆ Predicate

template<typename TDomain , typename TAdjacency >
typedef functors::DomainPredicate< Domain > DGtal::DomainAdjacency< TDomain, TAdjacency >::Predicate

Definition at line 86 of file DomainAdjacency.h.

◆ Size

template<typename TDomain , typename TAdjacency >
typedef Space::Size DGtal::DomainAdjacency< TDomain, TAdjacency >::Size

Definition at line 90 of file DomainAdjacency.h.

◆ Space

template<typename TDomain , typename TAdjacency >
typedef TDomain::Space DGtal::DomainAdjacency< TDomain, TAdjacency >::Space

Definition at line 80 of file DomainAdjacency.h.

◆ Vertex

template<typename TDomain , typename TAdjacency >
typedef Point DGtal::DomainAdjacency< TDomain, TAdjacency >::Vertex

Definition at line 89 of file DomainAdjacency.h.

◆ VertexSet

template<typename TDomain , typename TAdjacency >
typedef DigitalSetSelector<Domain,SMALL_DS+HIGH_ITER_DS>::Type DGtal::DomainAdjacency< TDomain, TAdjacency >::VertexSet

Definition at line 92 of file DomainAdjacency.h.

Constructor & Destructor Documentation

◆ DomainAdjacency() [1/3]

template<typename TDomain , typename TAdjacency >
DGtal::DomainAdjacency< TDomain, TAdjacency >::DomainAdjacency ( ConstAlias< Domain aDomain,
ConstAlias< Adjacency adjacency 
)

Constructor.

Parameters
aDomainthe domain which restricts the given adjacency.
adjacencyany adjacency whose range contains the given domain aDomain.

◆ DomainAdjacency() [2/3]

template<typename TDomain , typename TAdjacency >
DGtal::DomainAdjacency< TDomain, TAdjacency >::DomainAdjacency ( const DomainAdjacency< TDomain, TAdjacency > &  other)

Copy constructor.

Parameters
otherthe object to clone.

◆ ~DomainAdjacency()

template<typename TDomain , typename TAdjacency >
DGtal::DomainAdjacency< TDomain, TAdjacency >::~DomainAdjacency ( )

Destructor.

◆ DomainAdjacency() [3/3]

template<typename TDomain , typename TAdjacency >
DGtal::DomainAdjacency< TDomain, TAdjacency >::DomainAdjacency ( )
protected

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

Member Function Documentation

◆ bestCapacity()

template<typename TDomain , typename TAdjacency >
Size DGtal::DomainAdjacency< TDomain, TAdjacency >::bestCapacity ( ) const
Returns
maximum number of neighbors for this adjacency

◆ BOOST_CONCEPT_ASSERT() [1/2]

template<typename TDomain , typename TAdjacency >
DGtal::DomainAdjacency< TDomain, TAdjacency >::BOOST_CONCEPT_ASSERT ( (concepts::CAdjacency< TAdjacency >)  )
private

◆ BOOST_CONCEPT_ASSERT() [2/2]

template<typename TDomain , typename TAdjacency >
DGtal::DomainAdjacency< TDomain, TAdjacency >::BOOST_CONCEPT_ASSERT ( (concepts::CDomain< TDomain >)  )
private

◆ degree()

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

◆ domain()

template<typename TDomain , typename TAdjacency >
const Domain & DGtal::DomainAdjacency< TDomain, TAdjacency >::domain ( ) const
Returns
a const reference to the associated domain.

◆ isAdjacentTo()

template<typename TDomain , typename TAdjacency >
bool DGtal::DomainAdjacency< TDomain, TAdjacency >::isAdjacentTo ( const Point p1,
const Point p2 
) const
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 TDomain , typename TAdjacency >
bool DGtal::DomainAdjacency< TDomain, TAdjacency >::isProperlyAdjacentTo ( const Point p1,
const Point p2 
) const
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 TDomain , typename TAdjacency >
bool DGtal::DomainAdjacency< TDomain, TAdjacency >::isValid ( ) const

Checks the validity/consistency of the object.

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

◆ operator=()

template<typename TDomain , typename TAdjacency >
DomainAdjacency & DGtal::DomainAdjacency< TDomain, TAdjacency >::operator= ( const DomainAdjacency< TDomain, TAdjacency > &  other)
private

Assignment.

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

◆ predicate()

template<typename TDomain , typename TAdjacency >
const Predicate & DGtal::DomainAdjacency< TDomain, TAdjacency >::predicate ( ) const
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()

template<typename TDomain , typename TAdjacency >
void DGtal::DomainAdjacency< TDomain, TAdjacency >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ writeNeighbors() [1/2]

template<typename TDomain , typename TAdjacency >
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
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 TDomain , typename TAdjacency >
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
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

Field Documentation

◆ myAdjacency

template<typename TDomain , typename TAdjacency >
const Adjacency& DGtal::DomainAdjacency< TDomain, TAdjacency >::myAdjacency
private

The adjacency relation.

Definition at line 234 of file DomainAdjacency.h.

◆ myPred

template<typename TDomain , typename TAdjacency >
Predicate DGtal::DomainAdjacency< TDomain, TAdjacency >::myPred
private

The predicate for testing if a point belongs to the domain.

Definition at line 229 of file DomainAdjacency.h.


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