Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
SceneInterface.h
Go to the documentation of this file.
1#pragma once
2#include <QObject>
5#include <misc/gen/Value.h>
7#include <scn/iface/global.h>
8
9// Forward declaration to prevent a circular dependency issue.
10namespace sf
11{
12class OpenGLWidget;
13class OpenGLRenderer;
14}// namespace sf
15
16namespace sf::xgl
17{
18
23 : public QObject
24 , public Persistent
25{
26 Q_OBJECT
27
28 public:
33 {
34 explicit Parameters(QObject* parent = nullptr)
35 : parent(parent)
36 {}
37
38 QObject* parent;
39 };
40
44 explicit SceneInterface(const Parameters&);
45
49 ~SceneInterface() override;
50
56
61 virtual OpenGLRenderer* create(OpenGLWidget* widget) = 0;
62
66 virtual void destroy() = 0;
67
71 virtual OpenGLRenderer* renderer() = 0;
72
73 // Declarations of static functions and data members to be able to create registered implementations.
75};
76
77}// namespace sf::xgl
#define SF_DECL_IFACE(InterfaceType, ParamType, FuncName)
Declares a public static function in the class where it is used. Where: InterfaceType: Global typenam...
Definition TClassRegistration.h:71
Pure virtual class to implement rendering separated from the widget and makes the sf::OpenGLWidget th...
Definition OpenGLRenderer.h:12
Widget for rendering a OpenGHL scene.
Definition OpenGLWidget.h:30
Class to multiple inherit which adds functions to read and write properties from a given object....
Definition Persistent.h:14
Dialog containing multiple property pages.
Definition qt/PropertySheetDialog.h:14
Base class for the interface.
Definition SceneInterface.h:25
virtual void addPropertyPages(PropertySheetDialog *sheet)
virtual OpenGLRenderer * renderer()=0
Gets the renderer of this scene.
virtual OpenGLRenderer * create(OpenGLWidget *widget)=0
Creates the scene for the passed OpenGL widget.
~SceneInterface() override
Virtual destructor for derived classes.
virtual void destroy()=0
Destroys the scene of for created for the widget.
SceneInterface(const Parameters &)
Constructor for passing general structure for derived classes.
Definition DemoRenderer.h:6
Definition Application.h:10
#define _SCN_CLASS
Definition scn/iface/global.h:35
Structure passed as a constructor argument.
Definition SceneInterface.h:33
Parameters(QObject *parent=nullptr)
Definition SceneInterface.h:34
QObject * parent
Definition SceneInterface.h:38