18#include <vrvGraphics/DtGlFontManager.h>
38class DtOverlayRenderer;
120 virtual void tick(
double dt)
override;
131 virtual const char*
type()
const override;
148 inline float xPixel(
const float norm)
const;
153 inline float yPixel(
const float norm)
const;
158 inline float pixelW(
const float norm)
const;
163 inline float pixelH(
const float norm)
const;
172 double headingAngleTo(
const DtVector& geocentricObserverPosition,
const DtVector& geocentricTargetPosition);
219 const std::string& displayName,
const std::string& windowName,
const std::string& channelName);
242 virtual makVrv::DtOsgChannel*
findChannel(
const std::string& channelName =
"Channel 1");
248 virtual makVrv::DtOverlayRenderer*
createOverlay(makVrv::DtOsgChannel* channel, osg::Geode*& geodeOut);
258 std::map<const makVre::HudTextItem*, std::pair<makVre::HudTextItem*, makVrv::DtTextProxy*>>
myTextItemMap;
263 std::map<const makVre::HudImageItem*, std::pair<makVre::HudImageItem*, makVrv::DtQuadProxy*>>
myImageItemMap;
376 virtual void createQuads(makVrv::DtOverlayRenderer* overlay,
const std::vector<HudImageConfig>& configs) = 0;
401 unsigned int e,
makVre::DtInitTable& imageTable, std::string imageName,
bool loadDimensions =
true);
417 std::string colorQuadName,
bool loadDimensions =
true);
Provides attribute handling system for hierarchical data storage and manipulation.
Type-specific handle class for attributes.
Definition attributeHandle.h:181
Class for representing and manipulating RGBA colors.
Definition color.h:22
Entity resolution and mapping system.
Definition entityResolver.h:52
virtual void channelDestroyed(const std::string &displayName, const std::string &windowName, const std::string &channelName)
Handles channel destruction event.
std::vector< HudImageConfig > myImages
Definition hudUpdater.h:449
virtual void onStart()=0
Called when this HUD updater is started.
virtual makVre::DtVreMessageResult handleExitPlayerState(makVre::DtVreMessage *msg)
float myFontSize
Definition hudUpdater.h:457
virtual ~DtHudUpdater() override
Virtual destructor.
virtual makVre::DtVreMessageResult handleEnterPlayerState(makVre::DtVreMessage *msg)
int myLineHeight
Definition hudUpdater.h:460
virtual void stop()
Stops this HUD updater.
virtual void start()
Starts this HUD updater.
bool myShowOverlays
Definition hudUpdater.h:467
virtual makVrv::DtQuadProxy * createQuadWithColor(makVrv::DtOverlayRenderer *overlay, const HudColorQuadConfig &element)
Creates a colored quad in the overlay.
float pixelH(const float norm) const
Converts normalized height to pixel height.
virtual osg::Texture * createTexture(std::string path)
Creates a texture from an image file.
std::string myFontFilePath
Definition hudUpdater.h:459
std::map< const makVre::HudTextItem *, std::pair< makVre::HudTextItem *, makVrv::DtTextProxy * > > myTextItemMap
Map of text items to their proxies.
Definition hudUpdater.h:258
virtual bool postInitialize() override
Performs post-initialization setup.
std::vector< HudTextConfig > myTexts
Definition hudUpdater.h:451
virtual bool loadColorQuadConfig(unsigned int quadIndex, makVre::DtInitTable &colorQuadTable, std::string colorQuadName, bool loadDimensions=true)
Loads color quad configuration from an initialization table.
DtHudUpdater()
Constructor.
bool myActive
Flag indicating if this HUD updater is active.
Definition hudUpdater.h:266
bool myChannelsUpdated
Definition hudUpdater.h:465
virtual bool loadTextConfig(unsigned int t, makVre::DtInitTable &textTable, std::string textName)
Loads text configuration from an initialization table.
virtual const char * type() const override
Returns the component type identifier.
float yPixel(const float norm) const
Converts normalized y-coordinate to pixel y-coordinate.
virtual enum Layers overlayGroup()
virtual bool loadImageConfig(unsigned int e, makVre::DtInitTable &imageTable, std::string imageName, bool loadDimensions=true)
Loads image configuration from an initialization table.
virtual void updateHudElements(bool visible)=0
Updates HUD elements based on visibility.
makVrv::DtOverlayRenderer * myOverlayInterface
Definition hudUpdater.h:454
makVrv::DtOverlayRenderer * getOverlay() const
Gets the overlay renderer used by this HUD updater.
virtual makVrv::DtOsgChannel * findChannel(const std::string &channelName="Channel 1")
Finds a channel by name.
virtual void shutdown() override
Cleans up resources when the component is being shut down.
virtual bool loadValueColorPairsConfig(std::vector< HudValueColorPair > &valueColorPairsContainer, makVre::DtInitTable &hudTable, const std::string &valueColorPairsName)
Loads value-color pairs configuration from an initialization table.
double headingAngleTo(const DtVector &geocentricObserverPosition, const DtVector &geocentricTargetPosition)
Calculates heading angle between observer and target positions.
virtual void setupOverlays()
Sets up overlay renderers for HUD elements.
float xPixel(const float norm) const
Converts normalized x-coordinate to pixel x-coordinate.
virtual void onViewportChanged()
Handles viewport change events.
void addItem(makVre::HudItem *item)
Adds a HUD item to this updater.
makVrv::DtFontInterface * myFont
Definition hudUpdater.h:458
makVrv::DtTextProxy * createAndInitTextProxy(double normalizedX, double normalizedY, const std::string &defaultText)
virtual makVrv::DtQuadProxy * createQuad(makVrv::DtOverlayRenderer *overlay, const HudImageConfig &config)
Creates a textured quad in the overlay.
virtual void deleteAll()
Deletes all HUD elements.
virtual void createQuads(makVrv::DtOverlayRenderer *overlay, const std::vector< HudImageConfig > &configs)=0
Creates all quad elements needed by a derived class.
virtual bool loadValueColorPairConfig(HudValueColorPair &valueColorPair, makVre::DtInitTable &valueColorPairConfig)
virtual makVrv::DtOverlayRenderer * createOverlay(makVrv::DtOsgChannel *channel, osg::Geode *&geodeOut)
Creates an overlay renderer for the specified channel.
virtual void setupQuads()
Sets up quad elements for the HUD.
std::map< const makVre::HudImageItem *, std::pair< makVre::HudImageItem *, makVrv::DtQuadProxy * > > myImageItemMap
Map of image items to their proxies.
Definition hudUpdater.h:263
virtual void tick(double dt) override
Updates the HUD elements for the current frame.
void removeItem(makVre::HudItem *item)
Removes a HUD item from this updater.
DtAttributeHandleType< bool > myUsingVr
Handle to Attribute indicating if VR mode is currently enabled.
Definition hudUpdater.h:269
std::vector< HudColorQuadConfig > myColorQuads
Definition hudUpdater.h:450
virtual bool loadColorConfig(makVre::DtColor &colorInfo, makVre::DtInitTable &colorTable, std::string colorName)
Loads color configuration from an initialization table.
virtual bool initialize(makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
Initializes the HUD updater.
osg::Geode * myGeode
Definition hudUpdater.h:463
void slot_onChannelToBeDestroyed()
Handles channel destruction notification.
virtual void onDeleteAll()=0
Called when all HUD elements are being deleted.
float pixelW(const float norm) const
Converts normalized width to pixel width.
virtual void updateAll()
Updates all HUD elements.
Layers
Enumeration of display layers for HUD elements.
Definition hudUpdater.h:354
@ OVERLAY
Overlay layer (normal HUD elements)
Definition hudUpdater.h:359
@ UI
UI layer (user interface elements)
Definition hudUpdater.h:362
@ HIDDEN
Hidden layer (not visible)
Definition hudUpdater.h:356
virtual void onStop()=0
Called when this HUD updater is stopped.
makVrv::DtOsgChannel * myChannel
Definition hudUpdater.h:455
void slot_onChannelCreated()
Handles channel creation event.
Table-based access to Lua state for configuration data.
Definition initializer.h:38
Base class for all role components in VR-Engage.
Definition playerComponent.h:78
virtual DtPlayerStation & player()
Gets the player station.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Image-based HUD item.
Definition hudItem.h:260
Base class for all HUD (Heads-Up Display) items.
Definition hudItem.h:25
Text-based HUD item.
Definition hudItem.h:204
Provides color representation and manipulation functionality.
constexpr const char * fontSize
Definition hudUpdater.h:64
constexpr const char * fontPath
Definition hudUpdater.h:61
Defines export macros for the Human Frontend library.
#define HUMAN_DLL
Definition export.h:19
Definition hudUpdater.h:53
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
constexpr const char * DtHudUpdaterType
Type identifier constant for DtHudUpdater components.
Definition hudUpdater.h:89
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Definition appLauncherComponent.h:28
Definition DtSceneObjectMimicUpdater.h:31
Defines the DtPlayerComponent base class for VR-Engage role components.
Configuration structure for colored quad HUD elements.
Definition hudUpdater.h:309
float width
Normalized width of the quad (0.0 to 1.0)
Definition hudUpdater.h:323
float x
Normalized x-coordinate of the quad (0.0 to 1.0)
Definition hudUpdater.h:317
float height
Normalized height of the quad (0.0 to 1.0)
Definition hudUpdater.h:326
float y
Normalized y-coordinate of the quad (0.0 to 1.0)
Definition hudUpdater.h:320
HudColorQuadConfig()
Default constructor.
makVre::DtColor colorInfo
Color information for the quad.
Definition hudUpdater.h:314
Configuration structure for HUD image elements.
Definition hudUpdater.h:284
float width
Normalized width of the image (0.0 to 1.0)
Definition hudUpdater.h:301
float y
Normalized y-coordinate of the image (0.0 to 1.0)
Definition hudUpdater.h:298
float height
Normalized height of the image (0.0 to 1.0)
Definition hudUpdater.h:304
float x
Normalized x-coordinate of the image (0.0 to 1.0)
Definition hudUpdater.h:295
osg::ref_ptr< osg::Texture > texture
Texture for the image.
Definition hudUpdater.h:289
HudImageConfig()
Default constructor.
std::string filename
Filename of the image texture.
Definition hudUpdater.h:292
HudTextConfig()
Default constructor.
float x
Normalized x-coordinate of the text (0.0 to 1.0)
Definition hudUpdater.h:336
float y
Normalized y-coordinate of the text (0.0 to 1.0)
Definition hudUpdater.h:339
Structure for associating values with colors in HUD elements.
Definition hudUpdater.h:344
makVre::DtColor colorInfo
Color information associated with the value.
Definition hudUpdater.h:349
int value
Integer value.
Definition hudUpdater.h:346
Defines the base class for all VREngage messages.