+ // Background texture.
+ virtual void setBackground (osg::Texture2D* texture);
+
+ // Background multiple textures.
+ virtual void setMultiBackground (osg::Texture2D* texture, int idx);
+
+ virtual void setWidth (int width) { _width = width; }
+ virtual int getWidth () const { return _width; }
+
+ // Full height of panel.
+ virtual void setHeight (int height) { _height = height; }
+ virtual int getHeight () const { return _height; }
+
+ // X-offset
+ virtual void setXOffset (int offset);
+ virtual int getXOffset () const { return _x_offset->getIntValue(); }
+
+ // Y-offset.
+ virtual void setYOffset (int offset);
+ virtual int getYOffset () const { return _y_offset->getIntValue(); }
+
+ // View height.
+ // virtual void setViewHeight (int height) { _view_height = height; }
+ // virtual int getViewHeight () const { return _view_height; }
+
+ /**
+ * find the actual logical extend of the panel, including all instruments
+ * and actions.
+ */
+ void getLogicalExtent(int &x0, int& y0, int& x1, int &y1);
+
+ // Handle a mouse click.
+ virtual bool doMouseAction (int button, int updown, int x, int y);
+ virtual bool doLocalMouseAction(int button, int updown, int x, int y);
+
+ virtual void setDepthTest (bool enable);
+
+ bool getAutohide(void) const { return _autohide; };
+ void setAutohide(bool enable) { _autohide = enable; };
+
+ double getAspectScale() const;
+
+private:
+ void setupVirtualCockpit();
+ void cleanupVirtualCockpit();
+
+ mutable bool _mouseDown;
+ mutable int _mouseButton, _mouseX, _mouseY;
+ double _mouseActionRepeat;
+
+ mutable FGPanelInstrument * _mouseInstrument;
+ typedef std::vector<FGPanelInstrument *> instrument_list_type;
+ int _width;
+ int _height;
+ // int _view_height;
+
+ SGPropertyNode_ptr _x_offset;
+ SGPropertyNode_ptr _y_offset;
+ SGPropertyNode_ptr _jitter;
+ SGPropertyNode_ptr _flipx;
+
+ SGConstPropertyNode_ptr _xsize_node;
+ SGConstPropertyNode_ptr _ysize_node;
+
+ osg::ref_ptr<osg::StateSet> _bg;
+ osg::ref_ptr<osg::StateSet> _mbg[8];
+ // List of instruments in panel.
+ instrument_list_type _instruments;
+ bool _enable_depth_test;
+ bool _autohide;
+
+ SGPropObjBool _drawPanelHotspots;