代码拉取完成,页面将自动刷新
A standalone Dear ImGui node graph implementation.
Library provides core features needed to create a node graph, while leaving it to the user to define content of node. Node layouting is left to the user, however comprehensible example is available which can be used as a base.
static ImNodes::CanvasState canvas;
if (ImGui::Begin("ImNodes", nullptr, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse))
{
ImNodes::BeginCanvas(&canvas);
struct Node
{
ImVec2 pos{};
bool selected{};
ImNodes::Ez::SlotInfo inputs[1];
ImNodes::Ez::SlotInfo outputs[1];
};
static Node nodes[3] = {
{{50, 100}, false, {{"In", 1}}, {{"Out", 1}}},
{{250, 50}, false, {{"In", 1}}, {{"Out", 1}}},
{{250, 100}, false, {{"In", 1}}, {{"Out", 1}}},
};
for (Node& node : nodes)
{
if (ImNodes::Ez::BeginNode(&node, "Node Title", &node.pos, &node.selected))
{
ImNodes::Ez::InputSlots(node.inputs, 1);
ImNodes::Ez::OutputSlots(node.outputs, 1);
ImNodes::Ez::EndNode();
}
}
ImNodes::Connection(&nodes[1], "In", &nodes[0], "Out");
ImNodes::Connection(&nodes[2], "In", &nodes[0], "Out");
ImNodes::EndCanvas();
}
ImGui::End();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。