Hi Robert, The OSG automatically reference counts Nodes and other objects in the scene graph. If you want to remove Nodes or other objects from the scene graph you need to call the appropriate methods to removing them. If you want to remove a child from a group then you simply call group->removeChild(child);
I can't see how calling group->removeChild(child) is complicated, it's about as straight forward as one can get if you want to remove a referenced from one object from another. It really isn't a case of doing group->removeChild(child) as well, it's usually the one thing you need to do. If you have other ref_ptr<> references to the child then once these ref_ptr<>'s go out of scope then what they are pointing to will be automatically unrefenced, and if this is the less refernece to it, it will be automatically deleted for you. It's really hard to know what you are struggling with in your own application usage, but it rather sounds like you are over managing things. Robert. On 22 July 2014 16:31, Robert Gosztyla <[email protected]> wrote: > Hi, > > Searching forum i've found such topic > http://forum.openscenegraph.org/viewtopic.php?t=5758, which is quite > similar to my problem, however does not solved my issue. I'm trying to > write functionality to remove node with all subnodes, but cannot get it to > work. Assign NULL to shared pointer (as stated in above thread) doesn't > work. Could someone clarify things a little bit? Is it enough to set > pointer to NULL to remove object from scene tree? Or i need also to call > removeChild method as well? I want also implement possibility to move part > of scene tree from one node to another (e.g. move geode from one group to > another, have widget to do that), so this is quite important for me - > because if i need to call removeChild it would complicate code, maybe there > is simpler way to do that? > > Thank you! > > Cheers, > Robert > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=60396#60396 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

