1 #ifndef FG_PANELNODE_HXX
2 #define FG_PANELNODE_HXX
6 #include <osg/Drawable>
11 // PanelNode defines an OSG drawable wrapping the 2D panel drawing code
13 class FGPanelNode : public osg::Drawable
16 FGPanelNode(FGPanel* panel);
18 FGPanelNode(SGPropertyNode* props);
19 virtual ~FGPanelNode();
22 virtual osg::Object* cloneType() const { return 0; }
23 virtual osg::Object* clone(const osg::CopyOp& copyop) const { return 0; }
25 FGPanel* getPanel() { return _panel; }
27 virtual void drawImplementation(osg::RenderInfo& renderInfo) const
28 { drawImplementation(*renderInfo.getState()); }
30 void drawImplementation(osg::State& state) const;
31 virtual osg::BoundingBox computeBound() const;
33 /** Return true, FGPanelNode does support accept(PrimitiveFunctor&). */
34 virtual bool supports(const osg::PrimitiveFunctor&) const { return true; }
36 virtual void accept(osg::PrimitiveFunctor& functor) const;
38 static osg::Node* load(SGPropertyNode *n);
39 static osg::Node* createNode(FGPanel* panel);
41 osg::Matrix transformMatrix() const;
48 bool _resizeToViewport;
50 // Panel corner coordinates
51 osg::Vec3 _bottomLeft, _topLeft, _bottomRight;
53 // The input range expected in the panel definition. These x/y
54 // coordinates will map to the right/top sides.
57 // The matrix that results, which transforms 2D x/y panel
58 // coordinates into 3D coordinates of the panel quadrilateral.
63 #endif // FG_PANELNODE_HXX