#include <Cockpit/panel.hxx>
#include <Cockpit/panel_io.hxx>
#include "Viewer/viewer.hxx"
+#include "Viewer/viewmgr.hxx"
using std::vector;
return false;
}
- if (_panel->getAutohide()) {
+ if (!_hideNonDefaultViews) {
+ _hideNonDefaultViews = fgGetNode("/sim/panel/hide-nonzero-view", true);
+ }
+
+ if (_hideNonDefaultViews->getBoolValue()) {
+ if (globals->get_viewmgr()->get_current() != 0) {
+ return false;
+ }
+ }
+
+ if (!_autoHide2d) {
+ _autoHide2d = fgGetNode("/sim/panel/hide-nonzero-heading-offset", true);
+ }
+
+ if (_panel->getAutohide() && _autoHide2d->getBoolValue()) {
if (!globals->get_current_view()) {
return false;
}
#include <osg/Vec3>
#include <osg/Matrix>
#include <osg/Drawable>
+
#include <simgear/structure/SGSharedPtr.hxx>
+#include <simgear/props/props.hxx>
class FGPanel;
class SGPropertyNode;
// 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;
};