#include <osg/Matrix>
#include <osg/Drawable>
+#include <simgear/structure/SGSharedPtr.hxx>
+#include <simgear/props/props.hxx>
+
class FGPanel;
class SGPropertyNode;
class FGPanelNode : public osg::Drawable
{
public:
- FGPanelNode(FGPanel* panel);
+ FGPanelNode();
FGPanelNode(SGPropertyNode* props);
virtual ~FGPanelNode();
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;
// 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;
};