Debian Codegraph @

src/Model/panelnode.hxx

raw symbols SCIP
1 #ifndef FG_PANELNODE_HXX
2 #define FG_PANELNODE_HXX
3
4 #include <osg/Vec3>
5 #include <osg/Matrix>
6 #include <osg/Drawable>
7 #include <osg/Version>
8
9 #include <memory>
10 #include <simgear/structure/SGSharedPtr.hxx>
11 #include <simgear/props/props.hxx>
12
13 class FGPanel;
14 class SGPropertyNode;
15
16 // PanelNode defines an OSG drawable wrapping the 2D panel drawing code
17
18 class FGPanelNode : public osg::Drawable
19 {
20 public:
21 FGPanelNode(SGPropertyNode* props);
22 virtual ~FGPanelNode();
23
24 // OSGFIXME
25 virtual osg::Object* cloneType() const { return 0; }
26 virtual osg::Object* clone(const osg::CopyOp& copyop) const { return 0; }
27
28 FGPanel* getPanel() { return _panel; }
29
30 virtual void drawImplementation(osg::RenderInfo& renderInfo) const
31 { drawImplementation(*renderInfo.getState()); }
32
33 void drawImplementation(osg::State& state) const;
34
35 osg::BoundingBox computeBoundingBox() const override;
36
37
38 /** Return true, FGPanelNode does support accept(PrimitiveFunctor&). */
39 virtual bool supports(const osg::PrimitiveFunctor&) const { return true; }
40
41 virtual void accept(osg::PrimitiveFunctor& functor) const;
42
43 static osg::Node* load(SGPropertyNode *n);
44 static osg::Node* create2DPanelNode();
45
46 osg::Matrix transformMatrix() const;
47
48 void setPanelPath(const std::string& panel);
49 void lazyLoad();
50
51 /**
52 * is visible in 2D mode or not?
53 */
54 bool isVisible2d() const;
55 private:
56 FGPanelNode(); // for 2D panels
57
58 void commonInit();
59 void initWithPanel();
60
61 bool panelMouseClickCommand(const SGPropertyNode * arg, SGPropertyNode * root);
62
63 const bool _is2d;
64 SGSharedPtr<FGPanel> _panel;
65 std::string _panelPath;
66
67 bool _resizeToViewport;
68 bool _depthTest;
69
70 // Panel corner coordinates
71 osg::Vec3 _bottomLeft, _topLeft, _bottomRight;
72
73 int _xmin, _ymin, _xmax, _ymax;
74
75 // The matrix that results, which transforms 2D x/y panel
76 // coordinates into 3D coordinates of the panel quadrilateral.
77 osg::Matrix _xform;
78
79 SGPropertyChangeListener* _listener;
80 std::unique_ptr<SGPropertyChangeListener> _pathListener;
81
82 /// should the 2D panel auto-hide when the view orientation changes
83 mutable SGPropertyNode_ptr _autoHide2d;
84
85 /// should the 2D panel be hidden in views other than the default (view 0)
86 mutable SGPropertyNode_ptr _hideNonDefaultViews;
87 };
88
89
90 #endif // FG_PANELNODE_HXX