MeVisLabToolboxReference
MeVisLab/Standard/Sources/Inventor/SoUtils/SoFocus.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //----------------------------------------------------------------------------------
00005 
00012 //----------------------------------------------------------------------------------
00013 
00014 #ifndef __SoFocus_H
00015 #define __SoFocus_H
00016 
00017 // Local includes
00018 #ifndef __SoUtilsSystem_H
00019 #include "SoUtilsSystem.h"
00020 #endif
00021 #ifndef __SoFocusElement_H
00022 #include "SoFocusElement.h"
00023 #endif
00024 
00025 // Wrap inventor includes into XVEnterScope and XVLeaveScope to avoid
00026 // collisions between Open Inventor and Windows headers.
00027 
00028 #include "XVEnterScope.h"
00029 #include <Inventor/fields/SoSFVec2f.h>
00030 #include <Inventor/sensors/SoNodeSensor.h>
00031 #include "XVLeaveScope.h"
00032 
00033 
00036 class SOUTILS_EXPORT SoFocus : public SoNode
00037 {
00039   SO_NODE_HEADER(SoFocus);
00040 
00041 public:
00043   SoFocus();
00044 
00046   static void       initClass();
00047 
00049 
00051   SoSFBool          active;
00052 
00054   SoSFBool          hasFocus;
00055 
00057   SoSFBool          supportWheelEvents;
00058 
00063   SoSFVec2f         normClickCoords;
00064 
00066 
00069   virtual void      handleEvent(SoHandleEventAction *action);
00070 
00073   void              setFocusState(FocusState state, bool updateField = true);
00074   
00075 protected:
00077   virtual            ~SoFocus();
00078 
00080   SoNodeSensor      *_nodeSensor;
00081 
00085   static void       nodeChangedCB(void *data, SoSensor* sens);
00086 
00088   void              nodeChanged(SoNodeSensor* sensor);
00089 
00091   virtual void      GLRender(SoGLRenderAction *action);
00092 
00093 private:
00094 
00096   SbFocusInfo       _focusInfo;
00097 
00100   static SoFocus*   _focusNode;
00101 
00103   void              _freeFocus();
00104   
00105 };
00106 
00107 #endif // __SoFocus_H
00108 
00109