1 #ifndef FG_PANELNODE_HXX
2 #define FG_PANELNODE_HXX
6 #include <osg/Drawable>
7 #include <simgear/structure/SGSharedPtr.hxx>
12 // PanelNode defines an OSG drawable wrapping the 2D panel drawing code
14 class FGPanelNode : public osg::Drawable
17 FGPanelNode(FGPanel* panel);
19 FGPanelNode(SGPropertyNode* props);
20 virtual ~FGPanelNode();
23 virtual osg::Object* cloneType() const { return 0; }
24 virtual osg::Object* clone(const osg::CopyOp& copyop) const { return 0; }
26 FGPanel* getPanel() { return _panel; }
28 virtual void drawImplementation(osg::RenderInfo& renderInfo) const
29 { drawImplementation(*renderInfo.getState()); }
31 void drawImplementation(osg::State& state) const;
32 virtual osg::BoundingBox computeBound() const;
34 /** Return true, FGPanelNode does support accept(PrimitiveFunctor&). */
35 virtual bool supports(const osg::PrimitiveFunctor&) const { return true; }
37 virtual void accept(osg::PrimitiveFunctor& functor) const;
39 static osg::Node* load(SGPropertyNode *n);
40 static osg::Node* createNode(FGPanel* panel);
42 osg::Matrix transformMatrix() const;
47 SGSharedPtr<FGPanel> _panel;
49 bool _resizeToViewport;
51 // Panel corner coordinates
52 osg::Vec3 _bottomLeft, _topLeft, _bottomRight;
54 int _xmin, _ymin, _xmax, _ymax;
56 // The matrix that results, which transforms 2D x/y panel
57 // coordinates into 3D coordinates of the panel quadrilateral.
62 #endif // FG_PANELNODE_HXX