]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/FGManipulator.hxx
header cleanups
[flightgear.git] / src / Main / FGManipulator.hxx
index dae69d24398f4ac6989a367483c2d4faa375eb28..95329c19cb467df7c332a27ba0a8de69e8d64abe 100644 (file)
@@ -1,17 +1,17 @@
 #ifndef FGMANIPULATOR_H
 #define FGMANIPULATOR_H 1
 
+#include <map>
 #include <osg/Quat>
 #include <osgGA/MatrixManipulator>
+#include <osgViewer/ViewerEventHandlers>
 
 #include "fg_os.hxx"
 
 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"; }
@@ -104,9 +104,21 @@ public:
        {
            return currentModifiers;
        }
+
+    void setMouseWarped()
+       {
+           mouseWarped = true;
+       }
+
     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;
@@ -115,10 +127,19 @@ protected:
     fgKeyHandler keyHandler;
     fgMouseClickHandler mouseClickHandler;
     fgMouseMotionHandler mouseMotionHandler;
+    osg::ref_ptr<osgViewer::StatsHandler> statsHandler;
+    osg::ref_ptr<osgGA::GUIEventAdapter> statsEvent;
+    int statsType;
     int currentModifiers;
+    std::map<int, int> numlockKeyMap;
     osg::Vec3d position;
     osg::Quat attitude;
     void handleKey(const osgGA::GUIEventAdapter& ea, int& key, int& modifiers);
-
+    bool resizable;
+    bool mouseWarped;
+    // workaround for osgViewer double scroll events
+    bool scrollButtonPressed;
+    int release_keys[128];
+    void handleStats(osgGA::GUIActionAdapter& us);
 };
 #endif