diff --git a/VisualStudio/osgUtil/osgUtil.dsp b/VisualStudio/osgUtil/osgUtil.dsp index 7f6df2aa7..83ee01bb2 100755 --- a/VisualStudio/osgUtil/osgUtil.dsp +++ b/VisualStudio/osgUtil/osgUtil.dsp @@ -147,7 +147,7 @@ SOURCE=..\..\src\osgUtil\RenderStage.cpp # End Source File # Begin Source File -SOURCE=..\..\src\osgUtil\RenderStageLighting.cpp +SOURCE=..\..\src\osgUtil\PositionalStateContainer.cpp # End Source File # Begin Source File @@ -259,7 +259,7 @@ SOURCE=..\..\include\osgUtil\RenderStage # End Source File # Begin Source File -SOURCE=..\..\include\osgUtil\RenderStageLighting +SOURCE=..\..\include\osgUtil\PositionalStateContainer # End Source File # Begin Source File diff --git a/include/osgUtil/RenderStageLighting b/include/osgUtil/PositionalStateContainer similarity index 77% rename from include/osgUtil/RenderStageLighting rename to include/osgUtil/PositionalStateContainer index e707ba98a..2197c931c 100644 --- a/include/osgUtil/RenderStageLighting +++ b/include/osgUtil/PositionalStateContainer @@ -11,8 +11,8 @@ * OpenSceneGraph Public License for more details. */ -#ifndef OSGUTIL_RENDERSTAGELIGHTING -#define OSGUTIL_RENDERSTAGELIGHTING 1 +#ifndef OSGUTIL_POSTIONALSTATECONTIANER +#define OSGUTIL_POSTIONALSTATECONTIANER 1 #include #include @@ -24,19 +24,19 @@ namespace osgUtil { /** - * RenderStageLighting base class. Used in RenderStage class. + * PositionalStateContainer base class. Used in RenderStage class. */ -class OSGUTIL_EXPORT RenderStageLighting : public osg::Object +class OSGUTIL_EXPORT PositionalStateContainer : public osg::Object { public: - RenderStageLighting(); - virtual osg::Object* cloneType() const { return new RenderStageLighting(); } - virtual osg::Object* clone(const osg::CopyOp&) const { return new RenderStageLighting(); } // note only implements a clone of type. - virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=0L; } + PositionalStateContainer(); + virtual osg::Object* cloneType() const { return new PositionalStateContainer(); } + virtual osg::Object* clone(const osg::CopyOp&) const { return new PositionalStateContainer(); } // note only implements a clone of type. + virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=0L; } virtual const char* libraryName() const { return "osgUtil"; } - virtual const char* className() const { return "RenderStageLighting"; } + virtual const char* className() const { return "PositionalStateContainer"; } virtual void reset(); @@ -63,7 +63,7 @@ class OSGUTIL_EXPORT RenderStageLighting : public osg::Object protected: - virtual ~RenderStageLighting(); + virtual ~PositionalStateContainer(); }; diff --git a/include/osgUtil/RenderStage b/include/osgUtil/RenderStage index c45599b8c..6841a2505 100644 --- a/include/osgUtil/RenderStage +++ b/include/osgUtil/RenderStage @@ -21,7 +21,7 @@ #include #include -#include +#include namespace osgUtil { @@ -147,28 +147,28 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin - void setInheritedRenderStageLightingMatrix(const osg::Matrix& matrix) { _inheritedRenderStageLightingMatrix = matrix; } - const osg::Matrix& getInheritedRenderStageLightingMatrix() const { return _inheritedRenderStageLightingMatrix; } + void setInheritedPositionalStateContainerMatrix(const osg::Matrix& matrix) { _inheritedPositionalStateContainerMatrix = matrix; } + const osg::Matrix& getInheritedPositionalStateContainerMatrix() const { return _inheritedPositionalStateContainerMatrix; } - void setInheritedRenderStageLighting(RenderStageLighting* rsl) { _inheritedRenderStageLighting = rsl; } - RenderStageLighting* getInheritedRenderStageLighting() { return _inheritedRenderStageLighting.get(); } + void setInheritedPositionalStateContainer(PositionalStateContainer* rsl) { _inheritedPositionalStateContainer = rsl; } + PositionalStateContainer* getInheritedPositionalStateContainer() { return _inheritedPositionalStateContainer.get(); } - void setRenderStageLighting(RenderStageLighting* rsl) { _renderStageLighting = rsl; } + void setPositionalStateContainer(PositionalStateContainer* rsl) { _renderStageLighting = rsl; } - RenderStageLighting* getRenderStageLighting() const + PositionalStateContainer* getPositionalStateContainer() const { - if (!_renderStageLighting.valid()) _renderStageLighting = new RenderStageLighting; + if (!_renderStageLighting.valid()) _renderStageLighting = new PositionalStateContainer; return _renderStageLighting.get(); } virtual void addPositionedAttribute(osg::RefMatrix* matrix,const osg::StateAttribute* attr) { - getRenderStageLighting()->addPositionedAttribute(matrix,attr); + getPositionalStateContainer()->addPositionedAttribute(matrix,attr); } virtual void addPositionedTextureAttribute(unsigned int textureUnit, osg::RefMatrix* matrix,const osg::StateAttribute* attr) { - getRenderStageLighting()->addPositionedTextureAttribute(textureUnit, matrix,attr); + getPositionalStateContainer()->addPositionedTextureAttribute(textureUnit, matrix,attr); } void copyTexture(osg::State& state); @@ -229,9 +229,9 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin osg::ref_ptr _fbo; osg::ref_ptr _graphicsContext; - mutable osg::Matrix _inheritedRenderStageLightingMatrix; - mutable osg::ref_ptr _inheritedRenderStageLighting; - mutable osg::ref_ptr _renderStageLighting; + mutable osg::Matrix _inheritedPositionalStateContainerMatrix; + mutable osg::ref_ptr _inheritedPositionalStateContainer; + mutable osg::ref_ptr _renderStageLighting; diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index 46134d197..0eed5d89a 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -1122,12 +1122,12 @@ void CullVisitor::apply(osg::CameraNode& camera) rtts->setViewport( viewport ); - // set up to charge the same RenderStageLighting is the parent previous stage. + // set up to charge the same PositionalStateContainer is the parent previous stage. osg::Matrix inhertiedMVtolocalMV; inhertiedMVtolocalMV.invert(originalModelView); inhertiedMVtolocalMV.postMult(getModelViewMatrix()); - rtts->setInheritedRenderStageLightingMatrix(inhertiedMVtolocalMV); - rtts->setInheritedRenderStageLighting(previous_stage->getRenderStageLighting()); + rtts->setInheritedPositionalStateContainerMatrix(inhertiedMVtolocalMV); + rtts->setInheritedPositionalStateContainer(previous_stage->getPositionalStateContainer()); // record the render bin, to be restored after creation // of the render to text diff --git a/src/osgUtil/GNUmakefile b/src/osgUtil/GNUmakefile index 105bd4cb1..cb1eea4df 100644 --- a/src/osgUtil/GNUmakefile +++ b/src/osgUtil/GNUmakefile @@ -16,7 +16,7 @@ CXXFILES = \ RenderGraph.cpp\ RenderLeaf.cpp\ RenderStage.cpp\ - RenderStageLighting.cpp\ + PositionalStateContainer.cpp\ SceneView.cpp\ Simplifier.cpp\ SmoothingVisitor.cpp\ diff --git a/src/osgUtil/RenderStageLighting.cpp b/src/osgUtil/PositionalStateContainer.cpp similarity index 85% rename from src/osgUtil/RenderStageLighting.cpp rename to src/osgUtil/PositionalStateContainer.cpp index 4a429dd07..5d4bad78a 100644 --- a/src/osgUtil/RenderStageLighting.cpp +++ b/src/osgUtil/PositionalStateContainer.cpp @@ -10,29 +10,29 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ -#include +#include using namespace osg; using namespace osgUtil; -// register a RenderStageLighting prototype with the RenderBin prototype list. -//RegisterRenderBinProxy s_registerRenderStageLightingProxy; +// register a PositionalStateContainer prototype with the RenderBin prototype list. +//RegisterRenderBinProxy s_registerPositionalStateContainerProxy; -RenderStageLighting::RenderStageLighting() +PositionalStateContainer::PositionalStateContainer() { } -RenderStageLighting::~RenderStageLighting() +PositionalStateContainer::~PositionalStateContainer() { } -void RenderStageLighting::reset() +void PositionalStateContainer::reset() { _attrList.clear(); _texAttrListMap.clear(); } -void RenderStageLighting::draw(osg::State& state,RenderLeaf*& previous, const osg::Matrix* postMultMatrix) +void PositionalStateContainer::draw(osg::State& state,RenderLeaf*& previous, const osg::Matrix* postMultMatrix) { if (previous) diff --git a/src/osgUtil/RenderStage.cpp b/src/osgUtil/RenderStage.cpp index 14184f865..5ae64d893 100644 --- a/src/osgUtil/RenderStage.cpp +++ b/src/osgUtil/RenderStage.cpp @@ -406,9 +406,9 @@ void RenderStage::drawImplementation(osg::State& state,RenderLeaf*& previous) glLoadIdentity(); // apply the positional state. - if (_inheritedRenderStageLighting.valid()) + if (_inheritedPositionalStateContainer.valid()) { - _inheritedRenderStageLighting->draw(state, previous, &_inheritedRenderStageLightingMatrix); + _inheritedPositionalStateContainer->draw(state, previous, &_inheritedPositionalStateContainerMatrix); } // apply the positional state.