Show
Ignore:
Timestamp:
09/19/14 12:35:23 (12 days ago)
Author:
robert
Message:

Moved widgets from VolumeEditorWidget? to TransferFunctionWidget?, and widget utilities into WidgetUtils?.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgGA/GUIEventHandler

    r13041 r13890  
    2121#include <osg/ApplicationUsage> 
    2222 
    23 #include <osgGA/Export> 
     23#include <osgGA/EventHandler> 
    2424#include <osgGA/GUIEventAdapter> 
    2525#include <osgGA/GUIActionAdapter> 
     
    4848*/ 
    4949 
    50 class OSGGA_EXPORT GUIEventHandler : public osg::NodeCallback, public osg::Drawable::EventCallback 
     50class OSGGA_EXPORT GUIEventHandler : public EventHandler 
    5151{ 
    5252public: 
    5353 
     54#if 1 
     55        GUIEventHandler() {} 
     56        GUIEventHandler(const GUIEventHandler& eh,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): 
     57            EventHandler(eh, copyop) {} 
     58#else 
    5459        GUIEventHandler() : _ignoreHandledEventsMask(GUIEventAdapter::NONE) {} 
    55         GUIEventHandler(const GUIEventHandler& eh,const osg::CopyOp& copyop): 
    56             osg::NodeCallback(eh, copyop), 
    57             osg::Drawable::EventCallback(eh, copyop), 
     60        GUIEventHandler(const GUIEventHandler& eh,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): 
     61            EventHandler(eh, copyop) 
    5862            _ignoreHandledEventsMask(eh._ignoreHandledEventsMask) {} 
     63#endif 
    5964 
    6065        META_Object(osgGA,GUIEventHandler); 
    6166 
    62         /** Event traversal node callback method.*/ 
    63         virtual void operator()(osg::Node* node, osg::NodeVisitor* nv); 
    64  
    65         /** Event traversal drawable callback method.*/ 
    66         virtual void event(osg::NodeVisitor* nv, osg::Drawable* drawable); 
     67        /** Handle event. Override the handle(..) method in your event handlers to respond to events. */ 
     68        virtual bool handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv); 
    6769 
    6870        /** Handle events, return true if handled, false otherwise. */ 
    6971        virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor*) { return handle(ea,aa); } 
    7072 
     73#if 0 
    7174        /** Convenience method that only passes on to the handle(,,,) method events that either haven't been 
    7275          * handled yet, or have been handled but haven't be set to be ignored by the IgnoreHandledEventsMask. 
     
    8790            } 
    8891        } 
    89  
     92#endif 
    9093        /** Deprecated, Handle events, return true if handled, false otherwise. */ 
    9194        virtual bool handle(const GUIEventAdapter&,GUIActionAdapter&) { return false; } 
    9295 
     96#if 0 
    9397        /** Convenience method that only passes on to the handle(,) method events that either haven't been 
    9498          * handled yet, or have been handled but haven't be set to be ignored by the IgnoreHandledEventsMask. 
     
    110114        } 
    111115 
    112         /** Get the keyboard and mouse usage of this manipulator.*/ 
    113         virtual void getUsage(osg::ApplicationUsage&) const {} 
    114  
    115116        /** Set a mask of osgGA::GUIEeventAdapter::Event to be ignored if marked as handled */ 
    116117        void setIgnoreHandledEventsMask(unsigned int mask) { _ignoreHandledEventsMask = mask; } 
     
    121122protected: 
    122123        unsigned int _ignoreHandledEventsMask; 
    123  
     124#endif 
    124125}; 
    125  
    126 #ifdef USE_DEPRECATED_API 
    127     // keep for backwards compatibility 
    128     class GUIEventHandlerVisitor 
    129     { 
    130         public: 
    131  
    132             void visit(GUIEventHandler&) {} 
    133     }; 
    134 #endif 
    135126 
    136127}