VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtModelSemanticsMapper.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef DtModelSemanticsMapper_H_
11 #define DtModelSemanticsMapper_H_
12 
13 #include <vrvCore/vrvCore.h>
15 
16 #include <map>
17 #include <string>
18 
19 namespace makVrv
20 {
21  class DtDe;
22  class DtBaseConnection;
28  {
29  public:
30 
32 
36  struct States
37  {
38  //The default state ids, note using a string of the exact text of an enumeration
39  //is a valid name for the id.
40  enum Id
41  {
42  invalidId = 0,
43  mobility = 1,
44  fire_power = 2,
45  damage = 3,
46  trailing_effects = 4,
47  hatch = 5,
48  moving = 6,
49  paint_scheme = 7,
50  density = 8,
51  frozen_status = 9,
52  power_plant_status = 10,
53  launcher = 11,
54  camouflage_type = 12,
55  concealed = 13,
56  head_lights = 14,
57  tail_lights = 15,
58  brake_lights = 16,
59  blackout_lights = 17,
60  blackout_brake_lights = 18,
61  spot_lights = 19,
62  interior_lights = 20,
63  afterburner = 21,
64  landing_lights = 22,
65  navigation_lights = 23,
66  anticollision_lights = 24,
67  formation_lights = 25,
68  launch_flash = 26,
69  smoke = 27,
70  flaming = 28,
71  running_lights = 29,
72  lights = 30,
73  life_form_state = 31,
74  weapon_1 = 32,
75  weapon_2 = 33,
76  flashlight = 34,
77  compliance = 35,
78  health = 36,
79  masked_cloaked = 37,
80  internal_heat_status = 38,
81  exterior_lights = 39,
82  mission = 40,
83  antenna = 41,
84  tent = 42,
85  ramp = 43,
86  wind_effect = 50, // things that change state due to wind
87  light_color = 51, // switch for light color on buoys and beacons
88  daymark = 52, // switch for daymark sign on beacons
89  daymark_shape = 53, // switch for daymark sign shape on beacons
90  topmark = 54, // switch for topmarks on beacons or buoys
91  topmark_shape = 55, // switch for topmark shapes on beacons or buoys
92  label_char_count = 56, // switch for number of characters on a label,
93  // with characters determined by UV offset into an atlas
94  shadow_polygon = 57, // switch for shadow polygon underneath cars and other objects
95  segment_count = 58, // switch for number of characters on a taxiway sign,
96  // with characters determined by UV offset into an atlas
97  // switch for the color of the expendable
98  exp_color = 59,
99  exp_parachute = 60, // expendable parachute state
100  lower_anti_collision_lights = 61,
101  upper_anti_collision_lights = 62,
102  anti_collision_lights_day_night = 63,
103  is_blinking = 64,
104  landing_gear_extended = 65,
105  cargo_doors_opened = 66,
106  navigation_position_brightness = 67,
107  reverse_thrust_engaged = 68,
108  weight_on_wheels = 69,
109  occupants_surrendered = 70,
110  nvg_mode = 71,
111  cover_shroud = 72,
112  signal_smoke = 73,
113  signal_mirror = 74,
114  ir_strobe = 75,
115  ir_illuminator = 76,
116  mounted_status = 77,
117  concealed_movement = 78,
118  flare_smoke_status = 79,
119  spot_chaff_status = 80,
120  supply_deployed_status = 81,
121  left_indicator_light = 82,
122  right_indicator_light = 83,
123  emergency_lights = 84,
124  hdu_lights = 85,
125  anchor_lights = 86,
126  warning_safety_lights = 87,
127  distress_beacons_strobes = 88,
128  upper_deck_flood_lights = 89,
129  upper_deck_lights = 90,
130  wave_off_light = 91,
131  not_under_command_lights = 92,
132  ram_lights = 93, // restricted ability to maneuver
133  fishing_with_lines_lights = 94,
134  fishing_with_nets_lights = 95,
135  mine_hunting_lights = 96,
136  taxi_lights = 97,
137  user_start = 500
138  };
139  };
140 
144  struct Parts
145  {
146  enum Id
147  {
148  rudder = 1024, // 32 X 32
149  left_flap = 1056, // 33 X 32
150  right_flap = 1088, // 34 X 32
151  left_aileron = 1120, // etc. all art part numbers are multiples of 32
152  right_aileron = 1152,
153  helicopter_main_rotor = 1184,
154  helicopter_tail_rotor = 1216,
155  other_aircraft_control_surfaces_defined_as_needed = 1248,
156  propeller_number_1 = 1280,
157  propeller_number_2 = 1312,
158  propeller_number_3 = 1344,
159  propeller_number_4 = 1376,
160  left_stabilator_stabilator_number_1 = 1408,
161  right_stabilator_stabilator_number_2 = 1440,
162  left_ruddervator_ruddervator_number_1 = 1472,
163  right_ruddervator_ruddervator_number_2 = 1504,
164  left_leading_edge_flap_slat = 1536,
165  right_leading_edge_flap_slat = 1568,
166  left_elevator = 1600,
167  right_elevator = 1632,
168  canard_left = 1664,
169  canard_right = 1696,
170  elevon_inner_left = 1728,
171  elevon_inner_right = 1760,
172  elevon_middle_left = 1792,
173  elevon_middle_right = 1824,
174  elevon_outer_left = 1856,
175  elevon_outer_right = 1888,
176  canopy_aircraft = 1920,
177  periscope = 2048,
178  generic_antenna = 2080,
179  snorkel = 2112,
180  other_extendible_parts_defined_as_needed = 2144,
181  dive_plane_sail_left = 2176,
182  dive_plane_sail_right = 2208,
183  dive_plane_bow_left = 2240,
184  dive_plane_bow_right = 2272,
185  dive_plane_stern_left = 2304,
186  dive_plane_stern_right = 2336,
187  landing_gear = 3072,
188  tail_hook = 3104,
189  speed_brake = 3136,
190  left_weapon_bay_door = 3168,
191  right_weapon_bay_doors = 3200,
192  tank_or_apc_hatch = 3232,
193  wingsweep = 3264,
194  bridge_launcher = 3296,
195  bridge_section_1 = 3328,
196  bridge_section_2 = 3360,
197  bridge_section_3 = 3392,
198  primary_blade_1 = 3424,
199  primary_blade_2 = 3456,
200  primary_boom = 3488,
201  primary_launcher_arm = 3520,
202  Landing_Gear_Nose = 3584,
203  Landing_Gear_Left_Main = 3616,
204  Landing_Gear_Right_Main = 3648,
205  Doors_of_Left_Side_Weapon_Bay = 3680,
206  Doors_of_Right_Side_Weapon_Bay = 3712,
207  Spot_Search_Light_1 = 3744,
208  Spot_Search_Light_2 = 3776,
209  Spot_Search_Light_3 = 3808,
210  Spot_Search_Light_4 = 3840,
211  Landing_Light = 3872,
212  other_fixed_position_parts_defined_as_needed = 3552,
213  primary_turret_number_1 = 4096,
214  primary_turret_number_2 = 4128,
215  primary_turret_number_3 = 4160,
216  primary_turret_number_4 = 4192,
217  primary_turret_number_5 = 4224,
218  primary_turret_number_6 = 4256,
219  primary_turret_number_7 = 4288,
220  primary_turret_number_8 = 4320,
221  primary_turret_number_9 = 4352,
222  primary_turret_number_10 = 4384,
223  primary_gun_number_1 = 4416,
224  primary_gun_number_2 = 4448,
225  primary_gun_number_3 = 4480,
226  primary_gun_number_4 = 4512,
227  primary_gun_number_5 = 4544,
228  primary_gun_number_6 = 4576,
229  primary_gun_number_7 = 4608,
230  primary_gun_number_8 = 4640,
231  primary_gun_number_9 = 4672,
232  primary_gun_number_10 = 4704,
233  primary_launcher_1 = 4736,
234  primary_launcher_2 = 4768,
235  primary_launcher_3 = 4800,
236  primary_launcher_4 = 4832,
237  primary_launcher_5 = 4864,
238  primary_launcher_6 = 4896,
239  primary_launcher_7 = 4928,
240  primary_launcher_8 = 4960,
241  primary_launcher_9 = 4992,
242  primary_launcher_10 = 5024,
243  primary_defense_systems_1 = 5056,
244  primary_defense_systems_2 = 5088,
245  primary_defense_systems_3 = 5120,
246  primary_defense_systems_4 = 5152,
247  primary_defense_systems_5 = 5184,
248  primary_defense_systems_6 = 5216,
249  primary_defense_systems_7 = 5248,
250  primary_defense_systems_8 = 5280,
251  primary_defense_systems_9 = 5312,
252  primary_defense_systems_10 = 5344,
253  primary_radar_1 = 5376,
254  primary_radar_2 = 5408,
255  primary_radar_3 = 5440,
256  primary_radar_4 = 5472,
257  primary_radar_5 = 5504,
258  primary_radar_6 = 5536,
259  primary_radar_7 = 5568,
260  primary_radar_8 = 5600,
261  primary_radar_9 = 5632,
262  primary_radar_10 = 5664,
263  secondary_turret_number_1 = 5696,
264  secondary_turret_number_2 = 5728,
265  secondary_turret_number_3 = 5760,
266  secondary_turret_number_4 = 5792,
267  secondary_turret_number_5 = 5824,
268  secondary_turret_number_6 = 5856,
269  secondary_turret_number_7 = 5888,
270  secondary_turret_number_8 = 5920,
271  secondary_turret_number_9 = 5952,
272  secondary_turret_number_10 = 5984,
273  secondary_gun_number_1 = 6016,
274  secondary_gun_number_2 = 6048,
275  secondary_gun_number_3 = 6080,
276  secondary_gun_number_4 = 6112,
277  secondary_gun_number_5 = 6144,
278  secondary_gun_number_6 = 6176,
279  secondary_gun_number_7 = 6208,
280  secondary_gun_number_8 = 6240,
281  secondary_gun_number_9 = 6272,
282  secondary_gun_number_10 = 6304,
283  secondary_launcher_1 = 6336,
284  secondary_launcher_2 = 6368,
285  secondary_launcher_3 = 6400,
286  secondary_launcher_4 = 6432,
287  secondary_launcher_5 = 6464,
288  secondary_launcher_6 = 6496,
289  secondary_launcher_7 = 6528,
290  secondary_launcher_8 = 6560,
291  secondary_launcher_9 = 6592,
292  secondary_launcher_10 = 6624,
293  secondary_defense_systems_1 = 6656,
294  secondary_defense_systems_2 = 6688,
295  secondary_defense_systems_3 = 6720,
296  secondary_defense_systems_4 = 6752,
297  secondary_defense_systems_5 = 6784,
298  secondary_defense_systems_6 = 6816,
299  secondary_defense_systems_7 = 6848,
300  secondary_defense_systems_8 = 6880,
301  secondary_defense_systems_9 = 6912,
302  secondary_defense_systems_10 = 6944,
303  secondary_radar_1 = 6976,
304  secondary_radar_2 = 7008,
305  secondary_radar_3 = 7040,
306  secondary_radar_4 = 7072,
307  secondary_radar_5 = 7104,
308  secondary_radar_6 = 7136,
309  secondary_radar_7 = 7168,
310  secondary_radar_8 = 7200,
311  secondary_radar_9 = 7232,
312  secondary_radar_10 = 7264,
313  deck_Elevator_1 = 7296,
314  deck_Elevator_2 = 7328,
315  catapult_1 = 7360,
316  catapult_2 = 7392,
317  jet_blast_deflector_1 = 7424,
318  jet_blast_deflector_2 = 7456,
319  arrestor_wires_1 = 7488,
320  arrestor_wires_2 = 7520,
321  arrestor_wires_3 = 7552,
322  wing__fold = 7584,
323  rotor_fold = 7584,
324  fuselage_fold = 7616,
325  Main_Cargo_Door = 7648,
326  cargo_ramp = 7680,
327  air_to_air_refueling_boom = 7680,
328  primary_aerial_refueling_receptacle_door = 7680,
329  secondary_aerial_refueling_receptacle_door = 7776,
330  aerial_refueling_receptacle_latch = 7808,
331  cargo_door_1 = 7840,
332  cargo_door_2 = 7872,
333  cargo_door_3 = 7904,
334  cargo_door_4 = 7936,
335  cargo_door_5 = 7968,
336  cargo_door_6 = 8000,
337  cargo_door_7 = 8032,
338  cargo_door_8 = 8064,
339  cargo_door_9 = 8096,
340  cargo_door_10 = 8128,
341  centre_refuelling_drogue = 8160,
342  port_refuelling_drogue = 8192,
343  starboard_refuelling_drogue = 8224,
344  submarine_engine_exhaust_mast = 8256,
345  submarine_mast_1 = 8288,
346  submarine_mast_2 = 8320,
347  submarine_mast_3 = 8352,
348  submarine_mast_4 = 8384,
349  submarine_mast_5 = 8416,
350  submarine_mast_6 = 8448,
351  submarine_mast_7 = 8480,
352  submarine_mast_8 = 8512,
353  submarine_mast_9 = 8544,
354  submarine_mast_10 = 8576,
355  vectored_thrust_nozzle = 8608,
356  left_door_of_the_left_weapon_bay = 8640,
357  right_door_of_the_left_weapon_bay = 8672,
358  left_door_of_the_right_weapon_bay = 8704,
359  right_door_of_the_right_weapon_bay = 8736,
360  gun_door = 8768,
361  countermeasure_door_left = 8800,
362  countermeasure_door_right = 8832,
363  hook_door_forward = 8864,
364  hook_door_aft = 8896,
365  lift_fan_upper_door = 8928,
366  lift_fan_lower_door_left = 8960,
367  lift_fan_lower_door_right = 8992,
368  refuel_probe_door = 9024,
369  left_engine_nacelle = 9056,
370  right_engine_nacelle = 9088,
371  first_left_wheel = 9120, // wheels
372  first_right_wheel = 9152,
373  second_left_wheel = 9184,
374  second_right_wheel = 9216,
375  third_left_wheel = 9248,
376  third_right_wheel = 9280,
377  fourth_left_wheel = 9312,
378  fourth_right_wheel = 9344,
379  fifth_left_wheel = 9376,
380  fifth_right_wheel = 9408,
381  sixth_left_wheel = 9440,
382  sixth_right_wheel = 9472,
383  seventh_left_wheel = 9504,
384  seventh_right_wheel = 9536,
385  eighth_left_wheel = 9568,
386  eighth_right_wheel = 9600,
387  ninth_left_wheel = 9632,
388  ninth_right_wheel = 9664,
389  tenth_left_wheel = 9696,
390  tenth_right_wheel = 9728, // 304 X 32
391  refueling_probe = 9760,
392  steering_wheel = 9792,
393  gimabled_sensor_azimuth_1 = 15424, // match VRF parts
394  gimabled_sensor_azimuth_2 = 15456,
395  gimabled_sensor_azimuth_3 = 15488,
396  gimabled_sensor_azimuth_4 = 15520,
397  gimabled_sensor_azimuth_5 = 15552,
398  gimabled_sensor_azimuth_6 = 15584,
399  gimabled_sensor_azimuth_7 = 15616,
400  gimabled_sensor_azimuth_8 = 15648,
401  gimabled_sensor_azimuth_9 = 15680,
402  gimabled_sensor_azimuth_10 = 15712,
403  gimabled_sensor_elevation_1 = 15744, // match VRF parts
404  gimabled_sensor_elevation_2 = 15776,
405  gimabled_sensor_elevation_3 = 15808,
406  gimabled_sensor_elevation_4 = 15840,
407  gimabled_sensor_elevation_5 = 15872,
408  gimabled_sensor_elevation_6 = 15904,
409  gimabled_sensor_elevation_7 = 15936,
410  gimabled_sensor_elevation_8 = 15968,
411  gimabled_sensor_elevation_9 = 16000,
412  gimabled_sensor_elevation_10 = 16032,
413  //
414  // For MAK extensions, start at the opposite end and work backwards
415  // largest value in 32 bit field that is a multiple of 32 is 134,217,727? X 32 = 4,294,967,264?
416  // However, we don't really need *that* many, and since the risk of someone not using *unsigned*
417  // or *short* (or both) somewhere along the pipeline is real, lets used max signed short instead
418  //
419  wind_blades = 32736, // 1023 X 32 parts that rotate into the wind direction
420  wind_direction = 32704 // 1022 X 32 parts that rotate based on wind speed, like turbine blades
421  };
422  };
423 
424 
426  static DtModelSemanticsMapper& instance(DtDe&);
427 
429  virtual DtModelSemanticsMapper* clone();
430 
432  static void copyInstance( DtBaseConnection& con, DtDe& de);
433 
435  static DtModelSemanticsMapper& instance( DtBaseConnection& con );
436 
437  virtual ~DtModelSemanticsMapper();
438 
445  const std::string* findStateName(States::Id id) const;
446 
454  const States::Id* findStateId(const std::string& name) const;
455 
462  const std::string* findPartName(Parts::Id id) const;
463 
471  const Parts::Id* findPartId(const std::string& name) const;
472 
474  void addState(const std::string& name, States::Id id);
475 
477  void removeState(const std::string& name);
478 
480  void addPart(const std::string& name, Parts::Id id);
481 
483  void removePart( const std::string& name);
484 
485  protected:
486 
490  virtual std::string cleanUpName(const std::string&) const;
491 
493  virtual bool partNameIsNumber(const std::string& partName) const;
494 
496 
498  virtual void initialize();
499 
500  typedef std::map<std::string,States::Id> StateNameToIdMap;
501  typedef std::map<States::Id,std::string> StateIdToNameMap;
502 
503  typedef std::map<std::string,Parts::Id> PartNameToIdMap;
504  typedef std::map<Parts::Id,std::string> PartIdToNameMap;
505 
508 
511  };
512 
516  {
517  public:
518 
520  static void registerInstance(DtDe& de,DtModelSemanticsMapperCreator*);
521 
522 
525  static DtModelSemanticsMapperCreator& instance(DtDe& de);
526 
529 
532 
534  virtual DtModelSemanticsMapper* create();
535 
536  };
537 
538 }
539 
540 #endif
541 
Id
Definition: DtModelSemanticsMapper.h:146
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
std::map< std::string, States::Id > StateNameToIdMap
Definition: DtModelSemanticsMapper.h:500
std::map< Parts::Id, std::string > PartIdToNameMap
Definition: DtModelSemanticsMapper.h:504
Default mapper creator, registered by the DtDe.
Definition: DtModelSemanticsMapper.h:515
PartIdToNameMap myPartIdsToNames
Definition: DtModelSemanticsMapper.h:510
std::map< States::Id, std::string > StateIdToNameMap
Definition: DtModelSemanticsMapper.h:501
The DtBaseConnection is an abstract class.
Definition: DtBaseConnection.h:35
PartNameToIdMap myPartNamesToIds
Definition: DtModelSemanticsMapper.h:509
Contains makVrv::DtVirtualBaseClass class.
This struct is used like a namespace. To use an enumeration value simple type: DtModelSemanticsMapper...
Definition: DtModelSemanticsMapper.h:36
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
StateNameToIdMap myStateNamesToIds
Definition: DtModelSemanticsMapper.h:506
This struct is used like a namespace. To use an enumeration value simple type: DtModelSemanticsMapper...
Definition: DtModelSemanticsMapper.h:144
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:72
StateIdToNameMap myStateIdsToNames
Definition: DtModelSemanticsMapper.h:507
Id
Definition: DtModelSemanticsMapper.h:40
std::map< std::string, Parts::Id > PartNameToIdMap
Definition: DtModelSemanticsMapper.h:503
The DtModelSemanticsMapper object is responsible for mapping Names of model semantics declarations (f...
Definition: DtModelSemanticsMapper.h:27
Contains DLL export macros.

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)