]> git.mxchange.org Git - flightgear.git/blob - src/Model/panelnode.hxx
Olaf Flebbe: remove unused variable.
[flightgear.git] / src / Model / panelnode.hxx
1 #ifndef FG_PANELNODE_HXX
2 #define FG_PANELNODE_HXX
3
4 #include <osg/Vec3>
5 #include <osg/Matrix>
6 #include <osg/Drawable>
7
8 class FGPanel;
9 class SGPropertyNode;
10
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.
15
16 // Static mouse handler for all FGPanelNodes.  Very clumsy; this
17 // should really be done through our container (an aircraft model,
18 // typically).
19 bool fgHandle3DPanelMouseEvent(int button, int updown, int x, int y);
20 void fgUpdate3DPanels();
21
22 class FGPanelNode : public osg::Drawable // OSGFIXME 
23 {
24 public:
25     FGPanelNode(SGPropertyNode* props);
26     virtual ~FGPanelNode();
27
28     // OSGFIXME
29     virtual osg::Object* cloneType() const { return 0; }
30     virtual osg::Object* clone(const osg::CopyOp& copyop) const { return 0; }        
31
32     bool doMouseAction(int button, int updown, int x, int y);
33
34     FGPanel* getPanel() { return _panel; }
35
36     virtual void drawImplementation(osg::State& state) const;
37     virtual osg::BoundingBox computeBound() const;
38
39 private:
40     FGPanel* _panel;
41
42     // Panel corner coordinates
43     osg::Vec3 _bottomLeft, _topLeft, _bottomRight;
44
45     // The input range expected in the panel definition.  These x/y
46     // coordinates will map to the right/top sides.
47     float _xmax, _ymax;
48     
49     // The matrix that results, which transforms 2D x/y panel
50     // coordinates into 3D coordinates of the panel quadrilateral.
51     osg::Matrix _xform;
52
53     // The matrix transformation state that was active the last time
54     // we were rendered.  Used by the mouse code to compute
55     // intersections.
56     osg::Matrix _lastModelview;
57     osg::Matrix _lastProjection;
58     int   _lastViewport[4];
59 };
60
61
62 #endif // FG_PANELNODE_HXX