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

@ -26,7 +26,7 @@
const std::string IMAGE_PATH = "osgWidget/";
template <class T>
struct Sampler: public osg::Drawable::UpdateCallback
struct Sampler: public osg::DrawableUpdateCallback
{
T _motion;
Sampler() {

View File

@ -65,7 +65,7 @@ class DrawableDrawCallback : public osg::Drawable::DrawCallback
}
};
struct DrawableUpdateCallback : public osg::Drawable::UpdateCallback
struct DrawableUpdateCallback : public osg::DrawableUpdateCallback
{
virtual void update(osg::NodeVisitor*, osg::Drawable* drawable)
{
@ -73,7 +73,7 @@ struct DrawableUpdateCallback : public osg::Drawable::UpdateCallback
}
};
struct DrawableCullCallback : public osg::Drawable::CullCallback
struct DrawableCullCallback : public osg::DrawableCullCallback
{
/** do customized cull code.*/
virtual bool cull(osg::NodeVisitor*, osg::Drawable* drawable, osg::State* /*state*/) const
@ -158,7 +158,7 @@ class CameraEventCallback : public osg::NodeCallback
};
struct TestDrawableUpdateCallback : public osg::Drawable::UpdateCallback
struct TestDrawableUpdateCallback : public osg::DrawableUpdateCallback
{
TestDrawableUpdateCallback(const std::string &message): _message(message) {}

View File

@ -1143,7 +1143,7 @@ osg::Geometry* buildGPUCullGeometry( const std::vector<DynamicInstance>& instanc
// instance wandering ( object goes to random destination point and when it reaches
// destination, it picks another random point and so on ).
// Object parts are animated ( wheels and propellers )
struct AnimateObjectsCallback : public osg::Drawable::UpdateCallback
struct AnimateObjectsCallback : public osg::DrawableUpdateCallback
{
AnimateObjectsCallback( osg::BufferTemplate< std::vector<DynamicInstance> >* instances, osg::Image* instancesImage, const osg::BoundingBox& bbox, unsigned int quantityPerType )
: _instances(instances), _instancesImage(instancesImage), _bbox(bbox), _quantityPerType(quantityPerType), _lastTime(0.0)

View File

@ -41,10 +41,10 @@
#include <iostream>
class ImageStreamStateCallback : public osg::Drawable::UpdateCallback {
class ImageStreamStateCallback : public osg::DrawableUpdateCallback {
public:
ImageStreamStateCallback(osgText::Text* text, osg::ImageStream* is)
: osg::Drawable::UpdateCallback()
: osg::DrawableUpdateCallback()
, _text(text)
, _imageStream(is)
, _fps(0)

View File

@ -47,7 +47,7 @@
// call back which creates a deformation field to oscillate the model.
class MyGeometryCallback :
public osg::Drawable::UpdateCallback,
public osg::DrawableUpdateCallback,
public osg::Drawable::AttributeFunctor
{
public:

View File

@ -22,7 +22,7 @@ namespace osg {
/** Implements cluster culling to cull back facing drawables. Derived from
* Drawable::CullCallback.
*/
class OSG_EXPORT ClusterCullingCallback : public Drawable::CullCallback, public NodeCallback
class OSG_EXPORT ClusterCullingCallback : public DrawableCullCallback, public NodeCallback
{
public:

View File

@ -137,7 +137,7 @@ namespace osgAnimation
bool link(osgAnimation::Channel* channel);
};
struct UpdateMorphGeometry : public osg::Drawable::UpdateCallback
struct UpdateMorphGeometry : public osg::DrawableUpdateCallback
{
UpdateMorphGeometry() {}

View File

@ -123,7 +123,7 @@ namespace osgAnimation
};
struct UpdateRigGeometry : public osg::Drawable::UpdateCallback
struct UpdateRigGeometry : public osg::DrawableUpdateCallback
{
UpdateRigGeometry() {}

View File

@ -30,7 +30,7 @@ namespace osgGA{
EventHandler is base class for adding handling of events, either as node event callback, drawable event callback or an event handler attached directly to the view(er)
*/
class OSGGA_EXPORT EventHandler : public osg::NodeCallback, public osg::Drawable::EventCallback
class OSGGA_EXPORT EventHandler : public osg::NodeCallback, public osg::DrawableEventCallback
{
public:
@ -39,7 +39,7 @@ public:
osg::Object(eh, copyop),
osg::Callback(eh, copyop),
osg::NodeCallback(eh, copyop),
osg::Drawable::EventCallback(eh, copyop) {}
osg::DrawableEventCallback(eh, copyop) {}
META_Object(osgGA, EventHandler);

View File

@ -499,7 +499,7 @@ class OSGVIEWER_EXPORT ScreenCaptureHandler : public osgGA::GUIEventHandler
/** InteractiveImage is an event handler that computes the mouse coordinates in an images coordinate frame
* and then passes keyboard and mouse events to it. This event handler is useful for vnc or browser
* surfaces in the 3D scene.*/
class OSGVIEWER_EXPORT InteractiveImageHandler : public osgGA::GUIEventHandler, public osg::Drawable::CullCallback
class OSGVIEWER_EXPORT InteractiveImageHandler : public osgGA::GUIEventHandler, public osg::DrawableCullCallback
{
public:
@ -524,7 +524,7 @@ protected:
InteractiveImageHandler() {}
InteractiveImageHandler(const InteractiveImageHandler&,const osg::CopyOp& = osg::CopyOp::SHALLOW_COPY):
osg::Object(), osg::Callback(), osgGA::GUIEventHandler(), osg::Drawable::CullCallback(), _fullscreen(false) {}
osg::Object(), osg::Callback(), osgGA::GUIEventHandler(), osg::DrawableCullCallback(), _fullscreen(false) {}
bool mousePosition(osgViewer::View* view, osg::NodeVisitor* nv, const osgGA::GUIEventAdapter& ea, int& x, int &y) const;

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);