DGtal 2.0.0
Loading...
Searching...
No Matches
DGtal::DigitalSurface< TDigitalSurfaceContainer >::Edge Struct Reference

#include <DGtal/topology/DigitalSurface.h>

Public Member Functions

 Edge (const Vertex &v1, const Vertex &v2)
bool operator== (const Edge &other) const
bool operator< (const Edge &other) const

Data Fields

Vertex vertices [2]
 The two vertices.

Detailed Description

template<typename TDigitalSurfaceContainer>
struct DGtal::DigitalSurface< TDigitalSurfaceContainer >::Edge

An edge is a unordered pair of vertices. To make comparisons easier, the smallest vertex is stored before the greatest vertex. Note that loops are legal.

Definition at line 192 of file DigitalSurface.h.

Constructor & Destructor Documentation

◆ Edge()

template<typename TDigitalSurfaceContainer>
DGtal::DigitalSurface< TDigitalSurfaceContainer >::Edge::Edge ( const Vertex & v1,
const Vertex & v2 )
inline

Constructor from vertices.

Parameters
v1the first vertex.
v2the second vertex.

Definition at line 200 of file DigitalSurface.h.

201 {
202 if ( v1 <= v2 )
203 {
204 vertices[ 0 ] = v1;
205 vertices[ 1 ] = v2;
206 }
207 else
208 {
209 vertices[ 0 ] = v2;
210 vertices[ 1 ] = v1;
211 }
212 }
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cell...

References vertices.

Referenced by operator<(), and operator==().

Member Function Documentation

◆ operator<()

template<typename TDigitalSurfaceContainer>
bool DGtal::DigitalSurface< TDigitalSurfaceContainer >::Edge::operator< ( const Edge & other) const
inline

Definition at line 218 of file DigitalSurface.h.

219 {
220 return ( vertices[ 0 ] < other.vertices[ 0 ] )
221 || ( ( vertices[ 0 ] == other.vertices[ 0 ] )
222 && ( vertices[ 1 ] < other.vertices[ 1 ] ) );
223 }

References Edge(), and vertices.

◆ operator==()

template<typename TDigitalSurfaceContainer>
bool DGtal::DigitalSurface< TDigitalSurfaceContainer >::Edge::operator== ( const Edge & other) const
inline

Definition at line 213 of file DigitalSurface.h.

214 {
215 return ( vertices[ 0 ] == other.vertices[ 0 ] )
216 && ( vertices[ 1 ] == other.vertices[ 1 ] );
217 }

References Edge(), and vertices.

Field Documentation

◆ vertices

template<typename TDigitalSurfaceContainer>
Vertex DGtal::DigitalSurface< TDigitalSurfaceContainer >::Edge::vertices[2]

The two vertices.

Definition at line 194 of file DigitalSurface.h.

Referenced by Edge(), operator<(), and operator==().


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