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