You're right, thanks. Now to figure out how I'm going to use this. :)
andy -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thrall, Bryan Sent: Wednesday, November 22, 2006 12:43 PM To: osg users Subject: RE: [osg-users] RenderBin::drawImplementation Andy Skinner wrote on Wednesday, November 22, 2006 11:14 AM: > Hmm. My EraseNoneRenderBin is pretty much a Hello World type thing. > There is nothing in it to copy. It only implements > drawImplementation() and a virtual destructor. Do I need to > implement a copy constructor? > > drawImplementation() just calls a function to print something out, > then calls RenderBin::drawImplementation(). > > thanks > andy RenderBin uses the clone() function implemented by all osg::Objects, but each subclass needs to implement that function to return the proper type (the META_Object macro will do this for you); the META_Object clone() implementation uses the copy constructor which takes the osg::CopyOp argument. My guess is EraseNoneRenderBin doesn't override clone(), so osgUtil::RenderBin's clone is being used -- returning a RenderBin and not EraseNoneRenderBin when that prototype is cloned! > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Thrall, > Bryan Sent: Wednesday, November 22, 2006 12:05 PM > To: osg users > Subject: RE: [osg-users] RenderBin::drawImplementation > > Andy Skinner wrote on Wednesday, November 22, 2006 10:51 AM: >> So as I'm setting up the SceneView, I do this: >> ============ >> osg::ref_ptr<EraseNoneRenderBin> prototype(new EraseNoneRenderBin()); >> osgUtil::RenderBin::addRenderBinPrototype("EraseNoneBin", >> prototype.get()); ============ >> (EraseNoneRenderBin extends RenderBin and implements >> drawImplementation.) >> >> >> As I'm setting up the StateSet for some geometry, I do this: >> ============ stateset->setRenderBinDetails(2, "EraseNoneBin"); >> ============ >> >> What am I missing? I'll go look at RegisterRenderBinProxy. > > Maybe there's a bug in EraseNoneRenderBin's copy constructor? Did you > implement EraseNoneRenderBin::EraseNoneRenderBin(const > EraseNoneRenderBin&,osg::CopyOp)? Does it copy everything you'd need > for the copy to print out the message you're expecting? -- Bryan Thrall FlightSafety International [EMAIL PROTECTED] _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/ _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
