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

Questions about the ID mechanism #306

Open
QiuYilin opened this issue Sep 11, 2024 · 1 comment
Open

Questions about the ID mechanism #306

QiuYilin opened this issue Sep 11, 2024 · 1 comment

Comments

@QiuYilin
Copy link

QiuYilin commented Sep 11, 2024

In the example, Node, Link, and Pin share the same id incrementing mechanism. Can different types of elements have the same id? Will this cause problems?

If I want to display a general graph model through imgui-node-editor, does it mean that I have to create an additional ID mechanism for the graph to adapt to imgui-node-editor? Is there any recommended solution for this?

@JoelStienlet
Copy link

Hello Yilin,
I discovered this library a few hours ago, so I'm really not an expert. I assume that you're talking about the "blueprints" example. IMO the example is, well, just an example, and you don't have to use the same id mechanism if you don't want to.
By the way, I've seen that in this example, the node builders (the SpawnSOMETYPENode functions ) return a pointer to an element of a vector. I recommend changing this, at least check the size of the vector and define a max value for id, or else there is a high risk of segfault.

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

2 participants