VR-Engage  2.2
Loading...
Searching...
No Matches
vrePerWindowQtQuickData.h
Go to the documentation of this file.
1/*********************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*********************************************************************************/
5
6#pragma once
7
8//! \file vrePerWindowQtQuickData.h
9//! \ingroup vreQtQuickRenderer
10//! \brief Class that stores data used for rendering QML into OSG
11//!
12//! This class maintains per-window data for QML rendering, including contexts,
13//! components, and window names. It serves as a container for all the QML-specific
14//! data that needs to be associated with each rendering window in OSG.
15
16
18
19#include <QtQml/QQmlComponent>
20
21#include <string>
22
23class QOpenGLContext;
24
25namespace makVrv
26{
27class DtGlRenderTexture;
28}
29
30namespace makVre
31{
32class DtQQuickWindow;
34
35//! \brief Container for per-window Qt Quick rendering data
36//!
37//! This class stores all the necessary data for rendering Qt Quick content
38//! in a specific window, including render controls, window objects, OpenGL contexts,
39//! and QML components.
41{
42 Q_OBJECT
43public:
44 //! \brief Default constructor
46
47 //! \brief Destructor
48 virtual ~DtPerWindowQtQuickData() override;
49
50 //! \brief Gets the render control for this window
51 //! \return Pointer to the Qt Quick render control
53
54 //! \brief Sets the render control for this window
55 //! \param renderControl Pointer to the Qt Quick render control
57
58 //! \brief Gets the Quick window for this context
59 //! \return Pointer to the Qt Quick window
61
62 //! \brief Sets the Quick window for this context
63 //! \param window Pointer to the Qt Quick window
65
66 //! \brief Gets the OpenGL context for this window
67 //! \return Pointer to the OpenGL context
68 QOpenGLContext* getOpenglContext();
69
70 //! \brief Sets the OpenGL context for this window
71 //! \param context Pointer to the OpenGL context
72 void setOpenglContext(QOpenGLContext* context);
73
74 //! \brief Gets the QML component for this window
75 //! \return Pointer to the QML component
76 QQmlComponent* getComponent();
77
78 //! \brief Sets the QML component for this window
79 //! \param component Pointer to the QML component
80 void setComponent(QQmlComponent* component);
81
82 //! \brief Gets the render-to-texture target
83 //! \return Pointer to the OpenGL render texture
84 makVrv::DtGlRenderTexture* getRTTtexture();
85
86 //! \brief Sets the render-to-texture target
87 //! \param texture Pointer to the OpenGL render texture
88 void setRTTtexture(makVrv::DtGlRenderTexture* texture);
89
90 //! \brief Gets the name of the window
91 //! \return The window name
92 std::string getWindowName();
93
94 //! \brief Sets the name of the window
95 //! \param name The window name to set
96 void setWindowName(std::string name);
97
98
99 //! \brief Slot called when the QML component status changes
100 //! \param status The new status of the component
101 void componentStatusChanged(QQmlComponent::Status status);
102
103protected:
104 //! \brief Qt Quick render control for this window
106 //! \brief Qt Quick window for this context
108 //! \brief OpenGL context for this window
109 QOpenGLContext* myOpenglContext;
110 //! \brief QML component for this window
111 QQmlComponent* myComponent;
112 //! \brief Render-to-texture target
113 makVrv::DtGlRenderTexture* myRTTtexture;
114 //! \brief Name of the window
115 std::string myWindowName;
116};
117
118} // namespace makVre
void setRenderControl(DtQtQRenderControl *renderControl)
Sets the render control for this window.
std::string getWindowName()
Gets the name of the window.
DtQQuickWindow * getQuickWindow()
Gets the Quick window for this context.
makVrv::DtGlRenderTexture * myRTTtexture
Render-to-texture target.
Definition vrePerWindowQtQuickData.h:113
virtual ~DtPerWindowQtQuickData() override
Destructor.
QOpenGLContext * getOpenglContext()
Gets the OpenGL context for this window.
DtPerWindowQtQuickData()
Default constructor.
DtQtQRenderControl * myRenderControl
Qt Quick render control for this window.
Definition vrePerWindowQtQuickData.h:105
void setRTTtexture(makVrv::DtGlRenderTexture *texture)
Sets the render-to-texture target.
DtQQuickWindow * myQuickWindow
Qt Quick window for this context.
Definition vrePerWindowQtQuickData.h:107
DtQtQRenderControl * getRenderControl()
Gets the render control for this window.
QOpenGLContext * myOpenglContext
OpenGL context for this window.
Definition vrePerWindowQtQuickData.h:109
void setOpenglContext(QOpenGLContext *context)
Sets the OpenGL context for this window.
void componentStatusChanged(QQmlComponent::Status status)
Slot called when the QML component status changes.
void setQuickWindow(DtQQuickWindow *window)
Sets the Quick window for this context.
void setComponent(QQmlComponent *component)
Sets the QML component for this window.
void setWindowName(std::string name)
Sets the name of the window.
QQmlComponent * getComponent()
Gets the QML component for this window.
std::string myWindowName
Name of the window.
Definition vrePerWindowQtQuickData.h:115
QQmlComponent * myComponent
QML component for this window.
Definition vrePerWindowQtQuickData.h:111
makVrv::DtGlRenderTexture * getRTTtexture()
Gets the render-to-texture target.
Extended QQuickWindow for VREngage integration.
Definition vreQQuickWindow.h:29
Extended rendering control for Qt Quick in VREngage.
Definition vreQtQRenderControl.h:28
Defines export macros for the VREngage Qt Quick Renderer library.
#define QTQUICKRENDERER_DLL
Export/import macro for non-Windows platforms.
Definition export.h:40
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
Definition appLauncherComponent.h:28