]> git.mxchange.org Git - flightgear.git/blob - src/Model/panelnode.hxx
Check point commit:
[flightgear.git] / src / Model / panelnode.hxx
1 #include <plib/ssg.h>
2
3 class FGPanel;
4 class SGPropertyNode;
5
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.
10
11 class FGPanelNode : public ssgLeaf 
12 {
13 protected:
14     virtual void draw_geometry();
15
16 public:
17     FGPanelNode(SGPropertyNode* props);
18     virtual ~FGPanelNode();
19
20     virtual void draw();
21     void mouseEvent(int button, int updown, int x, int y);
22
23     virtual void recalcBSphere() { bsphere_is_invalid = 0; }
24
25     //
26     // A bunch of Plib functions that aren't implemented.  I don't
27     // even know what many of them do, but they're pure virtual and
28     // require implementation.
29     //
30     virtual int getNumTriangles() { die(); return 0; }
31     virtual void getTriangle(int n, short* v1, short* v2, short* v3) { die(); }
32     virtual int getNumLines() { die(); return 0; }
33     virtual void getLine(int n, short* v1, short* v2) { die(); }
34     
35     virtual void drawHighlight(sgVec4 colour) { die(); }
36     virtual void drawHighlight(sgVec4 colour, int i) { die(); }
37     virtual float* getVertex(int i) { die(); return 0; }
38     virtual float* getNormal(int i) { die(); return 0; }
39     virtual float* getColour(int i) { die(); return 0; }
40     virtual float* getTexCoord(int i) { die(); return 0; }
41     virtual void pick(int baseName) { die(); }
42     virtual void isect_triangles(sgSphere* s, sgMat4 m, int testNeeded) { die(); }
43     virtual void hot_triangles(sgVec3 s, sgMat4 m, int testNeeded) { die(); }
44     virtual void los_triangles(sgVec3 s, sgMat4 m, int testNeeded) { die(); }
45     virtual void transform(const sgMat4 m) { die(); }
46
47 private:
48     // Handler for all the unimplemented methods above
49     void die();
50
51     FGPanel* _panel;
52
53     // Panel corner coordinates
54     float _bottomLeft[3], _topLeft[3], _bottomRight[3];
55
56     // The input range expected in the panel definition.  These x/y
57     // coordinates will map to the right/top sides.
58     float _xmax, _ymax;
59     
60     // The matrix that results, which transforms 2D x/y panel
61     // coordinates into 3D coordinates of the panel quadrilateral.
62     GLfloat _xform[16];
63
64     // The matrix transformation state that was active the last time
65     // we were rendered.  Used by the mouse code to compute
66     // intersections.
67     GLfloat _lastModelview[16];
68     GLfloat _lastProjection[16];
69     GLint   _lastViewport[4];
70 };