VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtChooseRolePanel Class Reference

Detailed Description

DtChooseRolePanel provides the main user interface for selecting entities and roles in VR-Engage. It displays lists of available entities, filtering options, role selections, and controls for engaging with the simulation.

This panel manages the transition between the role selection state and the engaged state, handling UI interactions, entity selection, and role configuration.

#include <chooseRolePanel.h>

Inheritance diagram for makVre::DtChooseRolePanel:
[legend]

Public Member Functions

 DtChooseRolePanel (makVrv::DtDe &de, makVrv::DtQtDeMainWindow *mainWindow, DtPlayerStationApp &app)
 
virtual ~DtChooseRolePanel () override
 
virtual bool initiallyVisible () const
 
virtual void showContainer ()
 
virtual void hideContainer ()
 
virtual void tick (double dt)
 
virtual void setReady (bool ready)
 
DtVreMessageResult handleSmsLoadComplete (DtVreMessage *msg)
 
virtual void onSmsChanged ()
 
virtual void onNewEntityCreated ()
 
virtual void resetPanel ()
 
void onDePreTick (makVrv::DtDe &de)
 
void onDePostTick ()
 
virtual void setEntityStateUpdateTime (double seconds)
 
virtual bool isObserverViewsButtonActive () const
 
virtual void enableCreateEntity (bool enabled)
 
virtual void clearSelectedEntities ()
 
virtual void onElementsAdded (const makVrv::DtElementData::ElementIdList &elements)
 
virtual void onElementsRemoved (const makVrv::DtElementData::ElementIdList &keys)
 
virtual void onElementsChanged (const makVrv::DtElementAttributeManager::EntryAttributesList &attributes)
 
virtual DtVreMessageResult handleSimState (DtVreMessage *msg)
 
virtual void onSceneSelectionChanged (const makVrv::DtSelectionManager::IdSet &selected, const makVrv::DtSelectionManager::IdSet &deselected)
 
virtual void onSceneClicked (makVrv::DtUniqueID id, const DtVector &location, double altAboveGround)
 
virtual bool eventFilter (QObject *p, QEvent *e) override
 
virtual void installEventFilters ()
 
virtual void removeEventFilters ()
 

Protected Types

enum  ViewModes { ViewMode_Map , ViewMode_3D }
 
enum  EntityListItemDataFields {
  DataField_ElementId , DataField_EntityId , DataField_Type , DataField_Force ,
  DataField_Categories , DataField_Countries , DataField_Name , DataField_OwnThis ,
  DataField_EmbarkedRole , DataField_EngagedBy
}
 
enum  EntityListItemColumns { ColumnId_Name , ColumnId_Type , ColumnId_Host , ColumnId_Engaged }
 

Protected Member Functions

virtual void updateDisplayLayoutsList (const makVrv::DtSceneObject *sceneObject)
 
virtual int altitudeSpinboxValueInMeters ()
 
void showOptimizingVRPerformanceDialog ()
 
virtual void on_displayUnitChanged ()
 
virtual void setViewMode (ViewModes mode=ViewMode_3D)
 
virtual void removeElementFromEntityList (makVrv::DtElementID id)
 
virtual void addElementToEntityList (const makVrv::DtElementEntry &data)
 
virtual QTreeWidgetItem * findEntityListItem (const makVrv::DtElementID &id)
 
virtual QTreeWidgetItem * findEntityListItem (const DtEntityIdentifier &id)
 
virtual void applyFilters ()
 
virtual void applyFilter (QTreeWidget *tree)
 
virtual bool viewAllEntities ()
 
virtual bool viewCurrentEntity ()
 

Protected Attributes

QMainWindow * myMainWindow
 
QMenu * myEntityTreeContextMenu
 
QMenu * myCreateTreeContextMenu
 
QAction * myCopyEntityIdAction
 
QAction * myCopyEntityTypeAction
 
QAction * myCopyCreateTypeAction
 
DtCreateNewEntityEventProcessormyEventProcessor
 
makVrv::DtSignalConnectionManager mySignals
 
DtPlayerStationAppmyApp
 
makVrv::DtDe & myDe
 
bool myWantedSpectator
 
bool myDidInitialViewAll
 
int myLastEntityCount
 
double mySceneClickTimer
 
int myEntityStateUpdateIndex
 
double myEntityStateLastUpdateTime
 
double myEntityStateUpdateTime
 
DtEntityType mySelectedEntityType
 
bool myDisplayListNeedsUpdate
 
std::map< std::string, std::string > myPreviousRoleSettings
 
DtOptimizingVRPerformanceDialogmyOptimizingVRPerformanceDialog
 
makVrv::DtSignalConnectionManager myConnections
 
virtual void slot_onTakeControlClicked (bool checked)
 
virtual void slot_onCreateNewClicked (bool checked)
 
virtual void slot_onCategoryFilterChanged (const QString &category)
 
