Graph Class Reference

the variables and methods that a Graph contains put in this file More...

#include <Graph.h>

Collaboration diagram for Graph:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Graph (int _width, int _height, int _precision, ngl::TransformStack *_t, ngl::Camera *_cam)
 ctor
 ~Graph ()
 dtor
GridNodesgetNode (int _index)
 get the Node
GraphEdgegetEdge (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
GraphEdgem_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

Detailed Description

the variables and methods that a Graph contains put in this file

Definition at line 22 of file Graph.h.


Constructor & Destructor Documentation

Graph::Graph ( int  _width,
int  _height,
int  _precision,
ngl::TransformStack *  _t,
ngl::Camera *  _cam 
)

ctor

Parameters:
[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


Member Function Documentation

void Graph::addParticles (  ) 

method to add particles

std::vector<int> Graph::adjacentNodeEdges ( int  index  ) 

method to get the adjacent nodes of a given node

Parameters:
[in] _index of the node
void Graph::assignOnOff ( std::vector< int >  _obstaclePositions  ) 

method to validate and invalidate the nodes

Parameters:
[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]

get camera

Definition at line 84 of file Graph.h.

References m_cam.

00084 {return m_cam;}

GraphEdge* Graph::getEdge ( int  _From,
int  _to 
)

get the edge of the node

Parameters:
[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

Parameters:
[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]

get the transformation stack

Definition at line 80 of file Graph.h.

References m_tStack.

00080 {return m_tStack;}

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


Member Data Documentation

std::list<GraphEdge *> Graph::m_allEdges [private]

list for the all edges

Definition at line 127 of file Graph.h.

ngl::Camera* Graph::m_cam

pointer to the cam

Definition at line 117 of file Graph.h.

pointer to graph edge

Definition at line 175 of file Graph.h.

std::vector<std::vector <GraphEdge *> > Graph::m_edgeList [private]

vector of vector containing the edge list of each node

Definition at line 131 of file Graph.h.

SearchDijkstra* Graph::m_findPath [private]

pointer to the path finding object

Definition at line 179 of file Graph.h.

int Graph::m_height [private]

variable for the depth of the grid

Definition at line 159 of file Graph.h.

std::vector<std::vector <GridNodes *> > Graph::m_nodeGridNodes [private]

a vector of vector to hold the nodes an a 2D array for the calculation of edges

Definition at line 135 of file Graph.h.

std::vector<GridNodes *> Graph::m_nodes [private]

vector to hold the nodes of the graph

Definition at line 123 of file Graph.h.

std::vector<int> Graph::m_noObstacleNodes [private]

vector with the indices without the obstacles

Definition at line 151 of file Graph.h.

std::vector<ngl::Vec3> Graph::m_noObstacles [private]

vector to hold the positions without obstacles

Definition at line 143 of file Graph.h.

int Graph::m_numOfNodes [private]

variable for the no of nodes

Definition at line 171 of file Graph.h.

std::vector<int> Graph::m_obstaclePositions [private]

a vector containing indices with obstacles

Definition at line 147 of file Graph.h.

std::vector<ngl::Vec3> Graph::m_obstacles [private]

vector to hold the positions with obstacles

Definition at line 139 of file Graph.h.

bool Graph::m_pathFound [private]

bool to check if the path is found

Definition at line 183 of file Graph.h.

int Graph::m_precision [private]

variable for the precision

Definition at line 163 of file Graph.h.

GLuint Graph::m_texID [private]

variable to hold the texture

Definition at line 167 of file Graph.h.

ngl::TransformStack* Graph::m_tStack

pointer to hold the stack

Definition at line 113 of file Graph.h.

int Graph::m_width [private]

variable for the width of the grid

Definition at line 155 of file Graph.h.


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

Generated on 16 Aug 2013 for Multi-AgentSystem by  doxygen 1.6.1