the variables and methods that a Graph contains put in this file More...
#include <Graph.h>
Public Member Functions | |
Graph (int _width, int _height, int _precision, ngl::TransformStack *_t, ngl::Camera *_cam) | |
ctor | |
~Graph () | |
dtor | |
GridNodes * | getNode (int _index) |
get the Node | |
GraphEdge * | getEdge (int _From, int _to) |
get the edge of the node | |
void | addParticles () |
method to add particles | |
void | clearParticles () |
method to clear particles | |
void | draw () |
method to draw | |
void | assignOnOff (std::vector< int > _obstaclePositions) |
method to validate and invalidate the nodes | |
void | sortNodes () |
method to differenciate the nodes with obstacles and no obstacles | |
std::vector< ngl::Vec3 > | getObstacles () |
get the obstacle positions | |
std::vector< ngl::Vec3 > | getNoObstacles () |
get the vector for the positions without the obstacles | |
ngl::TransformStack * | getTransformStack () const |
get the transformation stack | |
const ngl::Camera * | getCamera () |
get camera | |
int | getNumofNodes () |
get no of Nodes | |
void | calculateEdges () |
method to calculate the edges | |
void | setContours () |
method to set the boundary to the obstacles for better obstacle avoidance | |
uint | getInitialPosition () |
get the random initial position | |
std::vector< std::vector < GraphEdge * > > | getEdgeList () |
method to get the edges list to sort the shortest path | |
std::vector< int > | adjacentNodeEdges (int index) |
method to get the adjacent nodes of a given node | |
Public Attributes | |
ngl::TransformStack * | m_tStack |
pointer to hold the stack | |
ngl::Camera * | m_cam |
pointer to the cam | |
Private Attributes | |
std::vector< GridNodes * > | m_nodes |
vector to hold the nodes of the graph | |
std::list< GraphEdge * > | m_allEdges |
list for the all edges | |
std::vector< std::vector < GraphEdge * > > | m_edgeList |
vector of vector containing the edge list of each node | |
std::vector< std::vector < GridNodes * > > | m_nodeGridNodes |
a vector of vector to hold the nodes an a 2D array for the calculation of edges | |
std::vector< ngl::Vec3 > | m_obstacles |
vector to hold the positions with obstacles | |
std::vector< ngl::Vec3 > | m_noObstacles |
vector to hold the positions without obstacles | |
std::vector< int > | m_obstaclePositions |
a vector containing indices with obstacles | |
std::vector< int > | m_noObstacleNodes |
vector with the indices without the obstacles | |
int | m_width |
variable for the width of the grid | |
int | m_height |
variable for the depth of the grid | |
int | m_precision |
variable for the precision | |
GLuint | m_texID |
variable to hold the texture | |
int | m_numOfNodes |
variable for the no of nodes | |
GraphEdge * | m_edge |
pointer to graph edge | |
SearchDijkstra * | m_findPath |
pointer to the path finding object | |
bool | m_pathFound |
bool to check if the path is found |
the variables and methods that a Graph contains put in this file
Definition at line 22 of file Graph.h.
Graph::Graph | ( | int | _width, | |
int | _height, | |||
int | _precision, | |||
ngl::TransformStack * | _t, | |||
ngl::Camera * | _cam | |||
) |
ctor
[in] | the | width for the map |
[in] | the | height for the map |
[in] | the | precision |
[in] | the | transformation stack |
[in] | the | cam |
Graph::~Graph | ( | ) |
dtor
void Graph::addParticles | ( | ) |
method to add particles
std::vector<int> Graph::adjacentNodeEdges | ( | int | index | ) |
method to get the adjacent nodes of a given node
[in] | _index | of the node |
void Graph::assignOnOff | ( | std::vector< int > | _obstaclePositions | ) |
method to validate and invalidate the nodes
[in] | _obstaclePositions | the int of indices |
void Graph::calculateEdges | ( | ) |
method to calculate the edges
void Graph::clearParticles | ( | ) |
method to clear particles
void Graph::draw | ( | ) |
method to draw
const ngl::Camera* Graph::getCamera | ( | ) | [inline] |
GraphEdge* Graph::getEdge | ( | int | _From, | |
int | _to | |||
) |
get the edge of the node
[in] | _from | and _to index for the edge |
std::vector<std::vector <GraphEdge *> > Graph::getEdgeList | ( | ) | [inline] |
method to get the edges list to sort the shortest path
Definition at line 104 of file Graph.h.
References m_edgeList.
00104 {return m_edgeList;}
uint Graph::getInitialPosition | ( | ) |
get the random initial position
GridNodes* Graph::getNode | ( | int | _index | ) |
get the Node
[in] | _index | of the node |
std::vector<ngl::Vec3> Graph::getNoObstacles | ( | ) | [inline] |
get the vector for the positions without the obstacles
Definition at line 76 of file Graph.h.
References m_noObstacles.
00076 {return m_noObstacles;}
int Graph::getNumofNodes | ( | ) | [inline] |
get no of Nodes
Definition at line 88 of file Graph.h.
References m_numOfNodes.
00088 {return m_numOfNodes;}
std::vector<ngl::Vec3> Graph::getObstacles | ( | ) | [inline] |
get the obstacle positions
Definition at line 72 of file Graph.h.
References m_obstacles.
00072 {return m_obstacles;}
ngl::TransformStack* Graph::getTransformStack | ( | ) | const [inline] |
void Graph::setContours | ( | ) |
method to set the boundary to the obstacles for better obstacle avoidance
void Graph::sortNodes | ( | ) |
method to differenciate the nodes with obstacles and no obstacles
std::list<GraphEdge *> Graph::m_allEdges [private] |
ngl::Camera* Graph::m_cam |
GraphEdge* Graph::m_edge [private] |
std::vector<std::vector <GraphEdge *> > Graph::m_edgeList [private] |
SearchDijkstra* Graph::m_findPath [private] |
int Graph::m_height [private] |
std::vector<std::vector <GridNodes *> > Graph::m_nodeGridNodes [private] |
std::vector<GridNodes *> Graph::m_nodes [private] |
std::vector<int> Graph::m_noObstacleNodes [private] |
std::vector<ngl::Vec3> Graph::m_noObstacles [private] |
int Graph::m_numOfNodes [private] |
std::vector<int> Graph::m_obstaclePositions [private] |
std::vector<ngl::Vec3> Graph::m_obstacles [private] |
bool Graph::m_pathFound [private] |
int Graph::m_precision [private] |
GLuint Graph::m_texID [private] |
ngl::TransformStack* Graph::m_tStack |
int Graph::m_width [private] |