|
VR-Engage
2.2
|
DtQtQuickOverlay loads and manages QML files as overlays for the 3D scene. It can bind state attributes to QML properties, control overlay visibility based on player state, and optionally hide the 3D scene when only the overlay should be visible.
#include <qtQuickOverlay.h>
Classes | |
| struct | Connection |
Public Member Functions | |
| DtQtQuickOverlay () | |
| virtual | ~DtQtQuickOverlay () override |
| virtual bool | initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override |
| virtual bool | postInitialize () override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
| virtual void | setRoot (QQuickItem *root) |
| virtual void | initdoc (QQuickItem *root) |
| virtual DtVreMessageResult | handleEnterPlayerState (DtVreMessage *msg) |
| virtual DtVreMessageResult | handleExitPlayerState (DtVreMessage *msg) |
| virtual void | setVisibility (bool visible) |
| virtual bool | isVisible () |
| virtual void | setMenuState (bool on) |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
Protected Member Functions | |
| virtual void | updateVals (double dt) |
| virtual void | disconnect () |
| virtual bool | buildConnections (DtInitTable &connections) |
| virtual void | onVisibilityAttributeChanged (bool on) |
| virtual void | removeModelSetAndSkyFromChannel () |
| virtual void | restoreModelSetAndSkyToChannel () |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Protected Attributes | |
| DtInitTable | myBindQmlPropertyToAttribute |
| QQuickItem * | myRoot |
| std::string | myTargetWindow |
| std::vector< Connection > | myConnections |
| std::string | myQmlFile |
| std::string | myQmlDataItemName |
| bool | myIsInMenuState |
| bool | myCachedVisibility |
| DtAttributeHandleType< bool > | myVisibilityAttribute |
| bool | myRenderOverlayOnly |
| bool | myWantSceneHidden |
| makVrv::DtOsgChannel * | myChannel |
| makVrv::DtObserverObject * | myObserver |
| QObject | myQObject |
| bool | myHasTickFunction |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| makVre::DtQtQuickOverlay::DtQtQuickOverlay | ( | ) |
Constructor for DtQtQuickOverlay.
|
overridevirtual |
Alternative constructor with target window parameter (commented out)
| target_window | The target window to display the overlay on |
Destructor that cleans up message handlers and attribute callbacks
|
overridevirtual |
Initializes the overlay component with configuration options.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing overlay settings |
Required configuration parameters:
Optional configuration parameters:
Reimplemented from makVre::DtPlayerComponent.
Reimplemented in makVre::DtBinocularsLasingOverlay, makVre::DtBinocularsOverlay, makVre::DtBinocularsZoomOverlay, and makVre::DtSpectatorOverlay.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Performs post-initialization steps after all components are initialized.
Builds connections between state attributes and QML properties, then loads the QML file using the appropriate renderer method based on VR status
Reimplemented from makVre::DtPlayerComponent.
Reimplemented in makVre::DtBinocularsLasingOverlay, makVre::DtBinocularsOverlay, and makVre::DtBinocularsZoomOverlay.
|
overridevirtual |
Called every frame to update the overlay.
| dt | Delta time since the last frame in seconds |
Updates QML property values from state attributes and handles scene visibility
Implements makVre::DtPlayerComponent.
Reimplemented in makVre::DtBinocularsLasingOverlay, makVre::DtBinocularsOverlay, makVre::DtBinocularsZoomOverlay, and makVre::DtSpectatorOverlay.
|
overridevirtual |
Shuts down the overlay component.
Closes the UI, restores 3D scene visibility if needed, and disconnects property bindings
Reimplemented from makVre::DtPlayerComponent.
Reimplemented in makVre::DtBinocularsLasingOverlay, makVre::DtBinocularsOverlay, and makVre::DtSpectatorOverlay.
|
overridevirtual |
Returns the type identifier for this component.
Implements makVre::DtPlayerComponent.
Reimplemented in makVre::DtBinocularsLasingOverlay, makVre::DtBinocularsOverlay, makVre::DtBinocularsZoomOverlay, and makVre::DtSpectatorOverlay.
|
inlinevirtual |
Sets the root QQuickItem for this overlay.
| root | Pointer to the root QQuickItem |
References myRoot.
|
virtual |
Initialize document with the root QQuickItem.
| root | Pointer to the root QQuickItem |
Stores the root item and sets initial visibility based on the visibility attribute
Reimplemented in makVre::DtSpectatorOverlay.
|
virtual |
Handles messages for entering player states.
| msg | The message containing the state transition information |
Special handling for MENU_STATE and ENGAGED states to control overlay visibility and scene visibility when renderOverlayOnly is true
|
virtual |
Handles messages for exiting player states.
| msg | The message containing the state transition information |
Special handling for MENU_STATE to restore previous overlay visibility and control scene visibility when renderOverlayOnly is true
|
virtual |
Sets the visibility of the overlay.
| visible | True to show the overlay, false to hide it |
Sets the "visible" property on the root QML item
|
virtual |
Checks if the overlay is currently visible.
Reads the "visible" property from the root QML item
|
virtual |
Updates the menu state and toggles visibility accordingly.
| on | True if entering menu state, false if exiting |
When entering menu state, caches and hides the overlay When exiting menu state, restores the previous visibility
|
protectedvirtual |
Updates QML property values from state attributes.
| dt | Delta time since the last frame in seconds |
Finds the QML value source object and updates properties based on current state attribute values, then calls the tick method on the source
|
protectedvirtual |
Disconnects all property bindings.
Clears the connections list to remove all bindings
|
protectedvirtual |
Builds connections between state attributes and QML properties.
| connections | Configuration table defining the connections |
Each connection maps a state attribute to a QML property
|
protectedvirtual |
Called when the visibility attribute changes.
| on | New visibility value |
Sets the overlay visibility based on the new attribute value
|
protectedvirtual |
Removes the model set and sky from the channel.
Used when renderOverlayOnly is true to hide the 3D scene and only show the overlay
|
protectedvirtual |
Restores the model set and sky to the channel.
Used to restore the 3D scene visibility after it was hidden
|
protected |
Configuration table containing QML data item bindings.
|
protected |
Pointer to the root QQuickItem for this overlay.
Referenced by setRoot().
|
protected |
Name of the target window to display the overlay on.
|
protected |
List of connections between state attributes and QML properties.
|
protected |
Path to the QML file to load.
|
protected |
Name of the QML object to bind data to.
|
protected |
Flag indicating if the PlayerStation is in the "MENU_STATE" Used to determine whether the overlays should be visible.
|
protected |
Cached visibility value to restore when exiting menu state.
|
protected |
Handle to attribute that controls overlay visibility.
|
protected |
Flag indicating if only the overlay should be rendered without the 3D scene.
|
protected |
Flag indicating if the 3D scene should be hidden.
|
protected |
Pointer to the OSG channel used for rendering.
|
protected |
Pointer to the observer object for the channel.
|
protected |
QObject used as the owner for the QML UI.
|
protected |
Flag indicating whether the QML data item has a tick(double) function.