Debian Codegraph @

src/GUI/QQuickDrawable.hxx

raw symbols SCIP
1 // QQuickDrawable.hxx - OSG Drawable using a QQuickRenderControl to draw
2 //
3 // Copyright (C) 2019 James Turner <[email protected]>
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 2 of the
8 // License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
19 #ifndef FG_VIEWER_QUICK_DRAWABLE_HXX
20 #define FG_VIEWER_QUICK_DRAWABLE_HXX
21
22 #include <memory>
23 #include <osg/Drawable>
24
25 #include <osgViewer/GraphicsWindow>
26
27 namespace osgViewer {
28 class Viewer;
29 }
30
31 class QUrl;
32 class QQuickDrawablePrivate;
33
34 class QQuickDrawable : public osg::Drawable
35 {
36 public:
37 QQuickDrawable();
38 virtual ~QQuickDrawable();
39
40 virtual osg::Object* cloneType() const { return 0; }
41 virtual osg::Object* clone(const osg::CopyOp& copyop) const { return 0; }
42
43 void drawImplementation(osg::RenderInfo& renderInfo) const override;
44
45 void setup(osgViewer::GraphicsWindow* gw, osgViewer::Viewer* viewer);
46
47 void setSourcePath(const std::string& path);
48 void setSource(const QUrl& url);
49
50 void reload(const QUrl& url);
51
52 void resize(int width, int height);
53
54 private:
55 std::unique_ptr<QQuickDrawablePrivate> d;
56 };
57
58 #endif