Renamed DrawableUpdate/Event/Cull callbacks to use new include/osg/Callback versions

This commit is contained in:
Robert Osfield
2016-01-19 11:39:28 +00:00
parent e8fd414661
commit 55a8f4abbc
18 changed files with 34 additions and 27 deletions

View File

@@ -29,7 +29,7 @@ ClusterCullingCallback::ClusterCullingCallback():
}
ClusterCullingCallback::ClusterCullingCallback(const ClusterCullingCallback& ccc,const CopyOp& copyop):
Drawable::CullCallback(ccc,copyop),
DrawableCullCallback(ccc,copyop),
_controlPoint(ccc._controlPoint),
_normal(ccc._normal),
_radius(ccc._radius),

View File

@@ -106,7 +106,7 @@ struct StatsGraph : public osg::MatrixTransform
osg::ref_ptr<osg::Geode> _statsGraphGeode;
struct NeverCull : public osg::Drawable::CullCallback
struct NeverCull : public osg::DrawableCullCallback
{
NeverCull() {}
bool cull(osg::NodeVisitor* /*nv*/, osg::Drawable* /*drawable*/, osg::RenderInfo* /*renderInfo*/) const { return false;}
@@ -137,7 +137,7 @@ struct StatsGraph : public osg::MatrixTransform
};
struct GraphUpdateCallback : public osg::Drawable::UpdateCallback
struct GraphUpdateCallback : public osg::DrawableUpdateCallback
{
const unsigned int _width;

View File

@@ -566,7 +566,7 @@ void CompositeDragger::setIntersectionMask(osg::Node::NodeMask intersectionMask)
}
}
class ForceCullCallback : public osg::Drawable::CullCallback
class ForceCullCallback : public osg::DrawableCullCallback
{
public:
virtual bool cull(osg::NodeVisitor*, osg::Drawable*, osg::State*) const

View File

@@ -33,7 +33,7 @@ class Logos: public osg::Drawable
last_position
};
struct logosCullCallback : public osg::Drawable::CullCallback
struct logosCullCallback : public osg::DrawableCullCallback
{
virtual bool cull(osg::NodeVisitor *visitor, osg::Drawable* drawable, osg::State*) const
{

View File

@@ -270,7 +270,7 @@ GlobalFadeText* getGlobalFadeText()
return s_globalFadeText.get();
}
struct FadeText::FadeTextUpdateCallback : public osg::Drawable::UpdateCallback
struct FadeText::FadeTextUpdateCallback : public osg::DrawableUpdateCallback
{
FadeTextData _ftd;

View File

@@ -985,7 +985,7 @@ void CullVisitor::apply(osg::Drawable& drawable)
if( drawable.getCullCallback() )
{
osg::Drawable::CullCallback* dcb = dynamic_cast<osg::Drawable::CullCallback*>(drawable.getCullCallback());
osg::DrawableCullCallback* dcb = drawable.getCullCallback()->asDrawableCullCallback();
if (dcb)
{
if( dcb->cull( this, &drawable, &_renderInfo ) == true ) return;
@@ -1076,7 +1076,7 @@ void CullVisitor::apply(Billboard& node)
if( drawable->getCullCallback() )
{
osg::Drawable::CullCallback* dcb = dynamic_cast<osg::Drawable::CullCallback*>(drawable->getCullCallback());
osg::DrawableCullCallback* dcb = drawable->getCullCallback()->asDrawableCullCallback();
if (dcb && dcb->cull( this, drawable, &_renderInfo ) == true )
continue;
}

View File

@@ -91,7 +91,7 @@ void Keystone::compute3DPositions(osg::DisplaySettings* ds, osg::Vec3& tl, osg::
//
// Keystone helper functions
//
struct KeystoneCullCallback : public osg::Drawable::CullCallback
struct KeystoneCullCallback : public osg::DrawableCullCallback
{
KeystoneCullCallback(Keystone* keystone=0):_keystone(keystone) {}
KeystoneCullCallback(const KeystoneCullCallback&, const osg::CopyOp&) {}
@@ -108,7 +108,7 @@ struct KeystoneCullCallback : public osg::Drawable::CullCallback
};
struct KeystoneUpdateCallback : public osg::Drawable::UpdateCallback
struct KeystoneUpdateCallback : public osg::DrawableUpdateCallback
{
KeystoneUpdateCallback(Keystone* keystone=0):_keystone(keystone) {}
KeystoneUpdateCallback(const KeystoneUpdateCallback&, const osg::CopyOp&) {}

View File

@@ -41,14 +41,21 @@ bool Drawable_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
Drawable::UpdateCallback* uc = fr.readObjectOfType<Drawable::UpdateCallback>();
DrawableUpdateCallback* uc = fr.readObjectOfType<DrawableUpdateCallback>();
if (uc)
{
drawable.setUpdateCallback(uc);
iteratorAdvanced = true;
}
Drawable::CullCallback* cc = fr.readObjectOfType<Drawable::CullCallback>();
DrawableEventCallback* ec = fr.readObjectOfType<DrawableEventCallback>();
if (ec)
{
drawable.setEventCallback(ec);
iteratorAdvanced = true;
}
DrawableCullCallback* cc = fr.readObjectOfType<DrawableCullCallback>();
if (cc)
{
drawable.setCullCallback(cc);