Hi,

I am working with the method, findUnit(), within the class Processor and I have 
come across something very strange:
In the program, osgppu.cpp using the header hdrppu.h, I do the following in 
osgppu.cpp/Viewer::initialize():

Code:

            mHDRSetup.createHDRPipeline(mProcessor.get(), firstUnit, lastUnit);
            mProcessor->addChild(firstUnit);
            osgPPU::UnitBypass* ppuUnit = 
dynamic_cast<osgPPU::UnitBypass*>(mProcessor->findUnit("HDRBypass"));
            osgPPU::UnitBypass* ppuUnit2 = 
dynamic_cast<osgPPU::UnitBypass*>(getProcessor()->findUnit("HDRBypass"));




findUnit() in both cases returns NULL or 0 but I know for a fact that the 
firstUnit is the "HDRBypass" Unit or UnitBypass with the name "HDRBypass".
However, when I issue this same findUnit command for this same unit within the 
KeyboardEventHandler::handle() method, it works.  Here is my code snippet:

Code:

                osgPPU::UnitTexture* ppu = 
dynamic_cast<osgPPU::UnitTexture*>(viewer->getProcessor()->findUnit("TextureUnit"));
                osgPPU::UnitText* textppu = 
dynamic_cast<osgPPU::UnitText*>(viewer->getProcessor()->findUnit("TextPPU"));
                osgPPU::UnitInOut* pip = 
dynamic_cast<osgPPU::UnitInOut*>(viewer->getProcessor()->findUnit("PictureInPicturePPU"));
            osgPPU::UnitBypass* ppuUnit = 
dynamic_cast<osgPPU::UnitBypass*>(viewer->getProcessor()->findUnit("HDRBypass"));




Does anyone know why this is the case?  There is no documentation on this 
anomaly and I need findUnit to work in my 1st case as well as the second case.

Thank you!

Cheers,
Allen

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26866#26866





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to