11#include "vrvUtil/signalslib.h"
15#include <vrfutil/uuid.h>
16#include <matrix/vlVector.h>
25#include <unordered_set>
26#include <unordered_map>
57 :
entityId(DtEntityIdentifier::nullId())
76 map[it.key()] = it.value();
110 virtual const char*
type()
const override;
128 virtual void tick(
double dt)
override;
137 virtual void initdoc(QQuickItem* rootItem)
override;
162 makVrv::DtSceneObject* sceneObj,
163 DtVector& sceneObjPoint,
164 DtVector& worldPoint)
const;
177 double heightAboveEntity,
178 makVrv::DtSceneObject* sceneObj,
179 double baseScreenY)
const;
Provides attribute handling system for hierarchical data storage and manipulation.
Handle class for safe access to attributes.
Definition attributeHandle.h:30
Type-specific handle class for attributes.
Definition attributeHandle.h:229
double myAdditionalHeightAboveEntity
Base world-space height offset in meters applied above each entity.
Definition entityOverlayComponent.h:199
virtual void removeStaleTrackedEntities(const SensorContactsMap &contacts)
Removes tracked entities that are no longer present in the sensor contacts.
virtual ~DtEntityOverlayComponent() override
Destructor.
virtual const char * type() const override
Returns the component type identifier.
std::string mySensorName
Name of the sensor to read contacts from in the attribute store.
Definition entityOverlayComponent.h:202
virtual bool initialize(DtPlayerStation *player, DtInitTable &config) override
Initializes the component with player and configuration.
virtual void ensureEntityTracked(const DtUUID &uuid, const std::string &entityIdStr)
Ensures an entity is registered in the tracked entities cache.
virtual void getEntityTopWorldPosition(DtAttributeHandle &entityAttrRoot, makVrv::DtSceneObject *sceneObj, DtVector &sceneObjPoint, DtVector &worldPoint) const
Computes the world-space position of the top center of an entity's bounding volume.
virtual void onOverlayEnabledChanged(bool enabled)
Responds to runtime overlay visibility changes from the player attribute store.
virtual void populateEntityData(EntityOverlayInfo &info, DtAttributeHandle &entityRootAttr)
Populates overlay-specific data fields for a tracked entity.
DtAttributeHandleType< SensorContactsMap > mySensorContactsAttr
Sensor contacts used to discover entities that should receive overlays.
Definition entityOverlayComponent.h:187
virtual bool postInitialize() override
Performs post-initialization after all components are created.
virtual void shutdown() override
Cleanup when component is being destroyed.
virtual void initdoc(QQuickItem *rootItem) override
Called when QML root item is loaded.
std::unordered_set< std::string > myExternalEntityAttributes
Attribute paths to keep synchronized for tracked external entities.
Definition entityOverlayComponent.h:193
QObject * myQmlDataObject
Pointer to the QML data object for direct property updates.
Definition entityOverlayComponent.h:196
DtEntityOverlayComponent()
Constructor.
TrackedEntitiesMap myTrackedEntitesMap
Cached per-entity attribute handles for currently tracked contacts.
Definition entityOverlayComponent.h:190
virtual void tick(double dt) override
Per-frame update called by the player station.
virtual void updateEntityData()
Discovers and updates entity-specific data each frame (proof of concept)
virtual double computeScreenHeightOffset(const DtVector &sceneObjPoint, double heightAboveEntity, makVrv::DtSceneObject *sceneObj, double baseScreenY) const
Converts a world-space height offset above an entity into a screen-space pixel offset.
DtAttributeHandleType< bool > myOverlayEnabledAttr
Player attribute controlling whether entity overlays are visible.
Definition entityOverlayComponent.h:206
Table-based access to Lua state for configuration data.
Definition initializer.h:38
virtual DtPlayerStation & player()
Gets the player station.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
DtQtQuickOverlay()
Constructor for DtQtQuickOverlay.
constexpr auto DtEntityOverlayComponentType
Component type identifier for factory registration and role configuration.
Definition entityOverlayComponent.h:37
Defines export/import macros for the vreCommonComponents library.
#define VRECOMMONCOMPONENTS_DLL
DLL export/import macro for the vreCommonComponents library.
Definition export.h:28
!
Definition glsVreMessageUtil.h:50
std::unordered_map< DtUUID, std::vector< DtAttributeHandle > > TrackedEntitiesMap
Definition entityOverlayComponent.h:43
std::map< DtUUID, DtEntityType > SensorContactsMap
Definition entityOverlayComponent.h:42
Definition appLauncherComponent.h:28
Contains DtQtQuickOverlay class which provides a Qt Quick overlay component for rendering 2D UI over ...
Simple structure to track individual entity overlay information.
Definition entityOverlayComponent.h:47
double distance
Distance from camera to entity (meters)
Definition entityOverlayComponent.h:51
QVariantMap extraData
Additional per-entity fields consumed by specialized overlays.
Definition entityOverlayComponent.h:54
DtEntityIdentifier entityId
Entity being tracked.
Definition entityOverlayComponent.h:48
double screenY
Projected screen Y coordinate (pixels)
Definition entityOverlayComponent.h:50
QVariantMap toVariantMap() const
Convert to QVariantMap for QML consumption.
Definition entityOverlayComponent.h:66
EntityOverlayInfo()
Definition entityOverlayComponent.h:56
double screenX
Projected screen X coordinate (pixels)
Definition entityOverlayComponent.h:49
double additionalHeightAboveEntity
Vertical screen offset (pixels) applied to the overlay position.
Definition entityOverlayComponent.h:52