A graph vertex.
More...
#include <GraphVertex.h>
|
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.
|
|
float Menge::GraphVertex::getDistance |
( |
const GraphVertex & |
other | ) |
|
|
inline |
Computes the distance between this vertex and the given vertex.
- Parameters
-
- 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
-
i | The 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
-
i | The 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
-
i | The 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
-
i | The 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
-
degree | The number of neighbors this vertex has. |
void Menge::GraphVertex::setEdge |
( |
const GraphEdge & |
edge, |
|
|
size_t |
i |
|
) |
| |
Sets the ith edge for the vertex.
- Parameters
-
edge | The edge to set |
i | The index to set. |
void Menge::GraphVertex::setID |
( |
size_t |
id | ) |
|
|
inline |
Sets the node identifier.
- Parameters
-
id | The identifier to set this node to. |
void Menge::GraphVertex::setPosition |
( |
const Vector2 & |
p | ) |
|
|
inline |
Sets the graph vertex's position.
- Parameters
-
The documentation for this class was generated from the following files:
- src/menge/MengeCore/resources/GraphVertex.h
- src/menge/MengeCore/resources/GraphVertex.cpp