Unfortunately, in the ReadCallback the newly loaded node has not yet been attached to the scene graph so it has no parents to traverse.
Michael -----Original Message----- From: Tanja & Paul [mailto:[EMAIL PROTECTED] Sent: Sunday, January 27, 2008 9:18 AM To: OpenSceneGraph Users Subject: Re: [osg-users] PagedLOD node page callback Hi Guerro, Hope I understand you correctly - but couldn't you just use node->getParent() perhaps cast it if(node->asGroup()) osg::Group* group = dynamic_cast<osg::Group*>(node); ..or maybe getnodePath() to find what your after. Sorry if I've mispellt the methods. ----- Original Message ----- From: "Guerrero, Michael (CIV)" <[EMAIL PROTECTED]> To: "OpenSceneGraph Users" <osg-users@lists.openscenegraph.org> Sent: Friday, January 25, 2008 2:12 PM Subject: Re: [osg-users] PagedLOD node page callback > Hi guys, > > I implemented an osgDB::Registry::ReadCallback to catch when an LOD page > gets loaded. Now the issue I have is distinguishing if the node that I > get in readNode() came from an LOD page since the ReadCallback gets > executed for anything that gets loaded as a node. > > The only option I see is to check if the filename contains a substring > that I know is only present on pagedLOD files. If I could somehow > access the GroupNode that the loaded node was going to be attached to, I > could determine if it had a parent PagedLOD but I don't see a way to do > that. Is there a better way? > > Michael Guerrero > Delta3D www.delta3d.org > > -----Original Message----- > From: Robert Osfield [mailto:[EMAIL PROTECTED] > Sent: Friday, January 25, 2008 1:51 AM > To: OpenSceneGraph Users > Subject: Re: [osg-users] PagedLOD node page callback > > Hi Paul, > > osg::observer_ptr<> is the only public example of osg::Observer in > action that I can think of. > > Robert. > > On Jan 25, 2008 12:26 AM, Paul Pocock <[EMAIL PROTECTED]> > wrote: >> >> Hi Robert, I was wondering how you would use osg::Observer and are > there >> any examples. Would you construct it as >> >> osg::observer_ptr<osg::Object> pagedLODObserver ? >> >> and catch page unloads by testing for objectDeleted() ? >> >> >> On Thu, 2008-01-24 at 09:01 +0000, Robert Osfield wrote: >> > Hi Michael, >> > >> > To monitor file loads you just need to assign a custom >> > osdDB::Registry::ReadCallback to the Registry.. >> > >> > To catch unloads you have two routes, add an custom osg::Observer to >> > PagedLOD objects to get informed when they get deleted or to create >> > your own DatabasePager subclass. >> > >> > Robert. >> > >> > On Jan 23, 2008 10:47 PM, Guerrero, Michael (CIV) <[EMAIL PROTECTED]> > wrote: >> > > >> > > >> > > >> > > >> > > Hi, I'm searching for a convenient way to be alerted when a > PagedLOD node >> > > gets either paged in or out. Is there a preferred method of doing > this? >> > > >> > > >> > > >> > > Thanks, >> > > >> > > Michael >> > > _______________________________________________ >> > > osg-users mailing list >> > > osg-users@lists.openscenegraph.org >> > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or > g >> > > >> > > >> > _______________________________________________ >> > osg-users mailing list >> > osg-users@lists.openscenegraph.org >> > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or > g >> >> >> IMPORTANT: This email remains the property of the Australian Defence > Organisation and is subject to the jurisdiction of section 70 of the > CRIMES ACT 1914. If you have received this email in error, you are > requested to contact the sender and delete the email. >> >> >> >> _______________________________________________ >> osg-users mailing list >> osg-users@lists.openscenegraph.org >> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or > g >> > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org