FlightGear next
QQuickDrawable.hxx
Go to the documentation of this file.
1// QQuickDrawable.hxx - OSG Drawable using a QQuickRenderControl to draw
2//
3// Copyright (C) 2019 James Turner <james@flightgear.org>
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
27namespace osgViewer {
28class Viewer;
29}
30
31class QUrl;
33
34class QQuickDrawable : public osg::Drawable
35{
36public:
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
54private:
55 std::unique_ptr<QQuickDrawablePrivate> d;
56};
57
58#endif
void setSource(const QUrl &url)
virtual ~QQuickDrawable()
virtual osg::Object * clone(const osg::CopyOp &copyop) const
void reload(const QUrl &url)
void drawImplementation(osg::RenderInfo &renderInfo) const override
void setSourcePath(const std::string &path)
void resize(int width, int height)
virtual osg::Object * cloneType() const
void setup(osgViewer::GraphicsWindow *gw, osgViewer::Viewer *viewer)