// Debug //------------------------------------------------------------------------------ void VertexData::print() { printf("\nVertices:\n"); printVertices(); printf("\nNormals:\n"); printNormals(); printf("\nTangents:\n");printTangents(); printf("\nBinormals:\n"); printBinormals(); printf("\nTexCoords:\n"); printTexCoords(); printf("\nTriangles:\n"); printTriangles(); }
void Graph::print () { std::cout << "PRINTING GRAPH:" << std::endl; for (int v = 0; v < size; v++) { std::cout << "VERTEX " << v << " adj="; printVertices(adjacencySets[v]); std::cout << std::endl; } std::cout << std::endl; }
std::ostream& ossimQuadTreeWarp::print(std::ostream& out) const { if(!isEmpty()) { out << "___________VERTEX LIST____________________\n"; printVertices(out); out << "___________TREE LIST____________________\n"; recursivePrint(out, theTree); } else { out << "<empty tree>\n"; } return out; }
void biconn(int node, int parent) { Ncalls++; if(DEBUG) printStack(FALSE); if(DEBUG) printVertices(); //eS_left is local int eS_left = eS_right; cv++; if(DEBUG) printEdgeStack(TREE_EDGE, eS_left); int i, index, test_node, test_node_index, node_color, new_parent, parent_index; index = node - 1; cv++; parent_index = parent - 1; cv++; cvi[index]++; vertices[index]->color = GRAY; cv++; cvi[index]++; vertices[index]->num = Gnum; cv++; cvi[index]++; vertices[index]->low = vertices[index]->num; cv++; cvi[index]++; new_parent = node; cv++; cvi[index]++; Gnum++; cv++; cvi[index]++; //Push it onto the vertex stack vertexStack[stackEnd] = node; cv++; cvi[index]++; vertices[index]->stackPos = stackEnd; cv++; cvi[index]++; stackEnd++; cv++; //Loop over the vertices in the adjacency list for this node for(i = 1; i < nEdges[index] + 1; i++) { ce += 2; test_node = adjlist[index][i]; ce++; test_node_index = test_node - 1; ce++; node_color = vertices[test_node_index]->color; ce++; ce++; if(node_color == WHITE) //forward edge { edgeStack[eS_right]->tail = node; ce++; edgeStack[eS_right]->head = test_node; ce++; eS_right++; ce++; biconn(test_node, new_parent); ce++; } else if(node_color == GRAY && test_node != parent) //Back edge not to the parent { ce++; if(vertices[test_node_index]->num < vertices[index]->num) //The vertex was visited before the current vertex { ce++; //Lesser but not parent, pass on the goodness vertices[index]->low = getLow(vertices[index]->low , vertices[test_node_index]->num); ce++; //Push edge on to the stack edgeStack[eS_right]->tail = node; ce++; edgeStack[eS_right]->head = test_node; ce++; eS_right++; ce++; if(DEBUG) printEdgeStack(FORWARD_EDGE, eS_left); } else { printf("debug_info : I deduce that this will never occur\n"); } } } //Backtracking to parent if(parent != DUMMY_PARENT) { vertices[parent_index]->low = getLow(vertices[parent_index]->low, vertices[index]->low); cv++; cvi[index]++; if(vertices[index]->low < vertices[parent_index]->num ) { cv++; cvi[index]++; //Move back the current element stack pointer if(DEBUG) printEdgeStack(BACKWARD_EDGE, eS_left); } else //Break the bond { cv += 2; cvi[index] += 2; //Parent is an articulation point //Search if it is already present in the articulation points list. Else add the vertex. artPoints[artIndex] = parent; cv++; cvi[index]++; artIndex++; cv++; cvi[index]++; //Strip out the edges corresponding to this articulatio point if(DEBUG) printBiconn(eS_left-1, eS_right); //Add biconnected components vertices. //Search the array to check if the vertex is already there. Else add the vertex storeBiconnVerts(eS_left-1, eS_right); cv += 5*(eS_right-eS_left+1); cvi[index] += 5*(eS_right-eS_left+1); eS_right = eS_left-1; cv++; cvi[index]++; if(DEBUG) printEdgeStack(ARTICULATE_EDGE, eS_left); } //When all nodes reachable from a particular node are reached, color the node black vertices[index]->color = BLACK; cv++; cvi[index]++; } }