diff --git a/include/osg/Callback b/include/osg/Callback index 891fa8aa2..51c7fb136 100644 --- a/include/osg/Callback +++ b/include/osg/Callback @@ -26,7 +26,8 @@ class OSG_EXPORT Callback : public virtual Object { Callback(){} - Callback(const Callback& cb,const CopyOp&): + Callback(const Callback& cb,const CopyOp& copyop): + osg::Object(cb, copyop), _nestedCallback(cb._nestedCallback) {} META_Object(osg, Callback); @@ -96,7 +97,10 @@ class OSG_EXPORT CallbackObject : public virtual osg::Callback public: CallbackObject() {} CallbackObject(const std::string& name) { setName(name); } - CallbackObject(const CallbackObject& rhs, const osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY):osg::Callback(rhs,copyop) {} + CallbackObject(const CallbackObject& co, const osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY): + osg::Object(co, copyop), + osg::Callback(co,copyop) {} + META_Object(osg, CallbackObject); virtual CallbackObject* asCallbackObject() { return this; } diff --git a/include/osg/Object b/include/osg/Object index 2b7f95915..a5e44551d 100644 --- a/include/osg/Object +++ b/include/osg/Object @@ -274,7 +274,7 @@ class DummyObject : public osg::Object { public: DummyObject() {} - DummyObject(const DummyObject& dummy, const osg::CopyOp& copyop) {} + DummyObject(const DummyObject&, const osg::CopyOp&) {} META_Object(osg, DummyObject) protected: virtual ~DummyObject() {} diff --git a/include/osg/ScriptEngine b/include/osg/ScriptEngine index c382fcd8f..a6d5dd3bc 100644 --- a/include/osg/ScriptEngine +++ b/include/osg/ScriptEngine @@ -31,7 +31,7 @@ class Script : public osg::Object public: Script():_modifiedCount(0) {} Script(const std::string& language, const std::string& str): _language(language), _script(str), _modifiedCount(0) {} - Script(const Script& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): _language(rhs._language), _script(rhs._script), _modifiedCount(0) {} + Script(const Script& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): osg::Object(rhs,copyop), _language(rhs._language), _script(rhs._script), _modifiedCount(0) {} META_Object(osg, Script) @@ -59,7 +59,10 @@ class OSG_EXPORT ScriptNodeCallback : public osg::NodeCallback { public: ScriptNodeCallback(Script* script=0, const std::string& entryPoint="") : _script(script), _entryPoint(entryPoint) {} - ScriptNodeCallback(const ScriptNodeCallback& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): osg::NodeCallback(rhs,copyop), _script(rhs._script) {} + ScriptNodeCallback(const ScriptNodeCallback& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): + osg::Object(rhs,copyop), + osg::Callback(rhs,copyop), + osg::NodeCallback(rhs,copyop), _script(rhs._script) {} META_Object(osg, ScriptNodeCallback) diff --git a/include/osgDB/Serializer b/include/osgDB/Serializer index b52ff8497..2906c0bea 100644 --- a/include/osgDB/Serializer +++ b/include/osgDB/Serializer @@ -839,15 +839,15 @@ public: Type getElementType() const { return _elementType; } unsigned int getElementSize() const { return _elementSize; } - virtual unsigned int size(const osg::Object& obj) const { return 0; } - virtual void resize(osg::Object& obj, unsigned int numElements) const {} - virtual void reserve(osg::Object& obj, unsigned int numElements) const {} - virtual void clear(osg::Object& obj) const {} - virtual void addElement(osg::Object& obj, void* ptr) const {} - virtual void insertElement(osg::Object& obj, unsigned int index, void* ptr) const {} - virtual void setElement(osg::Object& obj, unsigned int index, void* ptr) const {} - virtual void* getElement(osg::Object& obj, unsigned int index) const { return 0; } - virtual const void* getElement(const osg::Object& obj, unsigned int index) const { return 0; } + virtual unsigned int size(const osg::Object& /*obj*/) const { return 0; } + virtual void resize(osg::Object& /*obj*/, unsigned int /*numElements*/) const {} + virtual void reserve(osg::Object& /*obj*/, unsigned int /*numElements*/) const {} + virtual void clear(osg::Object& /*obj*/) const {} + virtual void addElement(osg::Object& /*obj*/, void* /*ptr*/) const {} + virtual void insertElement(osg::Object& /*obj*/, unsigned int /*index*/, void* /*ptr*/) const {} + virtual void setElement(osg::Object& /*obj*/, unsigned int /*index*/, void* /*ptr*/) const {} + virtual void* getElement(osg::Object& /*obj*/, unsigned int /*index*/) const { return 0; } + virtual const void* getElement(const osg::Object& /*obj*/, unsigned int /*index*/) const { return 0; } protected: Type _elementType; @@ -1199,7 +1199,7 @@ public: virtual bool valid() const { return false; } virtual const void* getKey() const { return 0; } virtual void* getElement() const { return 0; } - virtual void setElement(void* ptr) const {} + virtual void setElement(void* /*ptr*/) const {} protected: BaseSerializer::Type _keyType; @@ -1224,14 +1224,14 @@ public: Type getElementType() const { return _elementType; } unsigned int getElementSize() const { return _elementSize; } - virtual void clear(osg::Object& obj) const {} - virtual void setElement(osg::Object& obj, void* ptrKey, void* ptrValue) const {} - virtual void* getElement(osg::Object& obj, void* ptrKey) const { return 0; } - virtual const void* getElement(const osg::Object& obj, void* ptrKey) const { return 0; } - virtual unsigned int size(const osg::Object& obj) const { return 0; } + virtual void clear(osg::Object& /*obj*/) const {} + virtual void setElement(osg::Object& /*obj*/, void* /*ptrKey*/, void* /*ptrValue*/) const {} + virtual void* getElement(osg::Object& /*obj*/, void* /*ptrKey*/) const { return 0; } + virtual const void* getElement(const osg::Object& /*obj*/, void* /*ptrKey*/) const { return 0; } + virtual unsigned int size(const osg::Object& /*obj*/) const { return 0; } - virtual MapIteratorObject* createIterator(osg::Object& obj) const { return 0; } - virtual MapIteratorObject* createReverseIterator(osg::Object& obj) const { return 0; } + virtual MapIteratorObject* createIterator(osg::Object& /*obj*/) const { return 0; } + virtual MapIteratorObject* createReverseIterator(osg::Object& /*obj*/) const { return 0; } protected: Type _keyType; diff --git a/include/osgGA/EventHandler b/include/osgGA/EventHandler index 95b38d04e..56b938a20 100644 --- a/include/osgGA/EventHandler +++ b/include/osgGA/EventHandler @@ -36,7 +36,8 @@ public: EventHandler() {} EventHandler(const EventHandler& eh,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): - osg::Callback(eh,copyop), + osg::Object(eh, copyop), + osg::Callback(eh, copyop), osg::NodeCallback(eh, copyop), osg::Drawable::EventCallback(eh, copyop) {} diff --git a/include/osgGA/GUIEventHandler b/include/osgGA/GUIEventHandler index 1c9fd2e8a..eaa0fbdbe 100644 --- a/include/osgGA/GUIEventHandler +++ b/include/osgGA/GUIEventHandler @@ -50,16 +50,11 @@ class OSGGA_EXPORT GUIEventHandler : public EventHandler { public: -#if 1 GUIEventHandler() {} GUIEventHandler(const GUIEventHandler& eh,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): - osg::Callback(eh, copyop), EventHandler(eh, copyop) {} -#else - GUIEventHandler() : _ignoreHandledEventsMask(GUIEventAdapter::NONE) {} - GUIEventHandler(const GUIEventHandler& eh,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): - EventHandler(eh, copyop) - _ignoreHandledEventsMask(eh._ignoreHandledEventsMask) {} -#endif + osg::Object(eh, copyop), + osg::Callback(eh, copyop), + EventHandler(eh, copyop) {} META_Object(osgGA,GUIEventHandler); @@ -69,59 +64,9 @@ public: /** Handle events, return true if handled, false otherwise. */ virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor*) { return handle(ea,aa); } -#if 0 - /** Convenience method that only passes on to the handle(,,,) method events that either haven't been - * handled yet, or have been handled but haven't be set to be ignored by the IgnoreHandledEventsMask. - * Note, this method is an inline method, and not appropriate for users to override, override the handle(,,,) - * method instead.*/ - inline bool handleWithCheckAgainstIgnoreHandledEventsMask(const GUIEventAdapter& ea,GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv) - { - if (!ea.getHandled() || - (ea.getEventType() & _ignoreHandledEventsMask)==0) - { - bool handled = handle(ea,aa,object,nv); - if (handled) ea.setHandled(true); - return handled; - } - else - { - return false; - } - } -#endif /** Deprecated, Handle events, return true if handled, false otherwise. */ virtual bool handle(const GUIEventAdapter&,GUIActionAdapter&) { return false; } -#if 0 - /** Convenience method that only passes on to the handle(,) method events that either haven't been - * handled yet, or have been handled but haven't be set to be ignored by the IgnoreHandledEventsMask. - * Note, this method is an inline method, and not appropriate for users to override, override the handle(,) - * method instead.*/ - inline bool handleWithCheckAgainstIgnoreHandledEventsMask(const GUIEventAdapter& ea,GUIActionAdapter& aa) - { - if (!ea.getHandled() || - (ea.getEventType() & _ignoreHandledEventsMask)==0) - { - bool handled = handle(ea,aa); - if (handled) ea.setHandled(true); - return handled; - } - else - { - return false; - } - } - - /** Set a mask of osgGA::GUIEeventAdapter::Event to be ignored if marked as handled */ - void setIgnoreHandledEventsMask(unsigned int mask) { _ignoreHandledEventsMask = mask; } - - /** Get the event mask of the osgGA::GUIEeventAdapter::Event to be ignored if marked as handled */ - unsigned int getIgnoreHandledEventsMask() const { return _ignoreHandledEventsMask; }; - -protected: - unsigned int _ignoreHandledEventsMask; -#endif - protected: virtual ~GUIEventHandler(); diff --git a/include/osgViewer/ViewerEventHandlers b/include/osgViewer/ViewerEventHandlers index 659e59b1a..65e71b18d 100644 --- a/include/osgViewer/ViewerEventHandlers +++ b/include/osgViewer/ViewerEventHandlers @@ -528,7 +528,7 @@ protected: InteractiveImageHandler() {} InteractiveImageHandler(const InteractiveImageHandler&,const osg::CopyOp& = osg::CopyOp::SHALLOW_COPY): - osg::Callback(), osgGA::GUIEventHandler(), osg::Drawable::CullCallback(), _fullscreen(false) {} + osg::Object(), osg::Callback(), osgGA::GUIEventHandler(), osg::Drawable::CullCallback(), _fullscreen(false) {} bool mousePosition(osgViewer::View* view, osg::NodeVisitor* nv, const osgGA::GUIEventAdapter& ea, int& x, int &y) const;