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

using Generics with Node data #341

Open
Cairn23 opened this issue Mar 21, 2023 · 2 comments
Open

using Generics with Node data #341

Cairn23 opened this issue Mar 21, 2023 · 2 comments

Comments

@Cairn23
Copy link

Cairn23 commented Mar 21, 2023

Currently Node derived from GeometryObject has a attribute called user data which can be used to place data associated to the node, so that you can reference the data directed from the node rather than doing a further look in a data set. This is of type object. Would it be better to use generics and have UserData of type . This would then remove the processing to cast to and from object within the code.

@levnach
Copy link
Contributor

levnach commented Mar 21, 2023

I think it is a good idea. Please create the pull request.

Another related issue is that MSAGL creates many 'parallel' graphs. GeometryGraph, DrawingGraph, DGraph, etc. They have the same structure but by the design fault they are replicated. A better solution would be to create one graph class, one node class, and one edge class, and make all the rest graphs, nodes, and edges, attributes on top of those. Then GeometryNode.UserData becomes just another attribute. It seems quite a chunk of work though.

@Cairn23
Copy link
Author

Cairn23 commented Mar 26, 2023

I have started with just a local branch for the moment. There will be 2 generic data types to cover Nodes and linkages.
I have taken an approach of unloading all the projects except AutomaticGraphLayout, get that building and working then enable the relevant test projects and build up from there with AutomaticGraphLaout.Graph the following project to convert. Once I get the first project modified and working I will upload the branch

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