DGtal  1.5.beta
DGtal::Object< TDigitalTopology, TDigitalSet >::Edge Struct Reference

#include <DGtal/topology/Object.h>

Public Member Functions

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

Data Fields

Vertex vertices [2]
 

Detailed Description

template<typename TDigitalTopology, typename TDigitalSet>
struct DGtal::Object< TDigitalTopology, TDigitalSet >::Edge

Definition at line 165 of file Object.h.

Constructor & Destructor Documentation

◆ Edge() [1/3]

template<typename TDigitalTopology , typename TDigitalSet >
DGtal::Object< TDigitalTopology, TDigitalSet >::Edge::Edge ( )
inline

Invalid default constructor.

Definition at line 172 of file Object.h.

172 {}

◆ Edge() [2/3]

template<typename TDigitalTopology , typename TDigitalSet >
DGtal::Object< TDigitalTopology, TDigitalSet >::Edge::Edge ( const Vertex v1,
const Vertex v2,
const bool   
)
inline

Constructor from vertices with no auto-order.

Parameters
v1the first vertex.
v2the second vertex.

Definition at line 179 of file Object.h.

180  {
181  vertices[ 0 ] = v1;
182  vertices[ 1 ] = v2;
183  }
Vertex vertices[2]
Definition: Object.h:167

References DGtal::Object< TDigitalTopology, TDigitalSet >::Edge::vertices.

◆ Edge() [3/3]

template<typename TDigitalTopology , typename TDigitalSet >
DGtal::Object< TDigitalTopology, TDigitalSet >::Edge::Edge ( const Vertex v1,
const Vertex v2 
)
inline

Constructor from vertices with auto-ordering.

Parameters
v1the first vertex.
v2the second vertex.
Note
Edge(v1,v2) = Edge(v2,v1), stored vertices[0] will be the lowest of the two.

Definition at line 190 of file Object.h.

191  {
192  if ( v1 <= v2 )
193  {
194  vertices[ 0 ] = v1;
195  vertices[ 1 ] = v2;
196  }
197  else
198  {
199  vertices[ 0 ] = v2;
200  vertices[ 1 ] = v1;
201  }
202  }

References DGtal::Object< TDigitalTopology, TDigitalSet >::Edge::vertices.

Member Function Documentation

◆ operator!=()

template<typename TDigitalTopology , typename TDigitalSet >
bool DGtal::Object< TDigitalTopology, TDigitalSet >::Edge::operator!= ( const Edge other) const
inline

Definition at line 208 of file Object.h.

209  {
210  return ( vertices[ 0 ] != other.vertices[ 0 ] )
211  || ( vertices[ 1 ] != other.vertices[ 1 ] );
212  }

References DGtal::Object< TDigitalTopology, TDigitalSet >::Edge::vertices.

◆ operator<()

template<typename TDigitalTopology , typename TDigitalSet >
bool DGtal::Object< TDigitalTopology, TDigitalSet >::Edge::operator< ( const Edge other) const
inline

Definition at line 213 of file Object.h.

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

References DGtal::Object< TDigitalTopology, TDigitalSet >::Edge::vertices.

◆ operator==()

template<typename TDigitalTopology , typename TDigitalSet >
bool DGtal::Object< TDigitalTopology, TDigitalSet >::Edge::operator== ( const Edge other) const
inline

Definition at line 203 of file Object.h.

204  {
205  return ( vertices[ 0 ] == other.vertices[ 0 ] )
206  && ( vertices[ 1 ] == other.vertices[ 1 ] );
207  }

References DGtal::Object< TDigitalTopology, TDigitalSet >::Edge::vertices.

Field Documentation

◆ vertices


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