|
VR-Engage
2.2
|
DtWindowLayoutComponent changes the size and position of the main application window when a player engages in a role that includes this component, and restores the original window geometry when the player leaves the role. This allows different roles to have customized window layouts optimized for their specific needs.
#include <windowLayoutComponent.h>
Public Member Functions | |
| DtWindowLayoutComponent () | |
| virtual | ~DtWindowLayoutComponent () override |
| virtual bool | initialize (DtPlayerStation *station, DtInitTable &config) override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| virtual bool | postInitialize () |
| 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 | onCurrentStateChanged (std::string state) |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Protected Attributes | |
| int | myHeight |
| int | myWidth |
| int | myPositionX |
| int | myPositionY |
| QRect | myCachedGeometry |
| bool | myFirstTick |
| QMainWindow * | myMainWindow |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| makVre::DtWindowLayoutComponent::DtWindowLayoutComponent | ( | ) |
Constructor for DtWindowLayoutComponent.
Initializes the component with default settings
|
overridevirtual |
Virtual destructor for DtWindowLayoutComponent.
|
overridevirtual |
Initializes the window layout component.
| station | Pointer to the player station this component belongs to |
| config | Configuration table containing window geometry settings |
Reads window geometry parameters from the configuration, including width, height, and position coordinates. Caches the current main window geometry to allow restoration when leaving the role or shutting down the component.
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Called every frame to update the component state.
| dt | Delta time since the last frame in seconds |
On the first tick, applies the configured window geometry settings to the main application window
Implements makVre::DtPlayerComponent.
|
overridevirtual |
Shuts down the window layout component.
Restores the original window geometry that was cached during initialization and removes the state change callback
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the type identifier for this component.
Implements makVre::DtPlayerComponent.
|
protectedvirtual |
Handler for application state changes.
| state | The new application state name |
Applies configured window geometry when entering ENGAGED_STATE and restores the cached geometry when entering MENU_STATE
|
protected |
Configured window height in pixels.
|
protected |
Configured window width in pixels.
|
protected |
Configured window X position in screen coordinates.
|
protected |
Configured window Y position in screen coordinates.
|
protected |
Original window geometry cached during initialization.
|
protected |
Flag indicating if this is the first tick.
|
protected |
Pointer to the main application window.