| 1184 | } |
| 1185 | |
| 1186 | void RenderGraphUI::updatePins(bool addLinks) |
| 1187 | { |
| 1188 | // Draw pin connections. All the nodes have to be added to the GUI before the connections can be drawn |
| 1189 | for (auto& currentPass : mRenderPassUI) |
| 1190 | { |
| 1191 | auto& currentPassUI = currentPass.second; |
| 1192 | |
| 1193 | for (auto& currentPinUI : currentPassUI.mOutputPins) |
| 1194 | { |
| 1195 | const std::string& currentPinName = currentPinUI.mPinName; |
| 1196 | |
| 1197 | if (addLinks) |
| 1198 | { |
| 1199 | const auto& inputPins = mOutputToInputPins.find(currentPass.first + "." + currentPinName); |
| 1200 | if (inputPins != mOutputToInputPins.end()) |
| 1201 | { |
| 1202 | for (const auto& connectedPin : (inputPins->second)) |
| 1203 | { |
| 1204 | if (!mpNodeGraphEditor->isLinkPresent( |
| 1205 | mpNodeGraphEditor->getNodeFromID(currentPassUI.mGuiNodeID), |
| 1206 | currentPinUI.mGuiPinID, |
| 1207 | mpNodeGraphEditor->getNodeFromID(connectedPin.second), |
| 1208 | connectedPin.first |
| 1209 | )) |
| 1210 | { |
| 1211 | RenderGraphNode* pNode = static_cast<RenderGraphNode*>(mpNodeGraphEditor->getNodeFromID(connectedPin.second)); |
| 1212 | std::string dstName = pNode->getInputName(connectedPin.first); |
| 1213 | uint32_t edgeColor = kEdgesColor; |
| 1214 | // execution edges |
| 1215 | if (dstName[0] == '#') |
| 1216 | { |
| 1217 | edgeColor = kExecutionEdgeColor; |
| 1218 | } |
| 1219 | else |
| 1220 | { |
| 1221 | std::string srcString = currentPass.first + "." + currentPinName; |
| 1222 | std::string dstString = std::string(pNode->getName()) + "." + dstName; |
| 1223 | const RenderPassReflection::Field& srcPin = *currentPassUI.mReflection.getField(currentPinName); |
| 1224 | const RenderPassReflection::Field& dstPin = *mRenderPassUI[pNode->getName()].mReflection.getField(dstName); |
| 1225 | |
| 1226 | if (false /*mpRenderGraph->canAutoResolve(srcPin, dstPin)*/) |
| 1227 | { |
| 1228 | mLogString += std::string("Warning: Edge ") + srcString + " - " + dstName + " can auto-resolve.\n"; |
| 1229 | edgeColor = kAutoResolveEdgesColor; |
| 1230 | } |
| 1231 | } |
| 1232 | |
| 1233 | mpNodeGraphEditor->addLinkFromGraph( |
| 1234 | mpNodeGraphEditor->getNodeFromID(currentPassUI.mGuiNodeID), |
| 1235 | currentPinUI.mGuiPinID, |
| 1236 | mpNodeGraphEditor->getNodeFromID(connectedPin.second), |
| 1237 | connectedPin.first, |
| 1238 | false, |
| 1239 | edgeColor |
| 1240 | ); |
| 1241 | |
| 1242 | RenderGraphNode* pDstGraphNode = |
| 1243 | static_cast<RenderGraphNode*>(mpNodeGraphEditor->getNodeFromID(connectedPin.second)); |
nothing calls this directly
no test coverage detected