X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2Fpanelnode.hxx;h=9a5bf938a61bc2c41435592d18e431f74ce19025;hb=b3d59ed5636cc416f83db0fd5f2698759af944fb;hp=0a6de5c17a9f6fd2a35b12866518405362b378ae;hpb=677ec873be7690da4e3bd882a300653c0ef52c97;p=flightgear.git diff --git a/src/Model/panelnode.hxx b/src/Model/panelnode.hxx index 0a6de5c17..9a5bf938a 100644 --- a/src/Model/panelnode.hxx +++ b/src/Model/panelnode.hxx @@ -1,8 +1,9 @@ #ifndef FG_PANELNODE_HXX #define FG_PANELNODE_HXX - -#include +#include +#include +#include class FGPanel; class SGPropertyNode; @@ -18,52 +19,30 @@ class SGPropertyNode; bool fgHandle3DPanelMouseEvent(int button, int updown, int x, int y); void fgUpdate3DPanels(); -class FGPanelNode : public ssgLeaf +class FGPanelNode : public osg::Drawable // OSGFIXME { -protected: - virtual void draw_geometry(); - public: FGPanelNode(SGPropertyNode* props); virtual ~FGPanelNode(); - virtual void draw(); + // OSGFIXME + virtual osg::Object* cloneType() const { return 0; } + virtual osg::Object* clone(const osg::CopyOp& copyop) const { return 0; } + bool doMouseAction(int button, int updown, int x, int y); FGPanel* getPanel() { return _panel; } - virtual void recalcBSphere() { bsphere_is_invalid = 0; } - - // - // A bunch of Plib functions that aren't implemented. I don't - // even know what many of them do, but they're pure virtual and - // require implementation. - // - virtual int getNumTriangles() { die(); return 0; } - virtual void getTriangle(int n, short* v1, short* v2, short* v3) { die(); } - virtual int getNumLines() { die(); return 0; } - virtual void getLine(int n, short* v1, short* v2) { die(); } - - virtual void drawHighlight(sgVec4 colour) { die(); } - virtual void drawHighlight(sgVec4 colour, int i) { die(); } - virtual float* getVertex(int i) { die(); return 0; } - virtual float* getNormal(int i) { die(); return 0; } - virtual float* getColour(int i) { die(); return 0; } - virtual float* getTexCoord(int i) { die(); return 0; } - virtual void pick(int baseName) { die(); } - virtual void isect_triangles(sgSphere* s, sgMat4 m, int testNeeded) { die(); } - virtual void hot_triangles(sgVec3 s, sgMat4 m, int testNeeded) { die(); } - virtual void los_triangles(sgVec3 s, sgMat4 m, int testNeeded) { die(); } - virtual void transform(const sgMat4 m) { die(); } + virtual void drawImplementation(osg::RenderInfo& renderInfo) const + { drawImplementation(*renderInfo.getState()); } + void drawImplementation(osg::State& state) const; + virtual osg::BoundingBox computeBound() const; private: - // Handler for all the unimplemented methods above - void die(); - FGPanel* _panel; // Panel corner coordinates - float _bottomLeft[3], _topLeft[3], _bottomRight[3]; + osg::Vec3 _bottomLeft, _topLeft, _bottomRight; // The input range expected in the panel definition. These x/y // coordinates will map to the right/top sides. @@ -71,14 +50,14 @@ private: // The matrix that results, which transforms 2D x/y panel // coordinates into 3D coordinates of the panel quadrilateral. - GLfloat _xform[16]; + osg::Matrix _xform; // The matrix transformation state that was active the last time // we were rendered. Used by the mouse code to compute // intersections. - GLfloat _lastModelview[16]; - GLfloat _lastProjection[16]; - GLint _lastViewport[4]; + mutable osg::Matrix _lastModelview; + mutable osg::Matrix _lastProjection; + mutable double _lastViewport[4]; };