virtual void slot_onCountryFilterChanged (const QString &country)
 
virtual void slot_onForceFilterChanged (const QString &force)
 
virtual void slot_onRoleSelectionChanged (const QString &role)
 
virtual void slot_onConfigurationSelectionChanged (const QString &config)
 
virtual void slot_onResetFiltersClicked ()
 
virtual void slot_onSearchFilterChanged (const QString &text)
 
virtual void slot_onResetSearchClicked ()
 
virtual void slot_onEntityItemClicked (QTreeWidgetItem *item, int column)
 
virtual void slot_onEntityItemDoubleClicked (QTreeWidgetItem *, int)
 
virtual void slot_onEntitySelectionChanged ()
 
virtual void slot_onCreateItemClicked (QTreeWidgetItem *item, int column)
 
virtual void slot_onCreateItemDoubleClicked (QTreeWidgetItem *item, int column)
 
virtual void slot_onCreateSelectionChanged ()
 
virtual void slot_onNameEdited (const QString &name)
 
virtual void slot_onAtAltitudeToggled (bool on)
 
virtual void slot_onAltitudeChanged (int altitude)
 
virtual void slot_onHeadingChanged (const QString &heading)
 
virtual void slot_onPitchChanged (const QString &pitch)
 
virtual void slot_onResetViewClicked ()
 
virtual void slot_onObserverViewsPanelToggled (bool visible)
 
virtual void slot_onMapViewToggled (bool on)
 
virtual void slot_onEntityViewToggled (bool on)
 
virtual void slot_onPlayClicked ()
 
virtual void slot_onEntityContextMenu (const QPoint &pos)
 
virtual void slot_onCreateContextMenu (const QPoint &pos)
 
virtual void slot_onEntityContextMenuActionCopyId ()
 
virtual void slot_onEntityContextMenuActionCopyType ()
 
virtual void slot_onCreateContextMenuActionCopyType ()
 
virtual void repositionChooseRolePanel ()
 
virtual void debugCallback ()
 
virtual void buildCreateEntityList ()
 
virtual void buildExistingEntityList ()
 
virtual void buildCategoriesList ()
 
virtual void buildCountriesList ()
 
virtual void buildForcesList ()
 
virtual void buildRolesList (const DtEntityType &entityType)
 
virtual bool findRoles (const DtEntityType &entityType, QComboBox *box=NULL)
 

Member Enumeration Documentation

◆ ViewModes

Enumeration of available view modes.

Defines the supported viewing modes for the observer during role selection. These modes control how the simulation environment is visualized.

Enumerator
ViewMode_Map 

2D map view mode (top-down orthographic projection)

ViewMode_3D 

3D perspective view mode (configurable camera angle)

◆ EntityListItemDataFields

Data fields for entity list items.

Defines the data fields stored in each entity list item. These fields provide metadata about the entity and are used for filtering, display, and selection logic. Fields are stored as item data in the QTreeWidgetItem.

Enumerator
DataField_ElementId 

Display engine element ID from the scene graph.

DataField_EntityId 

Simulation entity ID used in network messages.

DataField_Type 

Entity type (e.g., "T-72", "M1A2", "Infantry")

DataField_Force 

Force type (friendly, hostile, neutral, etc.)

DataField_Categories 

Categories the entity belongs to (e.g., "Ground", "Air")

DataField_Countries 

Countries associated with the entity (e.g., "USA", "UK")

DataField_Name 

Display name of the entity shown in the UI.

DataField_OwnThis 

Whether this entity is owned by the current player.

DataField_EmbarkedRole 

Role this entity is embarked as (if applicable)

DataField_EngagedBy 

Player name who is currently engaged with this entity.

◆ EntityListItemColumns

Column identifiers for the entity list.

Defines the columns displayed in the entity list tree widget. These columns present entity information to the user and can be used for sorting and navigation.

Enumerator
ColumnId_Name 

Name column showing entity display name.

ColumnId_Type 

Type column showing entity type designation.

ColumnId_Host 

Host column showing containing entity (if embarked)

ColumnId_Engaged 

Engaged column showing engagement status and player.

Constructor & Destructor Documentation

◆ DtChooseRolePanel()

makVre::DtChooseRolePanel::DtChooseRolePanel ( makVrv::DtDe & de,
makVrv::DtQtDeMainWindow * mainWindow,
DtPlayerStationApp & app )

Constructor.

Parameters
deReference to the display engine
mainWindowPointer to the main application window
appReference to the player station application

Creates a new role selection panel, initializing UI components and connecting signals and slots for event handling.

References de().

◆ ~DtChooseRolePanel()

virtual makVre::DtChooseRolePanel::~DtChooseRolePanel ( )
overridevirtual

Destructor.

Cleans up resources and disconnects signals.

Member Function Documentation

◆ initiallyVisible()

