00001 
00002 
00003 
00004 
00005 #ifndef MFCEventToSoEvent_h
00006 #define MFCEventToSoEvent_h
00007 
00008 #include <Inventor/ViewerComponents/MFC/StdAfx.h>
00009 
00010 #include <Inventor/ViewerComponents/SoEventBuilder.h>
00011 #include <Inventor/Events/SoMouseButtonEvent.h>
00012 
00013 class RenderArea;
00014 
00018 class MFCVIEWERCOMPONENTS_API MFCEventToSoEvent
00019 {
00020 
00021 public:
00022 
00026   static SoMouseButtonEvent* getMousePressEvent( CPoint loc, SoMouseButtonEvent::Button button, RenderArea* renderArea );
00027 
00031   static SoMouseButtonEvent* getMouseReleaseEvent( CPoint loc, SoMouseButtonEvent::Button button, RenderArea* renderArea );
00032 
00036   static SoMouseButtonEvent* getMouseDoubleClickEvent( CPoint loc, SoMouseButtonEvent::Button button, RenderArea* renderArea );
00037 
00041   static SoLocation2Event* getMouseMoveEvent( CPoint loc, RenderArea* renderArea );
00042 
00046   static SoMouseWheelEvent* getMouseWheelEvent( short zDelta, RenderArea* );
00047 
00051   static SoLocation2Event* getMouseEnterEvent( RenderArea* );
00052 
00056   static SoLocation2Event* getMouseLeaveEvent( RenderArea* );
00057 
00061   static SoKeyboardEvent* getKeyPressEvent( WPARAM param, RenderArea* );
00062 
00066   static SoKeyboardEvent* getKeyReleaseEvent( WPARAM param, RenderArea* );
00067 
00068 private:
00069   static bool initClass();
00070   static bool s_init;
00071 
00072   static SoKeyboardEvent::Key getIvKey( WPARAM param );
00073   static SoEventBuilder m_ivEvent;
00074 
00075   static SoKeyboardEvent::Key keyMap[256];
00076   static int keyMapInitFlag;
00077 
00078   static bool m_ctrlModifier;
00079   static bool m_altModifier;
00080   static bool m_shiftModifier;
00081 };
00082 
00083 #endif // MFCEventToSoEvent
00084