VR-Forces 4.8 Class Documentation
 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) 2019 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  user_start = 500
101  };
102  };
103 
107  struct Parts
108  {
109  enum Id
110  {
111  rudder = 1024,
112  left_flap = 1056,
113  right_flap = 1088,
114  left_aileron = 1120,
115  right_aileron = 1152,
116  helicopter_main_rotor = 1184,
117  helicopter_tail_rotor = 1216,
118  other_aircraft_control_surfaces_defined_as_needed = 1248,
119  periscope = 2048,
120  generic_antenna = 2080,
121  snorkel = 2112,
122  other_extendible_parts_defined_as_needed = 2144,
123  landing_gear = 3072,
124  tail_hook = 3104,
125  speed_brake = 3136,
126  left_weapon_bay_door = 3168,
127  right_weapon_bay_doors = 3200,
128  tank_or_apc_hatch = 3232,
129  wingsweep = 3264,
130  bridge_launcher = 3296,
131  bridge_section_1 = 3328,
132  bridge_section_2 = 3360,
133  bridge_section_3 = 3392,
134  primary_blade_1 = 3424,
135  primary_blade_2 = 3456,
136  primary_boom = 3488,
137  primary_launcher_arm = 3520,
138  other_fixed_position_parts_defined_as_needed = 3552,
139  primary_turret_number_1 = 4096,
140  primary_turret_number_2 = 4128,
141  primary_turret_number_3 = 4160,
142  primary_turret_number_4 = 4192,
143  primary_turret_number_5 = 4224,
144  primary_turret_number_6 = 4256,
145  primary_turret_number_7 = 4288,
146  primary_turret_number_8 = 4320,
147  primary_turret_number_9 = 4352,
148  primary_turret_number_10 = 4384,
149  primary_gun_number_1 = 4416,
150  primary_gun_number_2 = 4448,
151  primary_gun_number_3 = 4480,
152  primary_gun_number_4 = 4512,
153  primary_gun_number_5 = 4544,
154  primary_gun_number_6 = 4576,
155  primary_gun_number_7 = 4608,
156  primary_gun_number_8 = 4640,
157  primary_gun_number_9 = 4672,
158  primary_gun_number_10 = 4704,
159  primary_launcher_1 = 4736,
160  primary_launcher_2 = 4768,
161  primary_launcher_3 = 4800,
162  primary_launcher_4 = 4832,
163  primary_launcher_5 = 4864,
164  primary_launcher_6 = 4896,
165  primary_launcher_7 = 4928,
166  primary_launcher_8 = 4960,
167  primary_launcher_9 = 4992,
168  primary_launcher_10 = 5024,
169  primary_defense_systems_13 = 5056,
170  primary_defense_systems_2 = 5088,
171  primary_defense_systems_3 = 5120,
172  primary_defense_systems_4 = 5152,
173  primary_defense_systems_5 = 5184,
174  primary_defense_systems_6 = 5216,
175  primary_defense_systems_7 = 5248,
176  primary_defense_systems_8 = 5280,
177  primary_defense_systems_9 = 5312,
178  primary_defense_systems_10 = 5344,
179  primary_radar_14 = 5376,
180  primary_radar_2 = 5408,
181  primary_radar_3 = 5440,
182  primary_radar_4 = 5472,
183  primary_radar_5 = 5504,
184  primary_radar_6 = 5536,
185  primary_radar_7 = 5568,
186  primary_radar_8 = 5600,
187  primary_radar_9 = 5632,
188  primary_radar_10 = 5664,
189  secondary_turret_number_1 = 5696,
190  secondary_turret_number_2 = 5728,
191  secondary_turret_number_3 = 5760,
192  secondary_turret_number_4 = 5792,
193  secondary_turret_number_5 = 5824,
194  secondary_turret_number_6 = 5856,
195  secondary_turret_number_7 = 5888,
196  secondary_turret_number_8 = 5920,
197  secondary_turret_number_9 = 5952,
198  secondary_turret_number_10 = 5984,
199  secondary_gun_number_1 = 6016,
200  secondary_gun_number_2 = 6048,
201  secondary_gun_number_3 = 6080,
202  secondary_gun_number_4 = 6112,
203  secondary_gun_number_5 = 6144,
204  secondary_gun_number_6 = 6176,
205  secondary_gun_number_7 = 6208,
206  secondary_gun_number_8 = 6240,
207  secondary_gun_number_9 = 6272,
208  secondary_gun_number_10 = 6304,
209  secondary_launcher_1 = 6336,
210  secondary_launcher_2 = 6368,
211  secondary_launcher_3 = 6400,
212  secondary_launcher_4 = 6432,
213  secondary_launcher_5 = 6464,
214  secondary_launcher_6 = 6496,
215  secondary_launcher_7 = 6528,
216  secondary_launcher_8 = 6560,
217  secondary_launcher_9 = 6592,
218  secondary_launcher_10 = 6624,
219  secondary_defense_systems_1 = 6656,
220  secondary_defense_systems_2 = 6688,
221  secondary_defense_systems_3 = 6720,
222  secondary_defense_systems_4 = 6752,
223  secondary_defense_systems_5 = 6784,
224  secondary_defense_systems_6 = 6816,
225  secondary_defense_systems_7 = 6848,
226  secondary_defense_systems_8 = 6880,
227  secondary_defense_systems_9 = 6912,
228  secondary_defense_systems_10 = 6944,
229  secondary_radar_1 = 6976,
230  secondary_radar_2 = 7008,
231  secondary_radar_3 = 7040,
232  secondary_radar_4 = 7072,
233  secondary_radar_5 = 7104,
234  secondary_radar_6 = 7136,
235  secondary_radar_7 = 7168,
236  secondary_radar_8 = 7200,
237  secondary_radar_9 = 7232,
238  secondary_radar_10 = 7264,
239  deck_Elevator_1 = 7296,
240  deck_Elevator_2 = 7328,
241  catapult_1 = 7360,
242  catapult_2 = 7392,
243  jet_blast_deflector_1 = 7424,
244  jet_blast_deflector_2 = 7456,
245  arrestor_wires_1 = 7488,
246  arrestor_wires_2 = 7520,
247  arrestor_wires_3 = 7552,
248  wing__fold = 7584,
249  rotor_fold = 7584,
250  fuselage_fold = 7616,
251  wind_direction = 7872, // parts that rotate into the wind direction
252  wind_blades = 7904, // parts that rotate based on wind speed, like turbine blades
253  first_left_wheel = 9120, // wheels
254  first_right_wheel = 9152,
255  second_left_wheel = 9184,
256  second_right_wheel = 9216,
257  third_left_wheel = 9248,
258  third_right_wheel = 9280,
259  fourth_left_wheel = 9312,
260  fourth_right_wheel = 9344,
261  fifth_left_wheel = 9376,
262  fifth_right_wheel = 9408,
263  sixth_left_wheel = 9440,
264  sixth_right_wheel = 9472,
265  seventh_left_wheel = 9504,
266  seventh_right_wheel = 9536,
267  eighth_left_wheel = 9568,
268  eighth_right_wheel = 9600,
269  ninth_left_wheel = 9632,
270  ninth_right_wheel = 9664,
271  tenth_left_wheel = 9696,
272  tenth_right_wheel = 9728
273  };
274  };
275 
276 
278  static DtModelSemanticsMapper& instance(DtDe&);
279 
281  virtual DtModelSemanticsMapper* clone();
282 
284  static void copyInstance( DtBaseConnection& con, DtDe& de);
285 
287  static DtModelSemanticsMapper& instance( DtBaseConnection& con );
288 
289  virtual ~DtModelSemanticsMapper();
290 
297  const std::string* findStateName(States::Id id) const;
298 
306  const States::Id* findStateId(const std::string& name) const;
307 
314  const std::string* findPartName(Parts::Id id) const;
315 
323  const Parts::Id* findPartId(const std::string& name) const;
324 
326  void addState(const std::string& name, States::Id id);
327 
329  void removeState(const std::string& name);
330 
332  void addPart(const std::string& name, Parts::Id id);
333 
335  void removePart( const std::string& name);
336 
337  protected:
338 
342  virtual std::string cleanUpName(const std::string&) const;
343 
345 
347  virtual void initialize();
348 
349  typedef std::map<std::string,States::Id> StateNameToIdMap;
350  typedef std::map<States::Id,std::string> StateIdToNameMap;
351 
352  typedef std::map<std::string,Parts::Id> PartNameToIdMap;
353  typedef std::map<Parts::Id,std::string> PartIdToNameMap;
354 
357 
360  };
361 
365  {
366  public:
367 
369  static void registerInstance(DtDe& de,DtModelSemanticsMapperCreator*);
370 
371 
374  static DtModelSemanticsMapperCreator& instance(DtDe& de);
375 
378 
381 
383  virtual DtModelSemanticsMapper* create();
384 
385  };
386 
387 }
388 
389 #endif
390 
Id
Definition: DtModelSemanticsMapper.h:109
Virtual base class.
Definition: DtVirtualBaseClass.h:22
std::map< std::string, States::Id > StateNameToIdMap
Definition: DtModelSemanticsMapper.h:349
std::map< Parts::Id, std::string > PartIdToNameMap
Definition: DtModelSemanticsMapper.h:353
Default mapper creator, registered by the DtDe.
Definition: DtModelSemanticsMapper.h:364
PartIdToNameMap myPartIdsToNames
Definition: DtModelSemanticsMapper.h:359
std::map< States::Id, std::string > StateIdToNameMap
Definition: DtModelSemanticsMapper.h:350
The DtBaseConnection is an abstract class.
Definition: DtBaseConnection.h:37
PartNameToIdMap myPartNamesToIds
Definition: DtModelSemanticsMapper.h:358
Contains makVrv::DtVirtualBaseClass class.
This struct is used like a namespace.
Definition: DtModelSemanticsMapper.h:36
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
StateNameToIdMap myStateNamesToIds
Definition: DtModelSemanticsMapper.h:355
This struct is used like a namespace.
Definition: DtModelSemanticsMapper.h:107
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
StateIdToNameMap myStateIdsToNames
Definition: DtModelSemanticsMapper.h:356
Id
Definition: DtModelSemanticsMapper.h:40
std::map< std::string, Parts::Id > PartNameToIdMap
Definition: DtModelSemanticsMapper.h:352
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 Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)