本文整理汇总了C++中PathNode::addChild方法的典型用法代码示例。如果您正苦于以下问题:C++ PathNode::addChild方法的具体用法?C++ PathNode::addChild怎么用?C++ PathNode::addChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathNode
的用法示例。
在下文中一共展示了PathNode::addChild方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: connectFloorMeshGraphs
void PortalLayout::connectFloorMeshGraphs() {
for (int i = 0; i < cellProperties.size(); ++i) {
FloorMesh* floorMesh = getFloorMesh(i);
if (floorMesh == NULL)
continue;
PathGraph* pathGraph = floorMesh->getPathGraph();
if (pathGraph == NULL)
continue;
Vector<PathNode*> globalNodes = pathGraph->getGlobalNodes();
for (int j = 0; j < globalNodes.size(); ++j) {
PathNode* node = globalNodes.get(j);
int globalID = node->getGlobalGraphNodeID();
for (int k = 0; k < cellProperties.size(); ++k) {
if (i != k) {
FloorMesh* newMesh = getFloorMesh(k);
if (newMesh != NULL) {
PathGraph* newPathGraph = newMesh->getPathGraph();
if (newPathGraph != NULL) {
Vector<PathNode*> newGlobalNodes = newPathGraph->getGlobalNodes();
for (int l = 0; l < newGlobalNodes.size(); ++l) {
PathNode* newNode = newGlobalNodes.get(l);
int newGlobalID = newNode->getGlobalGraphNodeID();
if (globalID == newGlobalID)
node->addChild(newNode);
}
}
}
}
}
}
}
}
示例2: connectNodes
void PathGraph::connectNodes(Vector<PathEdge>& pathEdges) {
for (int i = 0; i < pathEdges.size(); ++i) {
PathEdge* pathEdge = &pathEdges.get(i);
int from = pathEdge->getFromConnection();
int to = pathEdge->getToConnection();
PathNode* fromNode = pathNodes.get(from);
PathNode* toNode = pathNodes.get(to);
/*Vector<PathNode*>* path = AStarAlgorithm<PathGraph, PathNode>::search<uint32>(this, fromNode, toNode);
if (path != NULL) {
System::out << "found path\n";
delete path;
} else {
System::out << "didint find path\n";
}*/
fromNode->addChild(toNode);
}
}