DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Data Fields
DGtal::Object< TDigitalTopology, TDigitalSet >::Edge Struct Reference

#include <Object.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]

Detailed Description

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

Definition at line 120 of file Object.h.


Constructor & Destructor Documentation

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

Constructor from vertices.

Parameters:
v1the first vertex.
v2the second vertex.

Definition at line 129 of file Object.h.

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

{
if ( v1 <= v2 )
{
vertices[ 0 ] = v1;
vertices[ 1 ] = v2;
}
else
{
vertices[ 0 ] = v2;
vertices[ 1 ] = v1;
}
}

Member Function Documentation

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

Definition at line 147 of file Object.h.

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

{
return ( vertices[ 0 ] < other.vertices[ 0 ] )
|| ( ( vertices[ 0 ] == other.vertices[ 0 ] )
&& ( vertices[ 1 ] < other.vertices[ 1 ] ) );
}
template<typename TDigitalTopology, typename TDigitalSet>
bool DGtal::Object< TDigitalTopology, TDigitalSet >::Edge::operator== ( const Edge other) const
inline

Definition at line 142 of file Object.h.

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

{
return ( vertices[ 0 ] == other.vertices[ 0 ] )
&& ( vertices[ 1 ] == other.vertices[ 1 ] );
}

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: