VR-Engage  2.3
Loading...
Searching...
No Matches
util.h
Go to the documentation of this file.
1/*********************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*********************************************************************************/
5
6//! \file util.h
7//! \brief Utility functions for VREngage player station connector
8//!
9//! This file provides utility functions to support the VREngage player station connector,
10//! including functions to create and populate simulation state messages from entity data.
11
12#pragma once
13
15
16#include "vreUtil/attribute.h"
17
18#include <vlpi/entityIdentifier.h>
19#include <vlpi/entityType.h>
20#include <vlutil/vlString.h>
21#include <vrfutil/rwUUID.h>
22#include <set>
23#include <string>
24#include <vector>
25
26//! \brief Forward declaration of the reflected entity class
27class DtReflectedEntity;
28class DtReflectedExtEntityList;
29
30namespace makVre
31{
32//! \brief Forward declaration of the simulation state message class
34
35//! \brief Structure containing information about a reflected extended entity
36//!
37//! Stores essential identification and type information about an entity in the
38//! simulation, allowing for efficient lookups and entity management
40{
41 //! \brief Entity identifier
42 DtEntityIdentifier myEntityId;
43
44 //! \brief Entity type information
45 DtEntityType myEntityType;
46
47 //! \brief Universally unique identifier for the entity
48 DtUUID myUUID;
49
50 //! \brief Marking text (name/label) for the entity
51 DtString myMarkingText;
52};
53
54//! \brief Structure containing entity control capabilities
55//!
56//! Manages the relationship between an entity and its associated roles and
57//! function groups, defining what capabilities are available for controlling the entity
59{
60 //! \brief Default constructor - initializes entity ID to null
61 ControlSet() { entityId = DtEntityIdentifier::nullId(); }
62
63 //! \brief Checks if the control set is valid
64 //! \return True if the entity ID is not null, false otherwise
65 bool valid() { return entityId != DtEntityIdentifier::nullId(); }
66
67 //! \brief Entity identifier
68 DtEntityIdentifier entityId;
69
70 //! \brief Set of function groups available for this entity
71 std::set<DtString> functionGroups;
72
73 //! \brief Vector of roles available for this entity
74 std::vector<std::string> roles;
75};
76
77//! \brief Creates and populates a simulation state message from an entity
78//! \param entity Pointer to the reflected entity to extract state information from
79//! \return Pointer to a newly created simulation state message containing the entity's state
80//!
81//! This function extracts position, orientation, and other state information from
82//! the provided entity and creates a SimulationStateMessage containing this data.
83//! The caller is responsible for managing the lifecycle of the returned message.
85
86VRL_DLL void updateReflectedEntityAttributes(DtReflectedExtEntityList* rel, DtAttributeHandle entityStateStore);
87
88} // namespace makVre
Provides attribute handling system for hierarchical data storage and manipulation.
Handle class for safe access to attributes.
Definition attributeHandle.h:30
State update for an entity.
Definition simulationState.h:38
Defines export macros and protocol namespace for vrePlayerStationConnector.
#define VRL_DLL
Empty definition for non-Windows platforms.
Definition export.h:52
!
Definition glsVreMessageUtil.h:50
VRL_DLL SimulationStateMessage * createAndFillSimStateMessage(DtReflectedEntity *entity)
Creates and populates a simulation state message from an entity.
VRL_DLL void updateReflectedEntityAttributes(DtReflectedExtEntityList *rel, DtAttributeHandle entityStateStore)
std::set< DtString > functionGroups
Set of function groups available for this entity.
Definition util.h:71
DtEntityIdentifier entityId
Entity identifier.
Definition util.h:68
ControlSet()
Default constructor - initializes entity ID to null.
Definition util.h:61
std::vector< std::string > roles
Vector of roles available for this entity.
Definition util.h:74
bool valid()
Checks if the control set is valid.
Definition util.h:65
Structure containing information about a reflected extended entity.
Definition util.h:40
DtUUID myUUID
Universally unique identifier for the entity.
Definition util.h:48
DtEntityIdentifier myEntityId
Entity identifier.
Definition util.h:42
DtString myMarkingText
Marking text (name/label) for the entity.
Definition util.h:51
DtEntityType myEntityType
Entity type information.
Definition util.h:45