virtual bool makVre::DtChooseRolePanel::initiallyVisible ( ) const
inlinevirtual

Determines initial visibility of the panel.

Returns
False to indicate the panel should initially be hidden

Virtual function needed for controlling if the widget is initially visible when docked. Returns false by default, as the panel is typically shown only when entering the role selection state.

◆ showContainer()

virtual void makVre::DtChooseRolePanel::showContainer ( )
virtual

Shows the panel container.

Makes the role selection panel visible to the user.

◆ hideContainer()

virtual void makVre::DtChooseRolePanel::hideContainer ( )
virtual

Hides the panel container.

Makes the role selection panel invisible to the user.

◆ tick()

virtual void makVre::DtChooseRolePanel::tick ( double dt)
virtual

Updates the panel state.

Parameters
dtTime in seconds since the last update

Called once per frame to update the panel's state, handle deferred operations, and refresh the UI as needed.

◆ setReady()

virtual void makVre::DtChooseRolePanel::setReady ( bool ready)
virtual

Sets the ready state of the panel.

Parameters
readyTrue if the panel is ready, false otherwise

Indicates whether the panel is fully initialized and ready for interaction. When ready, certain UI elements become enabled and data loading completes.

◆ onElementsAdded()

virtual void makVre::DtChooseRolePanel::onElementsAdded ( const makVrv::DtElementData::ElementIdList & elements)
virtual

Element signal handlers.

Handles the addition of new elements to the scene

Parameters
elementsList of IDs for the added elements

Called when new elements are added to the display engine scene. Updates the entity list with the new elements that can be engaged.

◆ onElementsRemoved()

virtual void makVre::DtChooseRolePanel::onElementsRemoved ( const makVrv::DtElementData::ElementIdList & keys)
virtual

Handles the removal of elements from the scene.

Parameters
keysList of IDs for the removed elements

Called when elements are removed from the display engine scene. Removes the corresponding entries from the entity list.

◆ onElementsChanged()

virtual void makVre::DtChooseRolePanel::onElementsChanged ( const makVrv::DtElementAttributeManager::EntryAttributesList & attributes)
virtual

Handles changes to element attributes.

Parameters
attributesList of attribute changes for elements

Called when element attributes change in the display engine. Updates the entity list with the modified information.

◆ handleSimState()

virtual DtVreMessageResult makVre::DtChooseRolePanel::handleSimState ( DtVreMessage * msg)
virtual

Entity message handlers.

Handles simulation state messages

Parameters
msgPointer to the simulation state message
Returns
Message handling result

Processes messages about entity simulation state changes, updating the UI with the latest information about entities.

◆ onSceneSelectionChanged()

virtual void makVre::DtChooseRolePanel::onSceneSelectionChanged ( const makVrv::DtSelectionManager::IdSet & selected,
const makVrv::DtSelectionManager::IdSet & deselected )
virtual

Scene signal handlers.

Handles scene selection changes

Parameters
selectedSet of IDs for newly selected elements
deselectedSet of IDs for deselected elements

Called when the user changes the selection in the 3D scene. Updates the UI to reflect the currently selected entities.

◆ onSceneClicked()

virtual void makVre::DtChooseRolePanel::onSceneClicked ( makVrv::DtUniqueID id,
const DtVector & location,
double altAboveGround )
virtual

Handles scene clicks.

Parameters
idUnique ID of the clicked element (if any)
location3D position of the click
altAboveGroundAltitude above ground at the click position

Called when the user clicks in the 3D scene. Used for selecting entities or determining locations for entity creation.

◆ handleSmsLoadComplete()

DtVreMessageResult makVre::DtChooseRolePanel::handleSmsLoadComplete ( DtVreMessage * msg)

Handles SMS load completion messages.

Parameters
msgPointer to the SMS load complete message
Returns
Message handling result

Processes messages indicating that loading of Simulation Model Sets (SMS) has completed, triggering UI updates with the new data.

◆ onSmsChanged()

virtual void makVre::DtChooseRolePanel::onSmsChanged ( )
virtual

Handles SMS changes.

Called when the list of active Simulation Model Sets (SMS) changes. Updates the entity lists and filtering options accordingly.

◆ onNewEntityCreated()

virtual void makVre::DtChooseRolePanel::onNewEntityCreated ( )
virtual

Handles creation of new entities.

Called when a new entity is created in the simulation. Updates the entity list and may select the new entity.

◆ resetPanel()

virtual void makVre::DtChooseRolePanel::resetPanel ( )
virtual

Resets the panel to its initial state.

Clears all selections, filters, and cached data, returning the panel to its initial state as if it was just opened. This is typically called when disengaging from a role or when the application state changes.

◆ onDePreTick()

void makVre::DtChooseRolePanel::onDePreTick ( makVrv::DtDe & de)

Handles pre-tick events from the display engine.

Parameters
deReference to the display engine

Called before the display engine updates each frame. Used for time-sensitive operations that need to occur before rendering.

References de().

◆ onDePostTick()

void makVre::DtChooseRolePanel::onDePostTick ( )

Handles post-tick events from the display engine.

Called after the display engine updates each frame. Used for operations that should occur after rendering is complete.

◆ setEntityStateUpdateTime()

virtual void makVre::DtChooseRolePanel::setEntityStateUpdateTime ( double seconds)
virtual

Sets the entity state update interval.

Parameters
secondsNumber of seconds between updates

Sets the number of seconds between entity simulation state update cycles. The default value is 5 seconds. Shorter intervals provide more frequent updates but may impact performance.

◆ eventFilter()

virtual bool makVre::DtChooseRolePanel::eventFilter ( QObject * p,
QEvent * e )
overridevirtual

Application event handling.

Filters application-level events

Parameters
pObject that received the event
eEvent that was received
Returns
True if the event was handled, false to pass it on

Intercepts application-level events for custom processing, such as keyboard shortcuts or mouse events outside the normal widget hierarchy.

◆ installEventFilters()

virtual void makVre::DtChooseRolePanel::installEventFilters ( )
virtual

Installs event filters for application-level event handling.

Sets up the event filters to intercept application events before they reach their normal destination widgets.

◆ removeEventFilters()

virtual void makVre::DtChooseRolePanel::removeEventFilters ( )
virtual

Removes previously installed event filters.

Removes the event filters, restoring normal event handling.

◆ isObserverViewsButtonActive()

virtual bool makVre::DtChooseRolePanel::isObserverViewsButtonActive ( ) const
virtual

Checks if the observer views button is active.

Returns
True if the observer views button is checked, false otherwise

Determines whether the observer views button in the UI is currently in the active (checked) state. This affects whether observer views are shown alongside the role selection panel.

◆ enableCreateEntity()

virtual void makVre::DtChooseRolePanel::enableCreateEntity ( bool enabled)
virtual

Enables or disables the create entity option.

Parameters
enabledTrue to enable entity creation, false to disable it

Controls whether the UI allows users to create new entities. This might be disabled in certain contexts or configurations.

◆ clearSelectedEntities()

virtual void makVre::DtChooseRolePanel::clearSelectedEntities ( )
virtual

Clears all entity selections.

Deselects all currently selected entities in both the UI and the scene. This resets the selection state without affecting other panel settings.

◆ slot_onTakeControlClicked

virtual void makVre::DtChooseRolePanel::slot_onTakeControlClicked ( bool checked)
virtualslot

UI event handlers (slots)

Handles clicks on the "Take Control" (Engage) button

Parameters
checkedWhether the button is now checked

◆ slot_onCreateNewClicked

virtual void makVre::DtChooseRolePanel::slot_onCreateNewClicked ( bool checked)
virtualslot

Handles clicks on the "Create New" button.

Parameters
checkedWhether the button is now checked

◆ slot_onCategoryFilterChanged

virtual void makVre::DtChooseRolePanel::slot_onCategoryFilterChanged ( const QString & category)
virtualslot

Handles changes to the category filter.

Parameters
categoryNew category filter value

◆ slot_onCountryFilterChanged

virtual void makVre::DtChooseRolePanel::slot_onCountryFilterChanged ( const QString & country)
virtualslot

Handles changes to the country filter.

Parameters
countryNew country filter value

◆ slot_onForceFilterChanged

virtual void makVre::DtChooseRolePanel::slot_onForceFilterChanged ( const QString & force)
virtualslot

Handles changes to the force filter.

Parameters
forceNew force filter value

◆ slot_onRoleSelectionChanged

virtual void makVre::DtChooseRolePanel::slot_onRoleSelectionChanged ( const QString & role)
virtualslot

Handles selection of a different role.

Parameters
roleName of the selected role

◆ slot_onConfigurationSelectionChanged

virtual void makVre::DtChooseRolePanel::slot_onConfigurationSelectionChanged ( const QString & config)
virtualslot

Handles selection of a different display configuration.

Parameters
configName of the selected configuration

◆ slot_onResetFiltersClicked

virtual void makVre::DtChooseRolePanel::slot_onResetFiltersClicked ( )
virtualslot

Handles clicks on the "Reset Filters" button.

◆ slot_onSearchFilterChanged

virtual void makVre::DtChooseRolePanel::slot_onSearchFilterChanged ( const QString & text)
virtualslot

Handles changes to the search filter text.

Parameters
textNew search filter text

◆ slot_onResetSearchClicked

virtual void makVre::DtChooseRolePanel::slot_onResetSearchClicked ( )
virtualslot

Handles clicks on the "Reset Search" button.

◆ slot_onEntityItemClicked

virtual void makVre::DtChooseRolePanel::slot_onEntityItemClicked ( QTreeWidgetItem * item,
int column )
virtualslot

Handles clicks on items in the entity list.

Parameters
itemThe tree widget item that was clicked
columnThe column that was clicked

◆ slot_onEntityItemDoubleClicked

virtual void makVre::DtChooseRolePanel::slot_onEntityItemDoubleClicked ( QTreeWidgetItem * ,
int  )
virtualslot

Handles double-clicks on items in the entity list.

Parameters
itemThe tree widget item that was double-clicked
columnThe column that was double-clicked

◆ slot_onEntitySelectionChanged

virtual void makVre::DtChooseRolePanel::slot_onEntitySelectionChanged ( )
virtualslot

Handles changes in entity selection in the entity list.

Called when the user selects a different entity in the entity list. Updates the role and display layout lists based on the new selection, and may also update the view to focus on the selected entity.

◆ slot_onCreateItemClicked

virtual void makVre::DtChooseRolePanel::slot_onCreateItemClicked ( QTreeWidgetItem * item,
int column )
virtualslot

Handles clicks on items in the create entity list.

Parameters
itemThe tree widget item that was clicked
columnThe column that was clicked

Called when the user clicks on an item in the create entity list. Updates the selected entity type and role options based on the clicked item.

◆ slot_onCreateItemDoubleClicked

virtual void makVre::DtChooseRolePanel::slot_onCreateItemDoubleClicked ( QTreeWidgetItem * item,
int column )
virtualslot

Handles double-clicks on items in the create entity list.

Parameters
itemThe tree widget item that was double-clicked
columnThe column that was double-clicked

Called when the user double-clicks on an item in the create entity list. May automatically select the item and begin the entity creation process.

◆ slot_onCreateSelectionChanged

virtual void makVre::DtChooseRolePanel::slot_onCreateSelectionChanged ( )
virtualslot

Handles changes in entity selection in the create entity list.

Called when the user selects a different entity type in the create entity list. Updates the role and display layout lists based on the new selection.

◆ slot_onNameEdited

virtual void makVre::DtChooseRolePanel::slot_onNameEdited ( const QString & name)
virtualslot

Handles edits to the entity name field.

Parameters
nameThe new entity name

Called when the user edits the name field for a new entity. Updates the stored name for the entity being created.

◆ slot_onAtAltitudeToggled

virtual void makVre::DtChooseRolePanel::slot_onAtAltitudeToggled ( bool on)
virtualslot

Handles toggling of the "at altitude" option.

Parameters
onTrue if the option is turned on, false otherwise

Called when the user toggles the option to place an entity at a specific altitude. Enables or disables the altitude input field based on the toggle state.

◆ slot_onAltitudeChanged

virtual void makVre::DtChooseRolePanel::slot_onAltitudeChanged ( int altitude)
virtualslot

Handles changes to the altitude value.

Parameters
altitudeThe new altitude value

Called when the user changes the altitude value for entity placement. Updates the stored altitude for the entity being created.

◆ slot_onHeadingChanged

virtual void makVre::DtChooseRolePanel::slot_onHeadingChanged ( const QString & heading)
virtualslot

Handles changes to the entity heading.

Parameters
headingThe new heading value as a string

Called when the user changes the heading value for entity placement. Updates the stored heading for the entity being created.

◆ slot_onPitchChanged

virtual void makVre::DtChooseRolePanel::slot_onPitchChanged ( const QString & pitch)
virtualslot

Handles changes to the entity pitch.

Parameters
pitchThe new pitch value as a string

Called when the user changes the pitch value for entity placement. Updates the stored pitch for the entity being created.

◆ slot_onResetViewClicked

virtual void makVre::DtChooseRolePanel::slot_onResetViewClicked ( )
virtualslot

Handles clicks on the "Reset View" button.

Called when the user clicks the Reset View button. Resets the observer view to show all entities in the scene, providing an overview of the available entities.

◆ slot_onObserverViewsPanelToggled

virtual void makVre::DtChooseRolePanel::slot_onObserverViewsPanelToggled ( bool visible)
virtualslot

Handles toggling of the observer views panel.

Parameters
visibleTrue if the panel should be visible, false otherwise

Called when the user toggles the observer views panel button. Shows or hides the observer views panel based on the toggle state.

◆ slot_onMapViewToggled

virtual void makVre::DtChooseRolePanel::slot_onMapViewToggled ( bool on)
virtualslot

Handles toggling of the map view.

Parameters
onTrue if map view should be enabled, false otherwise

Called when the user toggles the map view button. Switches the view mode between 2D map view and 3D perspective view.

◆ slot_onEntityViewToggled

virtual void makVre::DtChooseRolePanel::slot_onEntityViewToggled ( bool on)
virtualslot

Handles toggling of the entity view.

Parameters
onTrue if entity view should be enabled, false otherwise

Called when the user toggles the entity view button. Controls whether the view focuses on the selected entity.

◆ slot_onPlayClicked

virtual void makVre::DtChooseRolePanel::slot_onPlayClicked ( )
virtualslot

Handles clicks on the "Play" button.

Called when the user clicks the Play button. This engages the user with the selected entity using the chosen role and display layout, transitioning from the role selection state to the playing state.

◆ slot_onEntityContextMenu

virtual void makVre::DtChooseRolePanel::slot_onEntityContextMenu ( const QPoint & pos)
virtualslot

Handles context menu requests in the entity list.

Parameters
posPosition where the context menu was requested

Called when the user right-clicks on an item in the entity list. Shows a context menu with entity-specific actions.

◆ slot_onCreateContextMenu

virtual void makVre::DtChooseRolePanel::slot_onCreateContextMenu ( const QPoint & pos)
virtualslot

Handles context menu requests in the create entity list.

Parameters
posPosition where the context menu was requested

Called when the user right-clicks on an item in the create entity list. Shows a context menu with actions specific to entity creation.

◆ slot_onEntityContextMenuActionCopyId

virtual void makVre::DtChooseRolePanel::slot_onEntityContextMenuActionCopyId ( )
virtualslot

Handles the "Copy ID" action from the entity context menu.

Called when the user selects the Copy ID action from the entity context menu. Copies the selected entity's ID to the clipboard.

◆ slot_onEntityContextMenuActionCopyType

virtual void makVre::DtChooseRolePanel::slot_onEntityContextMenuActionCopyType ( )
virtualslot

Handles the "Copy Type" action from the entity context menu.

Called when the user selects the Copy Type action from the entity context menu. Copies the selected entity's type to the clipboard.

◆ slot_onCreateContextMenuActionCopyType

virtual void makVre::DtChooseRolePanel::slot_onCreateContextMenuActionCopyType ( )
virtualslot

Handles the "Copy Type" action from the create entity context menu.

Called when the user selects the Copy Type action from the create entity context menu. Copies the selected entity type to the clipboard.

◆ repositionChooseRolePanel()

virtual void makVre::DtChooseRolePanel::repositionChooseRolePanel ( )
protectedvirtual

Repositions the choose role panel.

Adjusts the position and size of the panel within the application window. This is typically called when the window size changes or when the panel is first shown.

◆ debugCallback()

virtual void makVre::DtChooseRolePanel::debugCallback ( )
protectedvirtual

Provides debugging information.

Called during debugging to output information about the panel's state. This is used for diagnostic purposes during development and testing.

◆ buildCreateEntityList()

virtual void makVre::DtChooseRolePanel::buildCreateEntityList ( )
protectedvirtual

List building methods.

Builds the list of entity types that can be created

Populates the create entity list with all available entity types from the current simulation model sets.

◆ buildExistingEntityList()

virtual void makVre::DtChooseRolePanel::buildExistingEntityList ( )
protectedvirtual

Builds the list of existing entities in the simulation.

Populates the existing entity list with all entities currently present in the simulation that can be engaged with.

◆ buildCategoriesList()

virtual void makVre::DtChooseRolePanel::buildCategoriesList ( )
protectedvirtual

Builds the list of entity categories for filtering.

Populates the category filter dropdown with all unique categories found in the available entity types.

◆ buildCountriesList()

virtual void makVre::DtChooseRolePanel::buildCountriesList ( )
protectedvirtual

Builds the list of countries for filtering.

Populates the country filter dropdown with all unique countries found in the available entity types.

◆ buildForcesList()

virtual void makVre::DtChooseRolePanel::buildForcesList ( )
protectedvirtual

Builds the list of force types for filtering.

Populates the force filter dropdown with all available force types (Friendly, Hostile, Neutral, etc.).

◆ buildRolesList()

virtual void makVre::DtChooseRolePanel::buildRolesList ( const DtEntityType & entityType)
protectedvirtual

Builds the list of available roles for an entity type.

Parameters
entityTypeThe entity type to get roles for

Populates the role dropdown with all available roles for the specified entity type.

◆ findRoles()

virtual bool makVre::DtChooseRolePanel::findRoles ( const DtEntityType & entityType,
QComboBox * box = NULL )
protectedvirtual

Finds available roles for an entity type.

Parameters
entityTypeThe entity type to find roles for
boxOptional combo box to populate with the roles
Returns
True if roles were found, false otherwise

Searches for available roles for the specified entity type and optionally populates a combo box with the results.

◆ removeElementFromEntityList()

virtual void makVre::DtChooseRolePanel::removeElementFromEntityList ( makVrv::DtElementID id)
protectedvirtual

Entity list management methods.

Removes an element from the entity list

Parameters
idID of the element to remove

Removes an entity from the list of existing entities based on its element ID.

◆ addElementToEntityList()

virtual void makVre::DtChooseRolePanel::addElementToEntityList ( const makVrv::DtElementEntry & data)
protectedvirtual

Adds an element to the entity list.

Parameters
dataElement data to add

Adds a new entity to the list of existing entities based on its element data.

◆ findEntityListItem() [1/2]

virtual QTreeWidgetItem * makVre::DtChooseRolePanel::findEntityListItem ( const makVrv::DtElementID & id)
protectedvirtual

Finds an item in the entity list by element ID.

Parameters
idElement ID to search for
Returns
Pointer to the found item, or NULL if not found

Searches the entity list for an item with the specified element ID.

◆ findEntityListItem() [2/2]

virtual QTreeWidgetItem * makVre::DtChooseRolePanel::findEntityListItem ( const DtEntityIdentifier & id)
protectedvirtual

Finds an item in the entity list by entity ID.

Parameters
idEntity ID to search for
Returns
Pointer to the found item, or NULL if not found

Searches the entity list for an item with the specified entity ID.

◆ applyFilters()

virtual void makVre::DtChooseRolePanel::applyFilters ( )
protectedvirtual

Filter application methods.

Applies all filters to both entity lists

Applies the current search text and category/country/force filters to both the existing entity list and the create entity list.

◆ applyFilter()

virtual void makVre::DtChooseRolePanel::applyFilter ( QTreeWidget * tree)
protectedvirtual

Applies filters to a specific tree widget.

Parameters
treeThe tree widget to apply filters to

Applies the current filters to the specified tree widget, showing only items that match all filter criteria.

◆ viewAllEntities()

virtual bool makVre::DtChooseRolePanel::viewAllEntities ( )
protectedvirtual

View manipulation methods.

Centers the view on all entities

Returns
True if the view was adjusted successfully, false otherwise

Adjusts the observer view to show all entities in the scene.

◆ viewCurrentEntity()

virtual bool makVre::DtChooseRolePanel::viewCurrentEntity ( )
protectedvirtual

Centers the view on the currently selected entity.

Returns
True if the view was adjusted successfully, false otherwise

Adjusts the observer view to focus on the currently selected entity.

◆ updateDisplayLayoutsList()

virtual void makVre::DtChooseRolePanel::updateDisplayLayoutsList ( const makVrv::DtSceneObject * sceneObject)
protectedvirtual

Updates the list of available display layouts.

Parameters
sceneObjectPointer to the scene object representing the selected entity

Updates the display layout dropdown with layouts available for the selected entity and role combination.

◆ altitudeSpinboxValueInMeters()

virtual int makVre::DtChooseRolePanel::altitudeSpinboxValueInMeters ( )
protectedvirtual

Converts the altitude spinbox value to meters.

Returns
Altitude value in meters

Uses VR-Vantage's display units manager to convert the altitude spinbox's value from the current display units to meters for internal calculations.

◆ showOptimizingVRPerformanceDialog()

void makVre::DtChooseRolePanel::showOptimizingVRPerformanceDialog ( )
protected

Shows the VR performance optimization dialog.

Displays a dialog offering performance tips for VR display configurations. Called when the user clicks on the "Engage" button and the selected display configuration is a VR configuration. The user can optionally choose to never show the dialog again, in which case it will be suppressed in future sessions.

◆ on_displayUnitChanged()

virtual void makVre::DtChooseRolePanel::on_displayUnitChanged ( )
protectedvirtual

Updates the altitude box's unit suffix.

Changes the altitude spinbox's suffix to match the current display units. Called when the display unit settings change in the application.

◆ setViewMode()

virtual void makVre::DtChooseRolePanel::setViewMode ( ViewModes mode = ViewMode_3D)
protectedvirtual

Sets the current view mode.

Parameters
modeView mode to set (default: 3D view)
Returns
True if the view mode was changed successfully, false otherwise

Changes the current view mode between map view (2D) and 3D view. Updates UI elements and observer settings accordingly, including camera position, orientation, projection type, and control sensitivity. The map view is useful for precise placement and spatial awareness, while the 3D view provides better depth perception and visual context.

References ViewMode_3D.

Member Data Documentation

◆ myMainWindow

QMainWindow* makVre::DtChooseRolePanel::myMainWindow
protected

Pointer to the main application window.

References the main application window, used for determining panel placement, accessing application-wide resources, and coordinating UI interactions. This is typically the parent widget for the panel.

◆ myEntityTreeContextMenu

QMenu* makVre::DtChooseRolePanel::myEntityTreeContextMenu
protected

Context menu for the entity list.

Context menu displayed when right-clicking on items in the entity list. Contains actions related to the selected entity, such as copying its ID or type information.

◆ myCreateTreeContextMenu

QMenu* makVre::DtChooseRolePanel::myCreateTreeContextMenu
protected

Context menu for the create entity list.

Context menu displayed when right-clicking on items in the create entity list. Contains actions related to the selected entity type, such as copying type information or accessing additional entity creation options.

◆ myCopyEntityIdAction

