DGtal 2.1.0
Loading...
Searching...
No Matches
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.
 

Detailed Description

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

Definition at line 126 of file HalfEdgeDataStructure.h.

Constructor & Destructor Documentation

◆ Edge() [1/2]

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

Definition at line 137 of file HalfEdgeDataStructure.h.

138 {
139 v[0] = v[1] = -1;
140 }
VertexIndex v[2]
The two vertex indices.

References v.

◆ Edge() [2/2]

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

Definition at line 141 of file HalfEdgeDataStructure.h.

142 {
143 if ( vi <= vj ) { v[0] = vi; v[1] = vj; }
144 else { v[0] = vj; v[1] = vi; }
145 }

References v.

Member Function Documentation

◆ end() [1/2]

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

Definition at line 134 of file HalfEdgeDataStructure.h.

134{ return v[1]; }

References v.

Referenced by operator<().

◆ end() [2/2]

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

Definition at line 135 of file HalfEdgeDataStructure.h.

135{ return v[1]; }

References v.

◆ operator<()

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

Definition at line 146 of file HalfEdgeDataStructure.h.

147 {
148 return ( start() < other.start() )
149 || ( ( start() == other.start() ) && ( end() < other.end() ) );
150 }

References end(), and start().

◆ start() [1/2]

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

Definition at line 131 of file HalfEdgeDataStructure.h.

131{ return v[0]; }

References v.

Referenced by operator<().

◆ start() [2/2]

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

Definition at line 132 of file HalfEdgeDataStructure.h.

132{ return v[0]; }

References v.

Field Documentation

◆ v

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

The two vertex indices.

Definition at line 129 of file HalfEdgeDataStructure.h.

Referenced by Edge(), Edge(), end(), end(), start(), and start().


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