VR-Engage  2.3
Loading...
Searching...
No Matches
makVre::DtWindowLayoutComponent Class Reference

Detailed Description

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>

Inheritance diagram for makVre::DtWindowLayoutComponent:
[legend]

Public Member Functions

 DtWindowLayoutComponent ()
 
virtual ~DtWindowLayoutComponent () override
 
virtual bool initialize (DtPlayerStation *station, DtInitTable &config) override
 
virtual DtInitTickStatus finalizeInitTick (double dt) 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 ()
 
bool componentReady () const
 
void setComponentReady (bool ready)
 
virtual void setName (const std::string &name)
 
virtual const std::string & name ()
 
virtual DtPlayerStation & player ()
 
virtual DtAttributeHandle & playerAttributeStore ()
 
virtual const DtAttributeHandle & playerAttributeStore () const
 
virtual const DtAttributeHandle & ownshipState () const
 
virtual void setExtendedData (const std::string &key, const std::string &value, DtEntityIdentifier entity=DtEntityIdentifier::nullId())
 

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
 
QMainWindow * myMainWindow
 
- Protected Attributes inherited from makVre::DtPlayerComponent
bool myComponentReady = true
 
std::string myName
 
DtInitTable myConfig
 
DtPlayerStation * myPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolver * myResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 
DtVreMessageHandlerGroup myMessageHandlers
 

Constructor & Destructor Documentation

◆ DtWindowLayoutComponent()

makVre::DtWindowLayoutComponent::DtWindowLayoutComponent ( )

Constructor for DtWindowLayoutComponent.

Initializes the component with default settings

◆ ~DtWindowLayoutComponent()

virtual makVre::DtWindowLayoutComponent::~DtWindowLayoutComponent ( )
overridevirtual

Virtual destructor for DtWindowLayoutComponent.

Member Function Documentation

◆ initialize()

virtual bool makVre::DtWindowLayoutComponent::initialize ( DtPlayerStation * station,
DtInitTable & config )
overridevirtual

Initializes the window layout component.

Parameters
stationPointer to the player station this component belongs to
configConfiguration table containing window geometry settings
Returns
True if initialization succeeded, false otherwise

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.

◆ finalizeInitTick()

virtual DtInitTickStatus makVre::DtWindowLayoutComponent::finalizeInitTick ( double dt)
overridevirtual

Called after postInitialize() to apply one-time window geometry.

Parameters
dtDelta time since the last frame in seconds
Returns
Ready once window geometry has been applied

Applies the configured window geometry settings to the main application window. This runs during the LOADING_PLAYER_STATE phase before engaged tick.

Reimplemented from makVre::DtPlayerComponent.

◆ tick()

virtual void makVre::DtWindowLayoutComponent::tick ( double dt)
inlineoverridevirtual

Called every frame to update the component state.

Parameters
dtDelta time since the last frame in seconds This component does not require per-frame updates, so this function is a no-op.

Implements makVre::DtPlayerComponent.

◆ shutdown()

virtual void makVre::DtWindowLayoutComponent::shutdown ( )
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.

◆ type()

virtual const char * makVre::DtWindowLayoutComponent::type ( ) const
overridevirtual

Returns the type identifier for this component.

Returns
The type string for DtWindowLayoutComponent

Implements makVre::DtPlayerComponent.

◆ onCurrentStateChanged()

virtual void makVre::DtWindowLayoutComponent::onCurrentStateChanged ( std::string state)
protectedvirtual

Handler for application state changes.

Parameters
stateThe new application state name

Applies configured window geometry when entering ENGAGED_STATE and restores the cached geometry when entering MENU_STATE

Member Data Documentation

◆ myHeight

int makVre::DtWindowLayoutComponent::myHeight
protected

Configured window height in pixels.

◆ myWidth

int makVre::DtWindowLayoutComponent::myWidth
protected

Configured window width in pixels.

◆ myPositionX

int makVre::DtWindowLayoutComponent::myPositionX
protected

Configured window X position in screen coordinates.

◆ myPositionY

int makVre::DtWindowLayoutComponent::myPositionY
protected

Configured window Y position in screen coordinates.

◆ myCachedGeometry

QRect makVre::DtWindowLayoutComponent::myCachedGeometry
protected

Original window geometry cached during initialization.

◆ myMainWindow

QMainWindow* makVre::DtWindowLayoutComponent::myMainWindow
protected

Pointer to the main application window.


The documentation for this class was generated from the following file: