|
VR-Engage
2.2
|
Creates, updates, and destroys a new channel, "Minimap", to display a 2D map in the main window. The minimap can be configured with multiple view modes, ownship indicators, compass overlays, and can be toggled on and off. It also adjusts visibility when binoculars are in use.
#include <minimapUpdater.h>
Classes | |
| struct | ViewMode |
Public Member Functions | |
| DtMinimapUpdater () | |
| virtual | ~DtMinimapUpdater () 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 |
Public Member Functions inherited from makVre::DtOverlayComponent | |
| DtOverlayComponent () | |
| virtual | ~DtOverlayComponent () override |
| virtual makVrv::DtTextProxy * | findTextByName (const std::string &name) |
| virtual void | setTextVisible (const std::string &name, bool isVisible) |
| virtual void | setAllElementGroups (int group) |
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 | createOverlay () |
| virtual void | handleUsingBinocularsChanged (bool usingBinoculars) |
| virtual void | cycleMinimapMode () |
| virtual DtVreMessageResult | handleWindowCreated (DtVreMessage *msg) |
| virtual DtVreMessageResult | handleWindowDestroyed (DtVreMessage *msg) |
| virtual DtVreMessageResult | handleMinimapMessage (DtVreMessage *msg) |
| virtual void | slot_onWindowConfigurationChanged (const std::string &deName, const std::string &windowName, const makVrv::DtWindowConfiguration &windowConfig) |
| virtual void | createMinimap (const ViewMode &mode) |
| virtual void | modifyMinimap (const ViewMode &mode) |
| virtual void | destroyMinimap () |
| virtual void | registerHandlers () |
| virtual void | unregisterHandlers () |
| virtual void | addChannelEventProcessorAssociation () |
| virtual void | removeChannelEventProcessorAssociation () |
| virtual void | buildElements (DtInitTable &elements) override |
| virtual void | getViewModeScreenCoordinates (const ViewMode &mode, double &left, double &right, double &bottom, double &top) |
| virtual void | updateMinimapVisibility () |
| virtual void | showMinimap () |
| virtual void | hideMinimap () |
| virtual void | handleMapOverlayResized () |
| virtual void | setNodeMask (makVrv::DtCameraNode *node, unsigned int newMode, unsigned int currentExpected, bool setIfUnexpected=true) |
Protected Member Functions inherited from makVre::DtOverlayComponent | |
| virtual void | resolveTexts () |
| virtual std::string | getAttributeAsString (const std::string &attrName, const std::vector< std::string > &mappings) |
| virtual void | handleOverlayResized () |
| virtual void | destroyElements () |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
| makVre::DtMinimapUpdater::DtMinimapUpdater | ( | ) |
Constructor for DtMinimapUpdater.
Initializes component state with default values
|
overridevirtual |
Virtual destructor for DtMinimapUpdater.
|
overridevirtual |
Initializes the minimap updater component.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing minimap settings |
Processes configuration data and sets up the minimap channel based on the specified view modes. Configures position, size, frame properties, and ownship indicators.
Reimplemented from makVre::DtOverlayComponent.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Performs post-initialization tasks after all components are initialized.
Adds a callback to monitor changes to the binoculars state so the minimap can be hidden when binoculars are active
Reimplemented from makVre::DtOverlayComponent.
|
overridevirtual |
Called every frame to update the minimap.
| dt | Delta time since the last frame in seconds |
Updates the heading of the compass overlay to match the player's current heading when the minimap is displayed
Reimplemented from makVre::DtOverlayComponent.
|
overridevirtual |
Shuts down the minimap updater component.
Destroys the minimap channel, cleans up resources, and removes callbacks and message handlers. Restores the original icon scale setting.
Reimplemented from makVre::DtOverlayComponent.
|
overridevirtual |
Returns the type identifier for this component.
Reimplemented from makVre::DtOverlayComponent.
|
protectedvirtual |
Creates the overlay for displaying ownship indicators.
Sets up the VRV overlay that will contain the ownship dot and compass indicators on top of the minimap display
|
protectedvirtual |
Handles changes to the usingBinoculars attribute.
| usingBinoculars | New value of the usingBinoculars attribute |
Shows or hides the minimap when the binoculars state changes, hiding the minimap when binoculars are in use
|
protectedvirtual |
Switches to the next minimap view mode.
Cycles through the view modes defined in the configuration, updating the minimap's position, size, and visibility
|
protectedvirtual |
Handles window creation messages.
| msg | The window created message |
Captures the minimap channel when it's created and sets up node masks and observer settings
|
protectedvirtual |
Handles window destruction messages.
| msg | The window destroyed message |
Clears references to the destroyed minimap channel
|
protectedvirtual |
Handles minimap-specific messages.
| msg | The minimap message (cycle or reset zoom) |
Processes messages to cycle minimap view modes or reset the zoom level
|
protectedvirtual |
Callback for window configuration change events.
| deName | Name of the distributed environment |
| windowName | Name of the window that changed |
| windowConfig | New window configuration |
Updates the minimap channel's viewport when the window is resized to maintain the correct position and proportions
|
protectedvirtual |
Creates the minimap channel using the specified view mode.
| mode | The view mode configuration to use for the minimap |
Creates a new minimap channel with the appropriate position and size
|
protectedvirtual |
Modifies an existing minimap channel using the specified view mode.
| mode | The view mode configuration to apply to the minimap |
Updates the position, size, and visibility of the minimap channel
|
protectedvirtual |
Destroys the minimap channel.
Removes the minimap channel from the window manager
|
protectedvirtual |
Registers message handlers for minimap-related messages.
Sets up handlers for window creation/destruction and minimap control messages
|
protectedvirtual |
Unregisters message handlers.
Removes all handlers for minimap-related messages
|
protectedvirtual |
Adds channel event processor association.
Associates the minimap channel with a target channel for event processing
|
protectedvirtual |
Removes channel event processor association.
Removes the association between the minimap channel and the target channel
|
overrideprotectedvirtual |
Builds frame elements around the minimap.
| elements | Configuration table containing element definitions |
Overrides the base class function to programmatically create a frame around the minimap based on the current view mode
Reimplemented from makVre::DtOverlayComponent.
|
protectedvirtual |
Calculates screen coordinates for a minimap view mode.
| mode | The view mode to calculate coordinates for |
| left | Output parameter for the left coordinate |
| right | Output parameter for the right coordinate |
| bottom | Output parameter for the bottom coordinate |
| top | Output parameter for the top coordinate |
Calculates the actual screen coordinates for the minimap based on the view mode settings. If square is true, the right coordinate is adjusted to maintain a square aspect ratio. If visible is false, coordinates are set to place the channel off-screen.
|
protectedvirtual |
Updates the minimap visibility based on current state.
Shows or hides the minimap only when the visibility state changes, avoiding redundant calls to showMinimap or hideMinimap
|
protectedvirtual |
Shows the minimap by enabling rendering.
Restores the node masks for the minimap cameras to make the minimap visible
|
protectedvirtual |
Hides the minimap by disabling rendering.
Sets the node masks for the minimap cameras to zero to hide the minimap
|
protectedvirtual |
Handles resizing of the map overlay.
Adjusts the position and size of the ownship indicators when the map overlay is resized
|
protectedvirtual |
Sets the node mask on a camera node.
| node | The camera node to modify |
| newMode | The new node mask to apply |
| currentExpected | The expected current node mask |
| setIfUnexpected | Whether to set the mask if the current value is unexpected |
Sets the node mask on the specified camera node, with validation to detect if the node mask has been changed by another component
|
protected |
Collection of available minimap view modes.
|
protected |
Index of the currently active view mode.
|
protected |
Initial map scale to restore on shutdown.
|
protected |
Color of the frame around the minimap.
|
protected |
Width of the frame around the minimap in pixels.
|
protected |
Name of the minimap channel.
|
protected |
Name of the window containing the minimap.
|
protected |
Name of the channel that will receive events from the minimap.
|
protected |
Flag indicating if the minimap is currently visible.
|
protected |
Flag indicating if the minimap is disabled.
|
protected |
Flag indicating if the minimap should be created at engagement.
|
protected |
Pointer to the OSG channel used for the minimap.
|
protected |
Width of the map in screen coordinates.
|
protected |
Height of the map in screen coordinates.
|
protected |
Reference height for sizing ownship indicators.
|
protected |
Filename of the texture for the ownship dot indicator.
|
protected |
Filename of the texture for the ownship compass indicator.
|
protected |
Size of the ownship dot indicator as a fraction of map height.
|
protected |
Size of the ownship compass indicator as a fraction of map height.
|
protected |
Color of the ownship dot indicator.
|
protected |
Overlay for displaying ownship indicators on the minimap.
|
protected |
Quad proxy for the ownship dot indicator.
|
protected |
Quad proxy for the ownship compass indicator.
|
protected |
Initial icon scale value to restore on shutdown.
|
protected |
Cached node mask for the scene camera.
|
protected |
Cached node mask for the RTT camera.
|
protected |
Cached node mask for the overlay camera.
|
protected |
Cached node mask for the normalized overlay camera.