thanks a lot ---------- Forwarded message ---------- From: Robert Osfield <[EMAIL PROTECTED]> Date: Dec 6, 2006 4:00 PM Subject: Re: [osg-users] where is the delete operator?? To: osg users <osg-users@openscenegraph.net>
On 12/6/06, elekis <[EMAIL PROTECTED]> wrote:
hi all, I have to use the osg for a work so I learn with http://www.nps.navy.mil/cs/sullivan/osgtutorials/osgGeometry.htm but I have some question about the code, there are a lot of new, where are the delete?? is osg take in charge that?? second thing after a thing like that root->addChild(pyramidGeode); how to remove a child?? or simply say do not draw it??
root->removeChild(pyramidGeode) ;-) The OSG uses ref counting of all scene graph objects, a consequence is that most destructors are private to stop you from deleting objects inappropriately. Using ref_ptr<>'s is the way to retain robust pointers to scene graph objects, and this smart pointer will manage the reference counting and automatic deletion for you. See Don Burns' article on this topic: http://donburns.net/OSG/Articles/RefPointers/RefPointers.html Robert. _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/ _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/