Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
Menge::GraphVertex Class Reference

A graph vertex. More...

#include <GraphVertex.h>

Public Member Functions

 GraphVertex ()
 Constructor.
 
 ~GraphVertex ()
 Destructor.
 
GraphVertex & operator= (const GraphVertex &n)
 Assignment operator.
 
float getDistance (const GraphVertex &other)
 Computes the distance between this vertex and the given vertex. More...
 
float getDistance (size_t i) const
 Reports the distance to the ith neighbor. More...
 
void setID (size_t id)
 Sets the node identifier. More...
 
size_t getID () const
 Retrive the identifier for this node.
 
void setPosition (const Vector2 &p)
 Sets the graph vertex's position. More...
 
Vector2 getPosition () const
 Reports the position of the vertex. More...
 
void setEdge (const GraphEdge &edge, size_t i)
 Sets the ith edge for the vertex. More...
 
size_t getNeighborCount () const
 Reports the number of vertices adjacent to this vertex.
 
const GraphVertex * getNeighbor (size_t i) const
 Returns a pointer to the ith neighbor. More...
 
void setDegree (size_t degree)
 Sets the degree – the number of neighbors this vertex has. More...
 
size_t getEdgeCount () const
 Reports the number of edges on the node. More...
 
GraphEdge & getEdge (size_t i)
 Retrieves the ith edge connected to this node. More...
 
const GraphEdge & getEdge (size_t i) const
 Retrieves a const pointer to the ith edge connected to this node. More...
 

Protected Attributes

GraphEdge * _edges
 An array of edges connecting to other vertices.
 
size_t _edgeCount
 The number of edges connecting to this vertex.
 
Vector2 _pos
 The position of this vertex.
 
size_t _id
 The identifier for this vertex.
 

Detailed Description

A graph vertex.

Member Function Documentation

float Menge::GraphVertex::getDistance ( const GraphVertex &  other)
inline

Computes the distance between this vertex and the given vertex.

Parameters
otherThe other vertex.
Returns
The Euclidian distance between this vertex and the other vertex.
float Menge::GraphVertex::getDistance ( size_t  i) const

Reports the distance to the ith neighbor.

Parameters
iThe index of the desired neighbor.
Returns
The distance to the ith neghbor.
GraphEdge& Menge::GraphVertex::getEdge ( size_t  i)
inline

Retrieves the ith edge connected to this node.

Parameters
iThe local index of the desired edge.
Returns
A pointer to the ith edge.
const GraphEdge& Menge::GraphVertex::getEdge ( size_t  i) const
inline

Retrieves a const pointer to the ith edge connected to this node.

Parameters
iThe local index of the desired edge.
Returns
A pointer to the ith edge.
size_t Menge::GraphVertex::getEdgeCount ( ) const
inline

Reports the number of edges on the node.

Returns
The number of edges.
const GraphVertex * Menge::GraphVertex::getNeighbor ( size_t  i) const

Returns a pointer to the ith neighbor.

Parameters
iThe index of the neighboring vertex to retrieve. The index is defined in the range [0, N-1], where this vertex has N neighbors.
Returns
A pointer to the ith neighboring vertex.
Vector2 Menge::GraphVertex::getPosition ( ) const
inline

Reports the position of the vertex.

Returns
The position of the vertex.
void Menge::GraphVertex::setDegree ( size_t  degree)

Sets the degree – the number of neighbors this vertex has.

Parameters
degreeThe number of neighbors this vertex has.
void Menge::GraphVertex::setEdge ( const GraphEdge &  edge,
size_t  i 
)

Sets the ith edge for the vertex.

Parameters
edgeThe edge to set
iThe index to set.
void Menge::GraphVertex::setID ( size_t  id)
inline

Sets the node identifier.

Parameters
idThe identifier to set this node to.
void Menge::GraphVertex::setPosition ( const Vector2 &  p)
inline

Sets the graph vertex's position.

Parameters
pThe point value to set.

The documentation for this class was generated from the following files: