Removed deprecated drawImplementation(State&) method from Drawable and Drawable::DrawCallback

This commit is contained in:
Robert Osfield
2007-03-28 11:30:38 +00:00
parent 7fb38ff42f
commit 7fc714ada1
31 changed files with 83 additions and 86 deletions

View File

@@ -88,7 +88,7 @@ BoundingBox DrawPixels::computeBound() const
return bbox;
}
void DrawPixels::drawImplementation(State&) const
void DrawPixels::drawImplementation(RenderInfo&) const
{
glRasterPos3f(_position.x(),_position.y(),_position.z());

View File

@@ -876,14 +876,16 @@ unsigned int Geometry::getGLObjectSizeHint() const
return totalSize;
}
void Geometry::drawImplementation(State& state) const
void Geometry::drawImplementation(RenderInfo& renderInfo) const
{
State& state = *renderInfo.getState();
// osg::notify(osg::NOTICE)<<"Geometry::drawImplementation"<<std::endl;
if (_internalOptimizedGeometry.valid())
{
_internalOptimizedGeometry->drawImplementation(state);
_internalOptimizedGeometry->drawImplementation(renderInfo);
return;
}

View File

@@ -1785,8 +1785,10 @@ void ShapeDrawable::setTessellationHints(TessellationHints* hints)
}
}
void ShapeDrawable::drawImplementation(State& state) const
void ShapeDrawable::drawImplementation(RenderInfo& renderInfo) const
{
osg::State& state = *renderInfo.getState();
if (_shape.valid())
{
glColor4fv(_color.ptr());

View File

@@ -112,8 +112,10 @@ void ConnectedParticleSystem::reuseParticle(int particleIndex)
}
void ConnectedParticleSystem::drawImplementation(osg::State& state) const
void ConnectedParticleSystem::drawImplementation(osg::RenderInfo& renderInfo) const
{
osg::State& state = *renderInfo.getState();
OpenThreads::ScopedReadLock lock(_readWriteMutex);
const Particle* particle = (_startParticle != Particle::INVALID_INDEX) ? &_particles[_startParticle] : 0;

View File

@@ -89,8 +89,10 @@ void osgParticle::ParticleSystem::update(double dt)
dirtyBound();
}
void osgParticle::ParticleSystem::drawImplementation(osg::State& state) const
void osgParticle::ParticleSystem::drawImplementation(osg::RenderInfo& renderInfo) const
{
osg::State& state = *renderInfo.getState();
OpenThreads::ScopedReadLock lock(_readWriteMutex);
// update the frame count, so other objects can detect when

View File

@@ -84,9 +84,9 @@ class Logos: public osg::Drawable
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Logos*>(obj)!=NULL; }
virtual const char* className() const { return "Logos"; }
virtual void drawImplementation(osg::State &state ) const
virtual void drawImplementation(osg::RenderInfo& renderInfo) const
{
if( state.getContextID() != _contextID )
if( renderInfo.getContextID() != _contextID )
return;

View File

@@ -79,7 +79,7 @@ float ImpostorSprite::calcPixelError(const osg::Matrix& MVPW) const
return sqrtf(max_error_sqrd);
}
void ImpostorSprite::drawImplementation(osg::State&) const
void ImpostorSprite::drawImplementation(osg::RenderInfo&) const
{
// when the tex env is set to REPLACE, and the
// texture is set up correctly the color has no effect.

View File

@@ -82,8 +82,9 @@ void LightPointDrawable::reset()
}
void LightPointDrawable::drawImplementation(osg::State& state) const
void LightPointDrawable::drawImplementation(osg::RenderInfo& renderInfo) const
{
osg::State& state = *renderInfo.getState();
state.applyMode(GL_POINT_SMOOTH,true);
state.applyMode(GL_BLEND,true);

View File

@@ -80,7 +80,7 @@ class OSGSIM_EXPORT LightPointDrawable : public osg::Drawable
}
/** draw LightPoints. */
virtual void drawImplementation(osg::State& state) const;
virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
void setSimulationTime(double time)

View File

@@ -28,12 +28,13 @@ LightPointSpriteDrawable::LightPointSpriteDrawable(const LightPointSpriteDrawabl
{
}
void LightPointSpriteDrawable::drawImplementation(osg::State& state) const
void LightPointSpriteDrawable::drawImplementation(osg::RenderInfo& renderInfo) const
{
osg::State& state = *renderInfo.getState();
if (!state.getModeValidity(GL_POINT_SPRITE_ARB))
{
LightPointDrawable::drawImplementation(state);
LightPointDrawable::drawImplementation(renderInfo);
return;
}

View File

@@ -39,7 +39,7 @@ class OSGSIM_EXPORT LightPointSpriteDrawable : public osgSim::LightPointDrawable
/** draw LightPoints. */
virtual void drawImplementation(osg::State& state) const;
virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
protected:

View File

@@ -53,7 +53,7 @@ public:
META_Object(osgSim,Surface)
void drawImplementation(osg::State& state) const;
void drawImplementation(osg::RenderInfo& renderInfo) const;
virtual osg::BoundingBox computeBound() const;
@@ -64,9 +64,9 @@ private:
SphereSegment* _ss;
};
void SphereSegment::Surface::drawImplementation(osg::State& state) const
void SphereSegment::Surface::drawImplementation(osg::RenderInfo& renderInfo) const
{
_ss->Surface_drawImplementation(state);
_ss->Surface_drawImplementation(*renderInfo.getState());
}
osg:: BoundingBox SphereSegment::Surface::computeBound() const
@@ -101,7 +101,7 @@ public:
META_Object(osgSim,EdgeLine)
void drawImplementation(osg::State& state) const;
void drawImplementation(osg::RenderInfo& renderInfo) const;
protected:
@@ -121,9 +121,9 @@ private:
SphereSegment* _ss;
};
void SphereSegment::EdgeLine::drawImplementation(osg::State& state) const
void SphereSegment::EdgeLine::drawImplementation(osg::RenderInfo& renderInfo) const
{
_ss->EdgeLine_drawImplementation(state);
_ss->EdgeLine_drawImplementation(*renderInfo.getState());
}
osg::BoundingBox SphereSegment::EdgeLine::computeBound() const
@@ -159,7 +159,7 @@ public:
META_Object(osgSim,Side)
void drawImplementation(osg::State& state) const;
void drawImplementation(osg::RenderInfo& renderInfo) const;
protected:
@@ -172,9 +172,9 @@ private:
};
void SphereSegment::Side::drawImplementation(osg::State& state) const
void SphereSegment::Side::drawImplementation(osg::RenderInfo& renderInfo) const
{
_ss->Side_drawImplementation(state, _planeOrientation, _BoundaryAngle);
_ss->Side_drawImplementation(*renderInfo.getState(), _planeOrientation, _BoundaryAngle);
}
osg::BoundingBox SphereSegment::Side::computeBound() const
@@ -210,7 +210,7 @@ public:
META_Object(osgSim,Spoke)
void drawImplementation(osg::State& state) const;
void drawImplementation(osg::RenderInfo& renderInfo) const;
protected:
@@ -229,9 +229,9 @@ private:
SphereSegment::BoundaryAngle _azAngle, _elevAngle;
};
void SphereSegment::Spoke::drawImplementation(osg::State& state) const
void SphereSegment::Spoke::drawImplementation(osg::RenderInfo& renderInfo) const
{
_ss->Spoke_drawImplementation(state, _azAngle, _elevAngle);
_ss->Spoke_drawImplementation(*renderInfo.getState(), _azAngle, _elevAngle);
}
osg::BoundingBox SphereSegment::Spoke::computeBound() const

