Quote:Original post by emeyex
Quote:Original post by beebs1
You shouldn't really need to worry about this, as long as your WrapNode class free's it's IGraphNode.
As WrapNode is managed (C#), the .NET garbage collector will delete it when it's no longer any references to it.
Hope this helped, post back if you need.
You don't need to worry about it PROVIDED the WrapNode "owns" the IGraphNode, and is the only one who can delete it. If someone else can delete the IGraphNode, then you'll need an alternate solution (smart/shared pointers would probably be the easiest).
Thanks - that's a good answer. Unfortunately, I have to assume that the WrapNode does NOT own the object, at least, I think I do.
I can't imagine getting away with the C++ code not destroying nodes.
Maybe my over-all architecture will work out if I do more design work, but I just don't see how to do it given that the scene graph is in C++ but I want to be able to extract properties from nodes and edit them in C#, show the selection set, etc.
I guess I could make some kind of scene-graph-iterator which can be used by C# to walk the current selection set, or the whole tree, or what have you and can be invalidated if an object is added or removed from the scene.
Here is my breakdown:
C++: Scene Graph, Scene Object Plugins ( entities, physics, lights ), Serialization, Rendering, property server, Hit Testing, Transform Modification, drag-to-parent, drag-to-link, drag-to-signal/slot
C#: Menus, docking window swith information, representation of scenegraph, buttons to create/destroy objects, Scene Object property views (plug-able).
so in there I need an interface in managed C++, or maybe Swig, whichever is easiest I guess.
S