VR-Engage  2.2
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 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 DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () 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
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

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.

◆ tick()

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

Called every frame to update the component state.

Parameters
dtDelta 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.

◆ 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.

◆ myFirstTick

bool makVre::DtWindowLayoutComponent::myFirstTick
protected

Flag indicating if this is the first tick.

◆ myMainWindow

QMainWindow* makVre::DtWindowLayoutComponent::myMainWindow
protected

Pointer to the main application window.


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