View File

@@ -15,7 +15,7 @@
#include <osg/DrawPixels>
#include <osg/Image>
#include <osg/Object>
#include <osg/State>
#include <osg/RenderInfo>
#include <osg/Vec3>
// Must undefine IN and OUT macros defined in Windows headers
@@ -110,11 +110,11 @@ BEGIN_OBJECT_REFLECTOR(osg::DrawPixels)
__void__getSubImageDimensions__unsigned_int_R1__unsigned_int_R1__unsigned_int_R1__unsigned_int_R1,
"",
"");
I_Method1(void, drawImplementation, IN, osg::State &, state,
I_Method1(void, drawImplementation, IN, osg::RenderInfo &, state,
Properties::VIRTUAL,
__void__drawImplementation__State_R1,
"Deprecated. ",
"");
__void__drawImplementation__RenderInfo_R1,
"drawImplementation(RenderInfo&) is a pure virtual method for the actual implementation of OpenGL drawing calls, such as vertex arrays and primitives, that must be implemented in concrete subclasses of the Drawable base class, examples include osg::Geometry and osg::ShapeDrawable. ",
" param state The osg::State object that encapulates the current OpenGL state for the current graphics context. ");
I_Method0(osg::BoundingBox, computeBound,
Properties::VIRTUAL,
__BoundingBox__computeBound,

View File

@@ -338,15 +338,10 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::Drawable)
__C5_DrawCallback_P1__getDrawCallback,
"Get the const DrawCallback. ",
"");
I_Method1(void, drawImplementation, IN, osg::State &, x,
Properties::VIRTUAL,
__void__drawImplementation__State_R1,
"Deprecated. ",
"");
I_Method1(void, drawImplementation, IN, osg::RenderInfo &, renderInfo,
Properties::VIRTUAL,
Properties::PURE_VIRTUAL,
__void__drawImplementation__RenderInfo_R1,
"drawImplementation(State&) is a pure virtual method for the actual implementation of OpenGL drawing calls, such as vertex arrays and primitives, that must be implemented in concrete subclasses of the Drawable base class, examples include osg::Geometry and osg::ShapeDrawable. ",
"drawImplementation(RenderInfo&) is a pure virtual method for the actual implementation of OpenGL drawing calls, such as vertex arrays and primitives, that must be implemented in concrete subclasses of the Drawable base class, examples include osg::Geometry and osg::ShapeDrawable. ",
" param state The osg::State object that encapulates the current OpenGL state for the current graphics context. ");
I_Method1(bool, supports, IN, const osg::Drawable::AttributeFunctor &, x,
Properties::VIRTUAL,
@@ -767,12 +762,7 @@ BEGIN_OBJECT_REFLECTOR(osg::Drawable::DrawCallback)
__C5_char_P1__className,
"return the name of the object's class type. ",
"Must be defined by derived classes. ");
I_Method2(void, drawImplementation, IN, osg::State &, x, IN, const osg::Drawable *, x,
Properties::VIRTUAL,
__void__drawImplementation__osg_State_R1__C5_osg_Drawable_P1,
"Deprecated. ",
"");
I_Method2(void, drawImplementation, IN, osg::RenderInfo &, renderInfo, IN, const osg::Drawable *, drawable,
I_Method2(void, drawImplementation, IN, osg::RenderInfo &, x, IN, const osg::Drawable *, x,
Properties::VIRTUAL,
__void__drawImplementation__osg_RenderInfo_R1__C5_osg_Drawable_P1,
"do customized draw code. ",

View File

@@ -16,7 +16,7 @@
#include <osg/Geometry>
#include <osg/Object>
#include <osg/PrimitiveSet>
#include <osg/State>
#include <osg/RenderInfo>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
@@ -617,9 +617,9 @@ BEGIN_OBJECT_REFLECTOR(osg::Geometry)
__unsigned_int__getGLObjectSizeHint,
"Return the estimated size of GLObjects (display lists/vertex buffer objects) that are associated with this drawable. ",
"This size is used a hint for reuse of deleteed display lists/vertex buffer objects. ");
I_Method1(void, drawImplementation, IN, osg::State &, state,
I_Method1(void, drawImplementation, IN, osg::RenderInfo &, renderInfo,
Properties::VIRTUAL,
__void__drawImplementation__State_R1,
__void__drawImplementation__RenderInfo_R1,
"Draw Geometry directly ignoring an OpenGL display list which could be attached. ",
"This is the internal draw method which does the drawing itself, and is the method to override when deriving from Geometry for user-drawn objects.");
I_Method1(bool, supports, IN, const osg::Drawable::AttributeFunctor &, x,

View File

@@ -15,9 +15,9 @@
#include <osg/Drawable>
#include <osg/Object>
#include <osg/PrimitiveSet>
#include <osg/RenderInfo>
#include <osg/Shape>
#include <osg/ShapeDrawable>
#include <osg/State>
#include <osg/Vec4>
// Must undefine IN and OUT macros defined in Windows headers
@@ -91,9 +91,9 @@ BEGIN_OBJECT_REFLECTOR(osg::ShapeDrawable)
__C5_TessellationHints_P1__getTessellationHints,
"",
"");
I_Method1(void, drawImplementation, IN, osg::State &, state,
I_Method1(void, drawImplementation, IN, osg::RenderInfo &, renderInfo,
Properties::VIRTUAL,
__void__drawImplementation__State_R1,
__void__drawImplementation__RenderInfo_R1,
"Draw ShapeDrawable directly ignoring an OpenGL display list which could be attached. ",
"This is the internal draw method which does the drawing itself, and is the method to override when deriving from ShapeDrawable for user-drawn objects.");
I_Method1(bool, supports, IN, const osg::Drawable::AttributeFunctor &, x,

View File

@@ -12,7 +12,7 @@
#include <osg/CopyOp>
#include <osg/Object>
#include <osg/State>
#include <osg/RenderInfo>
#include <osgParticle/ConnectedParticleSystem>
#include <osgParticle/Particle>
@@ -68,9 +68,9 @@ BEGIN_OBJECT_REFLECTOR(osgParticle::ConnectedParticleSystem)
__void__reuseParticle__int,
"Reuse the i-th particle. ",
"");
I_Method1(void, drawImplementation, IN, osg::State &, state,
I_Method1(void, drawImplementation, IN, osg::RenderInfo &, renderInfo,
Properties::VIRTUAL,
__void__drawImplementation__osg_State_R1,
__void__drawImplementation__osg_RenderInfo_R1,
"Draw the connected particles as either a line or a quad strip, depending upon viewing distance. . ",
"");
I_Method0(const osgParticle::Particle *, getStartParticle,

View File

@@ -13,7 +13,7 @@
#include <osg/BoundingBox>
#include <osg/CopyOp>
#include <osg/Object>
#include <osg/State>
#include <osg/RenderInfo>
#include <osg/Vec3>
#include <osgParticle/Particle>
#include <osgParticle/ParticleSystem>
@@ -220,11 +220,11 @@ BEGIN_OBJECT_REFLECTOR(osgParticle::ParticleSystem)
__void__update__double,
"Update the particles. Don't call this directly, use a ParticleSystemUpdater instead. ",
"");
I_Method1(void, drawImplementation, IN, osg::State &, state,
I_Method1(void, drawImplementation, IN, osg::RenderInfo &, renderInfo,
Properties::VIRTUAL,
__void__drawImplementation__osg_State_R1,
"Deprecated. ",
"");
__void__drawImplementation__osg_RenderInfo_R1,
"drawImplementation(RenderInfo&) is a pure virtual method for the actual implementation of OpenGL drawing calls, such as vertex arrays and primitives, that must be implemented in concrete subclasses of the Drawable base class, examples include osg::Geometry and osg::ShapeDrawable. ",
" param state The osg::State object that encapulates the current OpenGL state for the current graphics context. ");
I_Method0(osg::BoundingBox, computeBound,
Properties::VIRTUAL,
__osg_BoundingBox__computeBound,

View File

@@ -402,7 +402,7 @@ BEGIN_OBJECT_REFLECTOR(osgParticle::PrecipitationEffect::PrecipitationDrawable)
I_Method1(void, drawImplementation, IN, osg::RenderInfo &, renderInfo,
Properties::VIRTUAL,
__void__drawImplementation__osg_RenderInfo_R1,
"drawImplementation(State&) is a pure virtual method for the actual implementation of OpenGL drawing calls, such as vertex arrays and primitives, that must be implemented in concrete subclasses of the Drawable base class, examples include osg::Geometry and osg::ShapeDrawable. ",
"drawImplementation(RenderInfo&) is a pure virtual method for the actual implementation of OpenGL drawing calls, such as vertex arrays and primitives, that must be implemented in concrete subclasses of the Drawable base class, examples include osg::Geometry and osg::ShapeDrawable. ",
" param state The osg::State object that encapulates the current OpenGL state for the current graphics context. ");
I_Method0(osgParticle::PrecipitationEffect::PrecipitationDrawable::CellMatrixMap &, getCurrentCellMatrixMap,
Properties::NON_VIRTUAL,

View File

@@ -17,7 +17,7 @@
#include <osg/Matrix>
#include <osg/Object>
#include <osg/PrimitiveSet>
#include <osg/State>
#include <osg/RenderInfo>
#include <osg/StateSet>
#include <osg/Texture2D>
#include <osg/Vec2>
@@ -158,9 +158,9 @@ BEGIN_OBJECT_REFLECTOR(osgSim::ImpostorSprite)
__int__t,
"",
"");
I_Method1(void, drawImplementation, IN, osg::State &, state,
I_Method1(void, drawImplementation, IN, osg::RenderInfo &, renderInfo,
Properties::VIRTUAL,
__void__drawImplementation__osg_State_R1,
__void__drawImplementation__osg_RenderInfo_R1,
"Draw ImpostorSprite directly. ",
"");
I_Method1(bool, supports, IN, const osg::Drawable::AttributeFunctor &, x,