| 1320 | } |
| 1321 | |
| 1322 | float2 RenderGraphUI::getNextNodePosition(uint32_t nodeID) |
| 1323 | { |
| 1324 | const float offsetX = 384.0f; |
| 1325 | const float offsetY = 128.0f; |
| 1326 | float2 newNodePosition = mNewNodeStartPosition; |
| 1327 | |
| 1328 | auto topologicalSort = DirectedGraphTopologicalSort::sort(*mpRenderGraph->mpGraph); |
| 1329 | |
| 1330 | // For each object in the vector, if it's being used in the execution, put it in the list |
| 1331 | for (auto& node : topologicalSort) |
| 1332 | { |
| 1333 | newNodePosition.x += offsetX; |
| 1334 | |
| 1335 | if (node == nodeID) |
| 1336 | { |
| 1337 | const DirectedGraph::Node* pNode = mpRenderGraph->mpGraph->getNode(nodeID); |
| 1338 | if (!pNode->getIncomingEdgeCount()) |
| 1339 | { |
| 1340 | newNodePosition.y += offsetY * pNode->getIncomingEdgeCount() * nodeID; |
| 1341 | break; |
| 1342 | } |
| 1343 | |
| 1344 | for (uint32_t i = 0; i < pNode->getIncomingEdgeCount(); ++i) |
| 1345 | { |
| 1346 | uint32_t outgoingEdgeCount = |
| 1347 | mpRenderGraph->mpGraph->getNode(mpRenderGraph->mpGraph->getEdge(pNode->getIncomingEdge(i))->getSourceNode()) |
| 1348 | ->getOutgoingEdgeCount(); |
| 1349 | if (outgoingEdgeCount > pNode->getIncomingEdgeCount()) |
| 1350 | { |
| 1351 | // move down by index in |
| 1352 | newNodePosition.y += offsetY * (outgoingEdgeCount - pNode->getIncomingEdgeCount()); |
| 1353 | break; |
| 1354 | } |
| 1355 | } |
| 1356 | break; |
| 1357 | } |
| 1358 | } |
| 1359 | |
| 1360 | if (newNodePosition.x > mMaxNodePositionX) |
| 1361 | mMaxNodePositionX = newNodePosition.x; |
| 1362 | return newNodePosition; |
| 1363 | } |
| 1364 | |
| 1365 | void RenderGraphUI::updateDisplayData(RenderContext* pRenderContext) |
| 1366 | { |
nothing calls this directly
no test coverage detected