void NDTileMapGraph::setGraphNode_Exit( int rowIndex, int colIndex ) { GRAPH_NODE* graphNode = getGraphNode( rowIndex, colIndex ); if (graphNode) { graphNode->isExit = true; } }
Node * SceneGraph::appendChildTo(int index, Node * child) { Node * parent = getGraphNode(index); parent->addChild(child); if(child->getSceneGraphIndex() < 0) { nodes.push_back(child); child->setSceneGraphIndex(nodes.size() - 1); } return child; }
GRAPH_NODE* NDTileMapGraph::setGraphNode( int rowIndex, int colIndex, bool left, bool up, bool right, bool down ) { GRAPH_NODE* graphNode = getGraphNode( rowIndex, colIndex ); if (graphNode) { graphNode->rowIndex = rowIndex; graphNode->colIndex = colIndex; graphNode->left = left; graphNode->up = up; graphNode->right = right; graphNode->down = down; } return graphNode; }
void Graph :: drawneighboredges(int ndid, bool forshade, double thick){ double RADIUS = 0.01; double HALOSIZE = 1.1; GraphNode * gn = getGraphNode(ndid); vector<GraphEdge *> edgelist = gn -> edgesvec(); for (int e=0; e<edgelist.size(); e++) { if (forshade) { glBegin(GL_QUADS); vec3d point1 = edgelist.at(e)->get_from()->getPos(); vec3d point2 = edgelist.at(e)->get_to()->getPos(); vec3d tang = point2 - point1; glNormal3f(tang.x, tang.y, tang.z); glTexCoord4f(-1.0*RADIUS * HALOSIZE, RADIUS, 0.0, 0.0); //glTexCoord3f(-1.0, alpha, thick); glVertex3f(point1.x, point1.y, point1.z); glTexCoord4f(RADIUS * HALOSIZE, RADIUS, 0.0, 0.0); //glTexCoord3f(1.0, alpha, thick); glVertex3f(point1.x, point1.y, point1.z); glNormal3f(tang.x, tang.y, tang.z); glTexCoord4f(RADIUS * HALOSIZE, RADIUS, 0.0, 0.0); //glTexCoord3f(1.0, alpha, thick); glVertex3f(point2.x, point2.y, point2.z); glTexCoord4f(-1.0*RADIUS * HALOSIZE, RADIUS, 0.0, 0.0); //glTexCoord3f(-1.0, alpha, thick); glVertex3f(point2.x, point2.y, point2.z); glEnd(); } else { glLineWidth(thick); glBegin(GL_LINES); vec3d point1 = edgelist.at(e)->get_from()->getPos(); vec3d point2 = edgelist.at(e)->get_to()->getPos(); glVertex3d(point1.x, point1.y, point1.z); glVertex3d(point2.x, point2.y, point2.z); glEnd(); } } }
const GRAPH_NODE* NDTileMapGraph::getGraphNode_Const( int tileX, int tileY ) { return getGraphNode( tileY, tileX, false ); }