![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtOsgEventHandler.h,v $ $Revision: 1.12 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #pragma once 00014 00015 #include <vrvOsg/vrvOsg.h> 00016 #include <osgViewer/ViewerEventHandlers> 00017 #include <vrvOsg/DtOsgKeyAndMouseEventListener.h> 00018 00019 namespace osgViewer 00020 { 00021 class Window; 00022 } 00023 00024 namespace makVrv 00025 { 00026 class DtOsgKeyAndMouseEventListener; 00027 class DtChannel; 00028 00031 class DT_DLL_VRVOSG DtOsgEventHandler : public osgGA::GUIEventHandler 00032 { 00033 public: 00035 DtOsgEventHandler( DtOsgKeyAndMouseEventListener* listener, 00036 DtChannel* channel); 00037 00039 virtual ~DtOsgEventHandler(); 00040 00042 virtual bool handle( const osgGA::GUIEventAdapter& ea, 00043 osgGA::GUIActionAdapter& ); 00044 00046 inline DtChannel* channel() 00047 { 00048 return myChannel; 00049 } 00050 00052 inline const DtChannel* channel() const 00053 { 00054 return myChannel; 00055 } 00056 00058 virtual void accept( osgGA::GUIEventHandlerVisitor& v ) 00059 { 00060 v.visit(*this); 00061 } 00062 00067 void setListener( DtOsgKeyAndMouseEventListener* listener ); 00068 00069 private: 00071 DtOsgEventHandler( const DtOsgEventHandler& ); 00072 00074 DtOsgEventHandler& operator=( const DtOsgEventHandler& ); 00075 00076 protected: 00077 00078 DtOsgKeyAndMouseEventListener* myOsgListener; 00079 DtChannel* myChannel; 00080 }; 00081 } 00082