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

Allow the setting of user data #138

Open
nfwGytautas opened this issue Dec 6, 2021 · 0 comments
Open

Allow the setting of user data #138

nfwGytautas opened this issue Dec 6, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@nfwGytautas
Copy link

nfwGytautas commented Dec 6, 2021

Hello, I have a suggestion for adding the ability to map internal ImNodes data with user defined objects. For example ImLinkData could have a void* field called UserData, which one could set using ImNodes::SetLinkUserData(iint id, void* object) and then receive with void* ImNodes::GetLinkUserData(int id). This could be done for other data structures such as ImPinData, ImNodeData. This would allow the user to have his own object mapped to an imnodes id making working with the library easier.

The current workflow is rendering the entire graph, then checking for if (ImNodes::IsLinkDestroyed(&link_id)) then acquiring the object to it and performing actions with it. With this change one can just query the user pointer and then just cast it.

@Nelarius Nelarius added the enhancement New feature or request label Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants