1 #ifndef FG_PANELNODE_HXX
2 #define FG_PANELNODE_HXX
6 #include <osg/Drawable>
11 // PanelNode defines an SSG leaf object that draws a FGPanel object
12 // into the scene graph. Note that this is an incomplete SSG object,
13 // many methods, mostly involved with modelling and runtime
14 // inspection, are unimplemented.
16 // Static mouse handler for all FGPanelNodes. Very clumsy; this
17 // should really be done through our container (an aircraft model,
19 bool fgHandle3DPanelMouseEvent(int button, int updown, int x, int y);
20 void fgUpdate3DPanels();
22 class FGPanelNode : public osg::Drawable // OSGFIXME
25 FGPanelNode(SGPropertyNode* props);
26 virtual ~FGPanelNode();
29 virtual osg::Object* cloneType() const { return 0; }
30 virtual osg::Object* clone(const osg::CopyOp& copyop) const { return 0; }
32 bool doMouseAction(int button, int updown, int x, int y);
34 FGPanel* getPanel() { return _panel; }
36 virtual void drawImplementation(osg::RenderInfo& renderInfo) const
37 { drawImplementation(*renderInfo.getState()); }
38 void drawImplementation(osg::State& state) const;
39 virtual osg::BoundingBox computeBound() const;
44 // Panel corner coordinates
45 osg::Vec3 _bottomLeft, _topLeft, _bottomRight;
47 // The input range expected in the panel definition. These x/y
48 // coordinates will map to the right/top sides.
51 // The matrix that results, which transforms 2D x/y panel
52 // coordinates into 3D coordinates of the panel quadrilateral.
55 // The matrix transformation state that was active the last time
56 // we were rendered. Used by the mouse code to compute
58 mutable osg::Matrix _lastModelview;
59 mutable osg::Matrix _lastProjection;
60 mutable double _lastViewport[4];
64 #endif // FG_PANELNODE_HXX