VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
dataTypes.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  ******************************************************************************/
5 
6 #pragma once
7 
8 #include <map>
9 #include <string>
10 #include <vector>
11 #include <array>
12 #include <functional>
13 #include <memory>
14 #include <json/json.h>
15 #include <vlpi/entityIdentifier.h>
16 #include <vlpi/entityType.h>
17 
18 namespace DtDatasource
19 {
20 
21 // ============================================================================
22 // VRF-Agnostic Data Types
23 // ============================================================================
24 
27 {
28  int siteId = 0;
29  int applicationId = 0;
30  int entityNumber = 0;
31 
32  std::string toString() const
33  {
34  return std::to_string(siteId) + ":" + std::to_string(applicationId) + ":" + std::to_string(entityNumber);
35  }
36 
37  bool operator==(const DtEntityIdentifier& other) const
38  {
39  return siteId == other.siteId && applicationId == other.applicationId && entityNumber == other.entityNumber;
40  }
41 };
42 
47 {
48  DtEntityType resourceType;
49  double currentAmount = 0.0;
50  double fullAmount = 0.0;
51  std::string displayName;
52 };
53 
58 {
59  // Identity
60  std::string uuid; // Unique identifier (UUID string)
61  std::string objectType; // WebLVC object type (e.g., "PhysicalEntity")
63  DtEntityType entityType;
64  std::string marking; // Callsign/name
65  std::string label; // Secondary display label (distinct from marking)
66  int forceIdentifier = 0; // DIS force ID
67 
68  // IFF (Not everything is necessary for now)
69  int iffMode1Code = 0;
70  int iffMode2Code = 0;
71  int iffMode3ACode = 0;
72  int iffMode3CCode = 0;
73 
74  // Spatial state
75  std::array<double, 3> location = {0.0, 0.0, 0.0}; // [lat_deg, lon_deg, alt_m] WGS-84
76  double heading = 0.0; // Facing direction, degrees clockwise from North [0, 360)
77  double speed = 0.0; // Total 3D speed in m/s
78  double movementDirection = 0.0; // Direction of travel, degrees clockwise from North [0, 360)
79  double groundSpeed = 0.0; // Horizontal speed in m/s
80  double climbRate = 0.0; // Vertical velocity in m/s (positive = ascending)
81 
82  // Appearance
83  int damageState = 0;
84  bool isConcealed = false;
85  bool isSmoking = false;
86  bool isFlaming = false;
87  bool isPowerPlantOn = true;
88  bool isActive = true;
91 
92  // Capabilities
93  bool hasAmmunitionSupply = false;
94  bool hasFuelSupply = false;
95  bool hasRecoveryCapability = false;
96  bool hasRepairCapability = false;
97 
98  // Tasking
99  bool commandEnabled = true;
100  std::vector<std::string> availableCommands; // CommandType identifiers available for this entity
101 
105  Json::Value currentTasks{Json::arrayValue};
106 
107  // Resources
108  std::vector<DtResourceEntry> resources;
109 
110  // Embarkation
111  std::string embarkedOn;
112 
113  // Symbology
114  std::string sidc; // MIL-STD-2525 SIDC
115 
116  // Timestamp
117  double lastUpdateTime = 0.0;
118 };
119 
120 
125 {
126  // Identity
127  std::string uuid; // Unique identifier (UUID string)
128  DtEntityType entityType; // 7-element type; Kind 16=Point, 17=Linear, 18=Area
129 
130  // Geometry — flat list of ECEF positions; serializer converts to geodetic
131  std::vector<DtVector> coordinates;
132 
133  // Extrusion — only non-zero for extruded (volumetric) tactical graphics
134  double floor = 0.0;
135  double ceiling = 0.0;
136  double width = 0.0;
137 
138  // Attributes
139  int forceIdentifier = 0; // DIS force ID (0=Other, 1=Friendly, 2=Opposing, 3=Neutral)
140  std::string color; // #RRGGBB or color name
141  bool active = true;
142  std::string marking; // Human-readable label
143  std::string label; // Secondary display label (distinct from marking)
144  std::string overlay; // Overlay/layer identifier
145  std::string sidc; // MIL-STD-2525 SIDC
146 
147  // Activation — only present when activation times are enabled
148  bool useActivationTimes = false;
149  int activationMode = 0;
150  double activationTime = 0.0;
151  double deactivationTime = 0.0;
152 
153  // Embarkation
154  std::string embarkedOn;
155 
156  // Tasking
157  bool editEnabled = true;
158  std::vector<std::string> availableCommands;
159 
160  // Additional labels — arbitrary key/value pairs from ObjectLabel* extended data
161  std::map<std::string, std::string> additionalLabels;
162 
163  // Timestamp
164  double lastUpdateTime = 0.0;
165 };
166 
172 {
173  // Identity
174  std::string uuid;
175  std::string objectType;
177  DtEntityType entityType;
178  std::string marking;
179  std::string label;
180  int forceIdentifier = 0;
181  std::string overlay;
182 
183  // Aggregate state
184  int aggregateState = 1;
185 
186  // Spatial state
187  std::array<double, 3> location = {0.0, 0.0, 0.0};
188  double heading = 0.0;
189  double speed = 0.0;
190  double movementDirection = 0.0;
191 
192  // Appearance
193  int damageState = 0;
194  double health = -1;
195  double baseHealth = -1;
196 
197  // Subordinate entities
198  std::vector<std::string> subordinates;
199 
200  // Tasking
201  bool commandEnabled = true;
202  std::vector<std::string> availableCommands;
203 
207  Json::Value currentTasks{Json::arrayValue};
208 
209  // Resources
210  std::vector<DtResourceEntry> resources;
211 
212  // Symbology
213  std::string sidc;
214 
215  // Embarkation
216  std::string embarkedOn;
217 
218  // Timestamp
219  double lastUpdateTime = 0.0;
220 };
221 
222 
228 {
229  // Identity
230  std::string uuid;
231  std::string contactUUID;
232 
233  // Timing
234  double originalTimeOfContact = 0.0;
235  double lastTimeOfContact = 0.0;
236 
237  // Spatial state
238  std::array<double, 3> location = {0.0, 0.0, 0.0};
239  double heading = 0.0;
240  double speed = 0.0;
241  double climbRate = 0.0;
242 
243  // Contact characterisation
244  DtEntityType entityType;
245  int force = 0;
246  int cidLevel = 0;
247  int appearance = 0;
248  std::string marking;
249  std::string sidc;
250 
251  // Observers
252  std::vector<std::string> observedBy;
253 };
254 
255 
258 {
259  bool success = false;
260  std::string message;
261  std::string commandId;
262 };
263 
266 {
267  bool connected = false;
268  int numSimEngines = 0;
269  bool scenarioRunning = false;
270  double simulationTime = 0.0;
271  int entityCount = 0;
272  std::string scenarioName;
273  std::string dataSourceType; // e.g., "vrf"
274 };
275 
276 } // namespace DtDatasource
DtContactReportSnapshot - Complete state of a contact report at a point in time. Contact reports repr...
Definition: dataTypes.h:227
std::string uuid
Spot-report UUID (stable for the lifetime of the report)
Definition: dataTypes.h:230
std::string overlay
Definition: dataTypes.h:144
DtTacticalGraphicSnapshot - Complete state of a tactical graphic at a point in time. Represents waypoints, routes, boundaries, areas, and other tactical overlays.
Definition: dataTypes.h:124
std::string color
Definition: dataTypes.h:140
int iffMode1Code
Definition: dataTypes.h:69
bool firepowerKilledState
Definition: dataTypes.h:90
std::string objectType
Always &quot;AggregateEntity&quot;.
Definition: dataTypes.h:175
std::vector< std::string > availableCommands
CommandType identifiers available for this tactical graphic.
Definition: dataTypes.h:158
std::string commandId
Definition: dataTypes.h:261
int numSimEngines
Definition: dataTypes.h:268
double heading
Facing direction, degrees clockwise from North [0, 360)
Definition: dataTypes.h:188
bool active
Definition: dataTypes.h:141
DtDataSourceStatus - Status of the VRF connection.
Definition: dataTypes.h:265
DtEntityType entityType
Definition: dataTypes.h:128
bool hasAmmunitionSupply
Definition: dataTypes.h:93
::DtEntityIdentifier entityId
Definition: dataTypes.h:62
std::vector< DtResourceEntry > resources
Consumable resources; populated only when the server is subscribed for resource updates.
Definition: dataTypes.h:210
std::string sidc
MIL-STD-2525 Symbol ID Code.
Definition: dataTypes.h:249
std::string uuid
Unique identifier (UUID string)
Definition: dataTypes.h:174
int iffMode3CCode
Definition: dataTypes.h:72
bool commandEnabled
True if the session&#39;s role allows commanding this aggregate.
Definition: dataTypes.h:201
double health
Aggregate Health, real value if it exists, otherwise -1.
Definition: dataTypes.h:194
double speed
Approximate aggregate speed in m/s.
Definition: dataTypes.h:189
std::array< double, 3 > location
[lat_deg, lon_deg, alt_m] WGS-84
Definition: dataTypes.h:238
double width
Physical crosstrack width in metres; 0.0 means not set.
Definition: dataTypes.h:136
int entityNumber
Definition: dataTypes.h:30
int appearance
Perceived DIS appearance bits (from &quot;PerceivedAppearance&quot; dictionary entry)
Definition: dataTypes.h:247
double heading
Compass bearing, degrees clockwise from North [0, 360)
Definition: dataTypes.h:239
bool isPowerPlantOn
Definition: dataTypes.h:87
int force
Perceived DIS force (0=Unknown, 1=Friendly, 2=Opposing, 3=Neutral)
Definition: dataTypes.h:245
std::vector< std::string > availableCommands
Definition: dataTypes.h:100
double movementDirection
Direction of travel, degrees clockwise from North [0, 360)
Definition: dataTypes.h:190
std::string sidc
Definition: dataTypes.h:145
std::string objectType
Definition: dataTypes.h:61
std::string displayName
Human-readable name from the SISO enumeration dictionary; empty if lookup fails.
Definition: dataTypes.h:51
double climbRate
Definition: dataTypes.h:80
DtEntitySnapshot - Complete state of an entity at a point in time. VRF-agnostic intermediate represen...
Definition: dataTypes.h:57
std::string uuid
Definition: dataTypes.h:127
double deactivationTime
Activation stop time; 0.0 means no stop time.
Definition: dataTypes.h:151
int aggregateState
0=Other, 1=Aggregated, 2=Disaggregated
Definition: dataTypes.h:184
int forceIdentifier
DIS force ID.
Definition: dataTypes.h:180
std::string overlay
Overlay/layer identifier (optional)
Definition: dataTypes.h:181
DtCommandResult- Result of a command execution.
Definition: dataTypes.h:257
int siteId
Definition: dataTypes.h:28
bool hasFuelSupply
Definition: dataTypes.h:94
std::string scenarioName
Definition: dataTypes.h:272
int damageState
Definition: dataTypes.h:193
double currentAmount
Quantity currently available.
Definition: dataTypes.h:49
std::map< std::string, std::string > additionalLabels
Definition: dataTypes.h:161
double activationTime
Activation start time (interpretation per activationMode)
Definition: dataTypes.h:150
std::array< double, 3 > location
Definition: dataTypes.h:75
bool mobilityKilledState
Definition: dataTypes.h:89
double movementDirection
Definition: dataTypes.h:78
bool isConcealed
Definition: dataTypes.h:84
std::vector< std::string > subordinates
UUIDs of member entities.
Definition: dataTypes.h:198
bool useActivationTimes
True when ActivationTime/DeactivationTime are meaningful.
Definition: dataTypes.h:148
std::vector< DtVector > coordinates
Definition: dataTypes.h:131
int damageState
Definition: dataTypes.h:83
double ceiling
Maximum altitude (m MSL) of the extruded volume.
Definition: dataTypes.h:135
std::string toString() const
Definition: dataTypes.h:32
std::string dataSourceType
Definition: dataTypes.h:273
IMGUI_API void Value(const char *prefix, bool b)
double lastUpdateTime
Definition: dataTypes.h:164
double speed
Definition: dataTypes.h:77
double lastUpdateTime
Definition: dataTypes.h:219
std::string embarkedOn
UUID of the host entity this tactical graphic is embarked on, empty if not embarked.
Definition: dataTypes.h:154
DtEntityType entityType
Perceived entity type (from &quot;PerceivedType&quot; dictionary entry)
Definition: dataTypes.h:244
std::string label
Definition: dataTypes.h:143
std::string label
Definition: dataTypes.h:65
int applicationId
Definition: dataTypes.h:29
double heading
Definition: dataTypes.h:76
std::string sidc
Definition: dataTypes.h:114
DtEntityType entityType
Definition: dataTypes.h:177
bool operator==(const DtEntityIdentifier &other) const
Definition: dataTypes.h:37
double climbRate
Vertical velocity in m/s (positive = ascending)
Definition: dataTypes.h:241
double floor
Minimum altitude (m MSL) of the extruded volume.
Definition: dataTypes.h:134
double speed
Total 3D speed in m/s (magnitude of ECEF velocity)
Definition: dataTypes.h:240
std::string embarkedOn
UUID of the host entity this object is embarked on, empty if not embarked.
Definition: dataTypes.h:111
double groundSpeed
Definition: dataTypes.h:79
std::vector< DtResourceEntry > resources
Consumable resources; populated only when the server is subscribed for resource updates.
Definition: dataTypes.h:108
bool connected
Definition: dataTypes.h:267
std::vector< std::string > observedBy
UUIDs of entities currently observing this contact.
Definition: dataTypes.h:252
std::string sidc
MIL-STD-2525 SIDC.
Definition: dataTypes.h:213
bool isFlaming
Definition: dataTypes.h:86
DtResourceEntry — a single consumable resource (ammunition, fuel, etc.) carried by a simulation objec...
Definition: dataTypes.h:46
std::array< double, 3 > location
[lat_deg, lon_deg, alt_m] WGS-84
Definition: dataTypes.h:187
std::string label
Secondary display label (distinct from marking)
Definition: dataTypes.h:179
std::string contactUUID
UUID of the observed simulation object; empty when unknown.
Definition: dataTypes.h:231
std::string message
Definition: dataTypes.h:260
Json::Value currentTasks
Current tasks running on this entity, as a JSON array of {&quot;CommandType&quot;: &quot;...&quot;, &quot;Parameters&quot;: {...
Definition: dataTypes.h:105
DtEntityType resourceType
Resource identity (DIS entity-type enumeration)
Definition: dataTypes.h:48
double originalTimeOfContact
Seconds since Unix epoch; from &quot;OriginalTimeOfContact&quot; dictionary entry (time contact was first obser...
Definition: dataTypes.h:234
std::string marking
Definition: dataTypes.h:142
std::string marking
Definition: dataTypes.h:64
std::string marking
Human-readable label.
Definition: dataTypes.h:248
bool commandEnabled
True if the session&#39;s role allows commanding this entity.
Definition: dataTypes.h:99
std::string uuid
Definition: dataTypes.h:60
int cidLevel
Combat Identification Level (DtCIDLevelType): 0=NoDetection, 1=Detected, 2=Classified, 3=Identified, 4=FullKnowledge.
Definition: dataTypes.h:246
std::string embarkedOn
UUID of the host entity this aggregate is embarked on, empty if not embarked.
Definition: dataTypes.h:216
DtAggregateSnapshot- Complete state of an aggregate entity at a point in time. VRF-agnostic intermedi...
Definition: dataTypes.h:171
int forceIdentifier
Definition: dataTypes.h:139
int activationMode
0=SimTime, 1=TimeOfDay, 2=DateTime, 3=MonthDayTime
Definition: dataTypes.h:149
double lastTimeOfContact
Seconds since Unix epoch; from DtSpotReportStateComponentData::dateTimeOfReport() ...
Definition: dataTypes.h:235
double fullAmount
Capacity / full load.
Definition: dataTypes.h:50
bool hasRecoveryCapability
Definition: dataTypes.h:95
double lastUpdateTime
Definition: dataTypes.h:117
bool scenarioRunning
Definition: dataTypes.h:269
bool isSmoking
Definition: dataTypes.h:85
::DtEntityIdentifier entityId
Definition: dataTypes.h:176
double simulationTime
Definition: dataTypes.h:270
DtEntityIdentifier - DIS-style entity identifier.
Definition: dataTypes.h:26
double baseHealth
Aggregate Base Health, real value if it exists, otherwise -1.
Definition: dataTypes.h:195
int iffMode3ACode
Definition: dataTypes.h:71
bool isActive
Definition: dataTypes.h:88
Json::Value currentTasks
Current tasks running on this aggregate, as a JSON array of {&quot;CommandType&quot;: &quot;...&quot;, &quot;Parameters&quot;: {...}} objects. Pre-serialized here so SDK types do not leak into the data layer.
Definition: dataTypes.h:207
std::vector< std::string > availableCommands
Definition: dataTypes.h:202
std::string marking
Unit name / callsign.
Definition: dataTypes.h:178
bool success
Definition: dataTypes.h:259
int forceIdentifier
Definition: dataTypes.h:66
bool hasRepairCapability
Definition: dataTypes.h:96
bool editEnabled
True if the session&#39;s role allows editing this tactical graphic.
Definition: dataTypes.h:157
int iffMode2Code
Definition: dataTypes.h:70
int entityCount
Definition: dataTypes.h:271
DtEntityType entityType
Definition: dataTypes.h:63

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)