|
VR-Engage
2.2
|
This singleton class manages the loading, rendering, and interaction with QML-based user interfaces. It integrates Qt Quick with OSG rendering to provide seamless UI capabilities within 3D environments.
#include <DtQtQuickRenderer.h>
Public Types | |
| using | RenderControlMap = std::map<osg::GraphicsContext*, DtPerWindowQtQuickData*> |
Public Member Functions | |
| virtual void | shutdown () |
| virtual void | loadQMLFile (QObject *owner, const std::string &filepath, const std::function< void(QQuickItem *)> &file_loaded_func) |
| virtual void | loadQMLFile (QObject *owner, const std::string &windowName, const std::string &filepath, const std::function< void(QQuickItem *)> &file_loaded_func) |
| virtual void | loadQMLFileRTT (QObject *owner, const std::string &filepath, osg::Texture2D *target, const std::function< void(QQuickItem *)> &func) |
| virtual void | reloadQMLFile (QObject *owner) |
| virtual void | closeUIByRoot (QQuickItem *root) |
| virtual void | closeUIByOwner (QObject *owner) |
| virtual QQmlContext * | rootContext () |
| virtual osg::Geode * | geodeRtt () |
| virtual makVrv::DtDe & | de () |
| virtual void | setVirtualRealityRenderTarget (osg::Texture2D *texture) |
| virtual void | syncVirtualRealityRenderTarget (unsigned int ctxid) |
| virtual void | slot_vrRunningChanged (bool running) |
| virtual void | slot_vrOverlayChanged () |
| virtual void | addToDebugMap (const std::string &logCat) |
| virtual const int | numberOfUIsToLoad () const |
| virtual const QRect & | getWindowDimensions (const std::string &windowName) const |
Static Public Member Functions | |
| static DtQtQuickRenderer * | instance () |
| static void | install (makVrv::DtDe &de) |
| static QObject * | getChildObject (const QObject *parent, const QString &objectName) |
Protected Member Functions | |
| DtQtQuickRenderer (makVrv::DtDe &de) | |
| virtual | ~DtQtQuickRenderer () |
| virtual void | initQtQuickRenderingComponents (osg::RenderInfo &renderInfo) |
| virtual DtPerWindowQtQuickData * | getWindowData (osg::GraphicsContext *gc) |
| virtual void | installDefaultProperties () |
| virtual void | updateQuick (osg::RenderInfo &renderInfo) |
| virtual void | onWindowToBeDestroyed (makVrv::DtWindow *win) |
| virtual void | setDebugConfig () |
| virtual void | debugManagerCallback () |
| virtual void | reloadQMLFile (DtQtQuickFileData *data) |
| virtual void | closeUI (DtQtQuickFileData *data) |
| virtual QQuickItem * | loadFileNow (osg::GraphicsContext *gc, DtQtQuickFileData *fileData) |
Protected Attributes | |
| makVrv::DtDe & | myDe |
| osg::ref_ptr< osg::Geode > | myGeode |
| osg::ref_ptr< osg::Drawable > | myDrawable |
| osg::ref_ptr< osg::Geode > | myGeodeRTT |
| osg::ref_ptr< osg::Drawable > | myDrawableRTT |
| QQmlEngine * | myQmlEngine |
| osg::GraphicsContext * | myDefaultContext |
| RenderControlMap | myRenderControlMap |
| std::vector< DtQtQuickFileData * > | myUIsToLoadList |
| std::vector< DtQtQuickFileData * > | myUIsLoadedList |
| makVrv::DtSignalConnectionManager | myConnections |
| osg::Texture2D * | myRenderTargetToSync |
| std::map< std::string, bool > | myQmlDebugMap |
Static Protected Attributes | |
| static DtQtQuickRenderer * | theQtQuickRenderer |
Friends | |
| class | DtQtQuickRendererDrawable |
| class | DtQQuickWindow |
| using makVre::DtQtQuickRenderer::RenderControlMap = std::map<osg::GraphicsContext*, DtPerWindowQtQuickData*> |
Type definition for mapping graphics contexts to Qt Quick data.
|
protected |
Constructor for Qt Quick renderer.
| de | Reference to the graphics engine |
References de().
Referenced by instance().
|
protectedvirtual |
Virtual destructor.
|
static |
Gets the singleton Qt Quick renderer instance.
References DtQtQuickRenderer().
|
static |
Installs the Qt Quick renderer system.
| de | Reference to the graphics engine |
References de().
|
virtual |
Cleans up and shuts down the Qt Quick renderer system.
Releases all resources and destroys loaded QML interfaces
|
virtual |
Loads a QML file and calls a function when loaded.
| owner | The object that owns this QML interface |
| filepath | Path to the QML file to load |
| file_loaded_func | Callback function called when the file is loaded |
|
virtual |
Loads a QML file to a specific window and calls a function when loaded.
| owner | The object that owns this QML interface |
| windowName | Name of the window to load the QML into |
| filepath | Path to the QML file to load |
| file_loaded_func | Callback function called when the file is loaded |
|
virtual |
Loads a QML file for render-to-texture and calls a function when loaded.
Loads a QML file and renders it to a texture target. The callback function will be called with the "fbo" property set to the OpenGL texture being rendered into.
| owner | The object that owns this QML interface |
| filepath | Path to the QML file to load |
| target | OpenGL texture to render the QML content into |
| func | Callback function called when the file is loaded |
|
virtual |
Reloads the QML file associated with the specified owner.
| owner | The object that owns the QML interface to reload |
|
virtual |
Closes the UI associated with the specified root item.
| root | The root QQuickItem of the UI to close |
|
virtual |
Closes the UI associated with the specified owner.
| owner | The object that owns the UI to close |
|
virtual |
Gets the root QML context.
This context is needed to allow C++ to send JavaScript and QML engine objects
|
virtual |
Gets the render-to-texture geode.
|
inlinevirtual |
Gets the graphics engine reference.
References myDe.
Referenced by DtQtQuickRenderer(), and install().
|
virtual |
Sets the virtual reality render target.
| texture | Pointer to the texture to use as the VR render target |
|
virtual |
Synchronizes the virtual reality render target with all file data.
Finds any file data using the virtual reality target and updates their render texture
| ctxid | The context ID to synchronize |
|
virtual |
Slot called when VR running state changes.
| running | True if VR is running, false otherwise |
|
virtual |
Slot called when VR overlay settings change.
|
virtual |
Adds a category to the debug map.
| logCat | The logging category to add |
|
virtual |
Gets the number of UIs that are in queue to load.
|
static |
Gets a reference to a child QObject in QML.
| parent | The parent QObject to search in |
| objectName | The name of the child object to find |
|
virtual |
Gets the dimensions of the specified window.
| windowName | Name of the window to get dimensions for |
|
protectedvirtual |
Initializes Qt Quick rendering components.
| renderInfo | Render information from OSG |
|
protectedvirtual |
Gets Qt Quick data for the specified graphics context.
| gc | The graphics context to get data for |
|
protectedvirtual |
Installs default properties for all root QML objects.
Sets up properties that every root QML object should have
|
protectedvirtual |
Updates the Qt Quick rendering in OSG.
| renderInfo | Render information from OSG |
|
protectedvirtual |
Handles a window being destroyed.
| win | Pointer to the window being destroyed |
|
protectedvirtual |
Sets up the debug configuration.
|
protectedvirtual |
Callback for debug manager.
|
protectedvirtual |
Reloads a QML file from file data.
| data | The file data to reload |
|
protectedvirtual |
Closes a UI from file data.
| data | The file data for the UI to close |
|
protectedvirtual |
Loads a QML file immediately.
| gc | The graphics context to load into |
| fileData | The file data to load |
|
friend |
Friends that need access to protected members.
References DtQtQuickRendererDrawable.
Referenced by DtQtQuickRendererDrawable.
|
friend |
References DtQQuickWindow.
Referenced by DtQQuickWindow.
|
staticprotected |
Singleton instance of the Qt Quick renderer.
|
protected |
Reference to the graphics engine.
Referenced by de().
|
protected |
Standard OSG geode for Qt Quick rendering.
|
protected |
Standard OSG drawable for Qt Quick rendering.
|
protected |
Render-to-texture OSG geode.
|
protected |
Render-to-texture OSG drawable.
|
protected |
QML engine for loading and rendering QML.
|
protected |
Default graphics context.
|
protected |
Map of graphics contexts to Qt Quick data.
|
protected |
List of UIs waiting to be loaded.
|
protected |
List of UIs that have been loaded.
|
protected |
Signal connection manager for Qt signals.
|
protected |
Texture to synchronize for VR rendering.
|
protected |
Debug map for QML event debugging.