DGtal  0.9.4beta
Public Member Functions | Data Fields
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

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

Invalid default constructor.

Definition at line 172 of file Object.h.

172 {}
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
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  }
Vertex vertices[2]
Definition: Object.h:167

Member Function Documentation

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.

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

209  {
210  return ( vertices[ 0 ] != other.vertices[ 0 ] )
211  || ( vertices[ 1 ] != other.vertices[ 1 ] );
212  }
Vertex vertices[2]
Definition: Object.h:167
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.

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

214  {
215  return ( vertices[ 0 ] < other.vertices[ 0 ] )
216  || ( ( vertices[ 0 ] == other.vertices[ 0 ] )
217  && ( vertices[ 1 ] < other.vertices[ 1 ] ) );
218  }
Vertex vertices[2]
Definition: Object.h:167
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.

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

204  {
205  return ( vertices[ 0 ] == other.vertices[ 0 ] )
206  && ( vertices[ 1 ] == other.vertices[ 1 ] );
207  }
Vertex vertices[2]
Definition: Object.h:167

Field Documentation

template<typename TDigitalTopology, typename TDigitalSet>
Vertex DGtal::Object< TDigitalTopology, TDigitalSet >::Edge::vertices[2]

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