]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/FGManipulator.hxx
Really implement fgWarpMouse for osgviewer
[flightgear.git] / src / Main / FGManipulator.hxx
index dae69d24398f4ac6989a367483c2d4faa375eb28..78fb8720200f84d756c8555f313f7cd458b2e3ff 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef FGMANIPULATOR_H
 #define FGMANIPULATOR_H 1
 
+#include <map>
 #include <osg/Quat>
 #include <osgGA/MatrixManipulator>
 
@@ -8,10 +9,8 @@
 
 class FGManipulator : public osgGA::MatrixManipulator {
 public:
-    FGManipulator() :
-       idleHandler(0), drawHandler(0), windowResizeHandler(0), keyHandler(0),
-       mouseClickHandler(0), mouseMotionHandler(0), currentModifiers(0)
-       {}
+    FGManipulator();
+    
     virtual ~FGManipulator() {}
     
     virtual const char* className() const {return "FGManipulator"; }
@@ -107,6 +106,12 @@ public:
     void setPosition(const osg::Vec3d position) { this->position = position; }
     void setAttitude(const osg::Quat attitude) { this->attitude = attitude; }
 
+    /** Whether or not resizing is supported. It might not be when
+     * using multiple displays.
+     */
+    bool getResizable() { return resizable; }
+    void setResizable(bool _resizable) { resizable = _resizable; }
+
 protected:
     osg::ref_ptr<osg::Node> _node;
     fgIdleHandler idleHandler;
@@ -116,9 +121,14 @@ protected:
     fgMouseClickHandler mouseClickHandler;
     fgMouseMotionHandler mouseMotionHandler;
     int currentModifiers;
+    // work-around for OSG bug
+    int osgModifiers;
+    typedef std::map<int, osgGA::GUIEventAdapter::ModKeyMask> KeyMaskMap;
+    KeyMaskMap keyMaskMap;
+    std::map<int, int> numlockKeyMap;
     osg::Vec3d position;
     osg::Quat attitude;
     void handleKey(const osgGA::GUIEventAdapter& ea, int& key, int& modifiers);
-
+    bool resizable;
 };
 #endif