MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / setLinkFromGui

Method setLinkFromGui

Source/Falcor/RenderGraph/RenderGraphUI.cpp:407–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405}
406
407void RenderGraphUI::NodeGraphEditorGui::setLinkFromGui(
408 ImGui::NodeLink& link,
409 ImGui::NodeGraphEditor::LinkState state,
410 ImGui::NodeGraphEditor& editor
411)
412{
413 if (state == ImGui::NodeGraphEditor::LinkState::LS_ADDED)
414 {
415 RenderGraphNode *inputNode = static_cast<RenderGraphNode*>(link.InputNode),
416 *outputNode = static_cast<RenderGraphNode*>(link.OutputNode);
417 RenderGraphUI::NodeGraphEditorGui* pGraphEditorGui = static_cast<RenderGraphUI::NodeGraphEditorGui*>(&editor);
418
419 bool addStatus = false;
420 std::string outputName = inputNode->getOutputName(link.InputSlot);
421 addStatus = pGraphEditorGui->getRenderGraphUI()->addLink(
422 inputNode->getName(), outputNode->getName(), outputName, outputNode->getInputName(link.OutputSlot), link.LinkColor
423 );
424
425 // immediately remove link if it is not a legal edge in the render graph
426 if (!addStatus && !editor.isInited()) // only call after graph is setup
427 {
428 // does not call link callback surprisingly enough
429 editor.removeLink(link.InputNode, link.InputSlot, link.OutputNode, link.OutputSlot);
430 return;
431 }
432
433 if (outputName[0] == '#')
434 {
435 static_cast<RenderGraphNode*>(link.InputNode)->setPinColor(link.LinkColor, link.InputSlot, false);
436 static_cast<RenderGraphNode*>(link.OutputNode)->setPinColor(link.LinkColor, link.OutputSlot, true);
437 }
438 }
439}
440
441// callback for ImGui setting link from render graph changes
442void RenderGraphUI::NodeGraphEditorGui::setLinkFromGraph(

Callers

nothing calls this directly

Calls 6

addLinkMethod · 0.80
getRenderGraphUIMethod · 0.80
getInputNameMethod · 0.80
setPinColorMethod · 0.80
getOutputNameMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected