1 #ifndef FG_PANELNODE_HXX
2 #define FG_PANELNODE_HXX
10 // PanelNode defines an SSG leaf object that draws a FGPanel object
11 // into the scene graph. Note that this is an incomplete SSG object,
12 // many methods, mostly involved with modelling and runtime
13 // inspection, are unimplemented.
15 // Static mouse handler for all FGPanelNodes. Very clumsy; this
16 // should really be done through our container (an aircraft model,
18 bool fgHandle3DPanelMouseEvent(int button, int updown, int x, int y);
19 void fgUpdate3DPanels();
21 class FGPanelNode : public ssgLeaf
24 virtual void draw_geometry();
27 FGPanelNode(SGPropertyNode* props);
28 virtual ~FGPanelNode();
31 bool doMouseAction(int button, int updown, int x, int y);
33 FGPanel* getPanel() { return _panel; }
35 virtual void recalcBSphere() { bsphere_is_invalid = 0; }
38 // A bunch of Plib functions that aren't implemented. I don't
39 // even know what many of them do, but they're pure virtual and
40 // require implementation.
42 virtual int getNumTriangles() { die(); return 0; }
43 virtual void getTriangle(int n, short* v1, short* v2, short* v3) { die(); }
44 virtual int getNumLines() { die(); return 0; }
45 virtual void getLine(int n, short* v1, short* v2) { die(); }
47 virtual void drawHighlight(sgVec4 colour) { die(); }
48 virtual void drawHighlight(sgVec4 colour, int i) { die(); }
49 virtual float* getVertex(int i) { die(); return 0; }
50 virtual float* getNormal(int i) { die(); return 0; }
51 virtual float* getColour(int i) { die(); return 0; }
52 virtual float* getTexCoord(int i) { die(); return 0; }
53 virtual void pick(int baseName) { die(); }
54 virtual void isect_triangles(sgSphere* s, sgMat4 m, int testNeeded) { die(); }
55 virtual void hot_triangles(sgVec3 s, sgMat4 m, int testNeeded) { die(); }
56 virtual void los_triangles(sgVec3 s, sgMat4 m, int testNeeded) { die(); }
57 virtual void transform(const sgMat4 m) { die(); }
60 // Handler for all the unimplemented methods above
65 // Panel corner coordinates
66 float _bottomLeft[3], _topLeft[3], _bottomRight[3];
68 // The input range expected in the panel definition. These x/y
69 // coordinates will map to the right/top sides.
72 // The matrix that results, which transforms 2D x/y panel
73 // coordinates into 3D coordinates of the panel quadrilateral.
76 // The matrix transformation state that was active the last time
77 // we were rendered. Used by the mouse code to compute
79 GLfloat _lastModelview[16];
80 GLfloat _lastProjection[16];
81 GLint _lastViewport[4];
85 #endif // FG_PANELNODE_HXX