DGtal  1.0.0
Public Member Functions | Data Fields
DGtal::HalfEdgeDataStructure::Edge Struct Reference

#include <DGtal/topology/HalfEdgeDataStructure.h>

Public Member Functions

VertexIndexstart ()
 
const VertexIndexstart () const
 
VertexIndexend ()
 
const VertexIndexend () const
 
 Edge ()
 
 Edge (VertexIndex vi, VertexIndex vj)
 
bool operator< (const Edge &other) const
 

Data Fields

VertexIndex v [2]
 The two vertex indices. More...
 

Detailed Description

Represents an unoriented edge as two vertex indices, the first lower than the second.

Definition at line 130 of file HalfEdgeDataStructure.h.

Constructor & Destructor Documentation

◆ Edge() [1/2]

DGtal::HalfEdgeDataStructure::Edge::Edge ( )
inline

Definition at line 141 of file HalfEdgeDataStructure.h.

142  {
143  v[0] = v[1] = -1;
144  }

◆ Edge() [2/2]

DGtal::HalfEdgeDataStructure::Edge::Edge ( VertexIndex  vi,
VertexIndex  vj 
)
inline

Definition at line 145 of file HalfEdgeDataStructure.h.

146  {
147  if ( vi <= vj ) { v[0] = vi; v[1] = vj; }
148  else { v[0] = vj; v[1] = vi; }
149  }

Member Function Documentation

◆ end() [1/2]

VertexIndex& DGtal::HalfEdgeDataStructure::Edge::end ( )
inline

Definition at line 138 of file HalfEdgeDataStructure.h.

138 { return v[1]; }

Referenced by operator<().

◆ end() [2/2]

const VertexIndex& DGtal::HalfEdgeDataStructure::Edge::end ( ) const
inline

Definition at line 139 of file HalfEdgeDataStructure.h.

139 { return v[1]; }

◆ operator<()

bool DGtal::HalfEdgeDataStructure::Edge::operator< ( const Edge other) const
inline

Definition at line 150 of file HalfEdgeDataStructure.h.

151  {
152  return ( start() < other.start() )
153  || ( ( start() == other.start() ) && ( end() < other.end() ) );
154  }

References end(), and start().

◆ start() [1/2]

VertexIndex& DGtal::HalfEdgeDataStructure::Edge::start ( )
inline

Definition at line 135 of file HalfEdgeDataStructure.h.

135 { return v[0]; }

Referenced by operator<().

◆ start() [2/2]

const VertexIndex& DGtal::HalfEdgeDataStructure::Edge::start ( ) const
inline

Definition at line 136 of file HalfEdgeDataStructure.h.

136 { return v[0]; }

Field Documentation

◆ v

VertexIndex DGtal::HalfEdgeDataStructure::Edge::v[2]

The two vertex indices.

Definition at line 133 of file HalfEdgeDataStructure.h.


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