Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is linking from input to output intended action? #200

Open
frijuly7 opened this issue Jul 9, 2024 · 0 comments
Open

Is linking from input to output intended action? #200

frijuly7 opened this issue Jul 9, 2024 · 0 comments

Comments

@frijuly7
Copy link

frijuly7 commented Jul 9, 2024

`

ImGui::Begin("Node Graph Test");

ImNodes::BeginNodeEditor();

ImNodes::BeginNode(0);

ImNodes::BeginNodeTitleBar();
ImGui::TextUnformatted("output node");
ImNodes::EndNodeTitleBar();

ImNodes::BeginInputAttribute(2);
ImGui::Text("input");
ImNodes::EndInputAttribute();

ImNodes::BeginOutputAttribute(3);
ImGui::Text("output");
ImNodes::EndOutputAttribute();

ImNodes::EndNode();


ImNodes::BeginNode(1);

ImNodes::BeginNodeTitleBar();
ImGui::TextUnformatted("output node");
ImNodes::EndNodeTitleBar();

ImNodes::BeginInputAttribute(4);
ImGui::Text("input");
ImNodes::EndInputAttribute();

ImNodes::BeginOutputAttribute(5);
ImGui::Text("output");
ImNodes::EndOutputAttribute();

ImNodes::EndNode();

std::vector<std::pair<int, int>> links;
links.push_back({ 3, 4 });
links.push_back({ 2, 5 });
// elsewhere in the code...
for (int i = 0; i < links.size(); ++i)
{
    const std::pair<int, int> p = links[i];
    // in this case, we just use the array index of the link
    // as the unique identifier
    ImNodes::Link(i, p.first, p.second);
}
ImNodes::EndNodeEditor();
ImGui::End();

`

I'm testing ImNodes to consider applying on my project. But I found this behavior. I'm wondering if this behavior is intended.
Screenshot 2024-07-09 133902

Off-topic, Thank you for creating a library that allows us to quickly create node graphs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant