]> git.mxchange.org Git - flightgear.git/blobdiff - src/Model/panelnode.hxx
Prepare and implement reinit methods for instruments
[flightgear.git] / src / Model / panelnode.hxx
index 2551495f864c654a6f04234c59afe8e405ccbd3c..772ef9e328194c447a7a0b68f9ba196c2d9c4a25 100644 (file)
@@ -5,6 +5,9 @@
 #include <osg/Matrix>
 #include <osg/Drawable>
 
+#include <simgear/structure/SGSharedPtr.hxx>
+#include <simgear/props/props.hxx>
+
 class FGPanel;
 class SGPropertyNode;
 
@@ -13,7 +16,7 @@ class SGPropertyNode;
 class FGPanelNode : public osg::Drawable
 {
 public:
-    FGPanelNode(FGPanel* panel);
+    FGPanelNode();
   
     FGPanelNode(SGPropertyNode* props);
     virtual ~FGPanelNode();
@@ -36,17 +39,27 @@ public:
     virtual void accept(osg::PrimitiveFunctor& functor) const;
   
     static osg::Node* load(SGPropertyNode *n);
-    static osg::Node* createNode(FGPanel* panel);
+    static osg::Node* create2DPanelNode();
   
     osg::Matrix transformMatrix() const;
   
+    void setPanelPath(const std::string& panel);
+    void lazyLoad();
+  
+    /**
+      * is visible in 2D mode or not?
+      */
+    bool isVisible2d() const;
 private:
+    void commonInit();
     void initWithPanel();
     
-    FGPanel* _panel;
+    SGSharedPtr<FGPanel> _panel;
+    std::string _panelPath;
   
     bool _resizeToViewport;
-
+    bool _depthTest;
+  
     // Panel corner coordinates
     osg::Vec3 _bottomLeft, _topLeft, _bottomRight;
 
@@ -55,6 +68,12 @@ private:
     // The matrix that results, which transforms 2D x/y panel
     // coordinates into 3D coordinates of the panel quadrilateral.
     osg::Matrix _xform;  
+  
+    /// should the 2D panel auto-hide when the view orientation changes
+    mutable SGPropertyNode_ptr _autoHide2d;
+    
+    /// should the 2D panel be hidden in views other than the default (view 0)
+    mutable SGPropertyNode_ptr _hideNonDefaultViews;
 };