Renamed osgUtil::RenderStageLighting osgUtil::PositionalStateContainer

This commit is contained in:
Robert Osfield
2005-09-02 10:35:38 +00:00
parent ce3bfff46a
commit 21cabaf5f6
7 changed files with 38 additions and 38 deletions

View File

@@ -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

View File

@@ -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 <osg/Object>
#include <osg/Light>
@@ -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<const RenderStageLighting*>(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<const PositionalStateContainer*>(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();
};

View File

@@ -21,7 +21,7 @@
#include <osg/CameraNode>
#include <osgUtil/RenderBin>
#include <osgUtil/RenderStageLighting>
#include <osgUtil/PositionalStateContainer>
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<osg::FrameBufferObject> _fbo;
osg::ref_ptr<osg::GraphicsContext> _graphicsContext;
mutable osg::Matrix _inheritedRenderStageLightingMatrix;
mutable osg::ref_ptr<RenderStageLighting> _inheritedRenderStageLighting;
mutable osg::ref_ptr<RenderStageLighting> _renderStageLighting;
mutable osg::Matrix _inheritedPositionalStateContainerMatrix;
mutable osg::ref_ptr<PositionalStateContainer> _inheritedPositionalStateContainer;
mutable osg::ref_ptr<PositionalStateContainer> _renderStageLighting;

View File

@@ -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

View File

@@ -16,7 +16,7 @@ CXXFILES = \
RenderGraph.cpp\
RenderLeaf.cpp\
RenderStage.cpp\
RenderStageLighting.cpp\
PositionalStateContainer.cpp\
SceneView.cpp\
Simplifier.cpp\
SmoothingVisitor.cpp\

View File

@@ -10,29 +10,29 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <osgUtil/RenderStageLighting>
#include <osgUtil/PositionalStateContainer>
using namespace osg;
using namespace osgUtil;
// register a RenderStageLighting prototype with the RenderBin prototype list.
//RegisterRenderBinProxy<RenderStageLighting> s_registerRenderStageLightingProxy;
// register a PositionalStateContainer prototype with the RenderBin prototype list.
//RegisterRenderBinProxy<PositionalStateContainer> 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)

View File

@@ -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.