QAction* makVre::DtChooseRolePanel::myCopyEntityIdAction
protected

Action for copying entity IDs.

Menu action for copying the selected entity's unique identifier to the clipboard. Useful for developers and testers who need to reference specific entities.

◆ myCopyEntityTypeAction

QAction* makVre::DtChooseRolePanel::myCopyEntityTypeAction
protected

Action for copying entity types.

Menu action for copying the selected entity's type string to the clipboard. Useful for developers and scenario designers working with entity definitions.

◆ myCopyCreateTypeAction

QAction* makVre::DtChooseRolePanel::myCopyCreateTypeAction
protected

Action for copying entity types from the creation list.

Menu action for copying the selected entity type from the create entity list to the clipboard. Useful for referencing available entity types during scenario development or testing.

◆ myEventProcessor

DtCreateNewEntityEventProcessor* makVre::DtChooseRolePanel::myEventProcessor
protected

Event processor for creating new entities.

Handles mouse clicks and other events for entity creation, such as determining placement location and orientations based on user input.

◆ mySignals

makVrv::DtSignalConnectionManager makVre::DtChooseRolePanel::mySignals
protected

Manager for signal connections.

Manages connections to Qt signals and slots, ensuring proper cleanup when the panel is destroyed or connections need to be broken.

◆ myApp

DtPlayerStationApp& makVre::DtChooseRolePanel::myApp
protected

Reference to the player station application.

Provides access to application-level functionality and state, such as entity creation, player station management, and state transitions.

◆ myDe

makVrv::DtDe& makVre::DtChooseRolePanel::myDe
protected

Reference to the display engine.

Provides access to the 3D scene, rendering capabilities, and scene manipulation, used for visualization and entity placement during role selection.

◆ myWantedSpectator

bool makVre::DtChooseRolePanel::myWantedSpectator
protected

Flag indicating whether spectator mode was requested.

When true, indicates that the user has requested to enter spectator mode, which allows observation without directly controlling an entity.

◆ myDidInitialViewAll

bool makVre::DtChooseRolePanel::myDidInitialViewAll
protected

Flag indicating whether an initial view of all entities was performed.

When true, indicates that the panel has already performed an initial camera adjustment to show all entities when first opened.

◆ myLastEntityCount

int makVre::DtChooseRolePanel::myLastEntityCount
protected

Last known count of entities in the scene.

Stores the number of entities present in the scene during the last update. Used to detect changes in entity count for triggering UI updates.

◆ mySceneClickTimer

double makVre::DtChooseRolePanel::mySceneClickTimer
protected

Timer for tracking scene clicks.

Tracks time since the last scene click, used for debouncing rapid clicks and preventing accidental double selections.

◆ myEntityStateUpdateIndex

int makVre::DtChooseRolePanel::myEntityStateUpdateIndex
protected

Index for cycling through entity updates.

Current index in the entity list for progressive updates. Used to distribute update processing across multiple frames for better performance.

◆ myEntityStateLastUpdateTime

double makVre::DtChooseRolePanel::myEntityStateLastUpdateTime
protected

Time of the last entity state update.

Stores the time when the last entity state update was performed, used to control the frequency of state updates based on the update interval.

◆ myEntityStateUpdateTime

double makVre::DtChooseRolePanel::myEntityStateUpdateTime
protected

Interval between entity state updates.

Number of seconds between entity state update cycles. Controls how frequently the panel refreshes entity information from the simulation.

◆ mySelectedEntityType

DtEntityType makVre::DtChooseRolePanel::mySelectedEntityType
protected

Currently selected entity type.

Stores the entity type that is currently selected in the create entity list. Used for populating role options and other type-specific UI elements.

◆ myDisplayListNeedsUpdate

bool makVre::DtChooseRolePanel::myDisplayListNeedsUpdate
protected

Flag indicating that the display list needs updating.

When true, the UI needs to refresh the display layouts list based on changes to entity selection, role selection, or other factors.

◆ myPreviousRoleSettings

std::map<std::string, std::string> makVre::DtChooseRolePanel::myPreviousRoleSettings
protected

Cache of role settings by entity type.

Stores display layouts for when switching entity selections or disengaging, allowing the UI to remember previous selections. Maps entity type names to previously selected roles for those types.

◆ myOptimizingVRPerformanceDialog

DtOptimizingVRPerformanceDialog* makVre::DtChooseRolePanel::myOptimizingVRPerformanceDialog
protected

Dialog for VR performance optimization tips.

Shows performance optimization tips when controlling an entity in a VR display configuration. This dialog appears the first time a user selects a VR display layout, with an option to suppress future appearances.

◆ myConnections

makVrv::DtSignalConnectionManager makVre::DtChooseRolePanel::myConnections
protected

Additional manager for signal connections.

Manages a separate set of signal connections, primarily used for temporary connections that need different lifecycle management than the primary signal connections.


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