VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vrlinkCommandInteractionTranslator.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2024 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
11 #include <vl/interaction.h>
12 
14 
15 namespace makVrf
16 {
25  {
26  public:
27 
28  using EventPtr = std::unique_ptr<makVrfEvents::DtEvent>;
29  using EventList = std::vector<EventPtr>;
30 
34  using ConverterFcn = std::function<EventList(const DtInteraction*, DtCommunicationManager* commMgr)>;
35 
38 
40  virtual ~DtVrlinkCommandInteractionTranslator() override;
41 
43  virtual void init(DtVrlinkNetworkInterface*) override;
44 
48  template <typename InteractionType>
49  void addConversionFunction(ConverterFcn fcn);
50 
52  template <typename InteractionType>
53  void removeConversionFunction();
54 
56  virtual void registerDefaultConversions();
57 
59  virtual void clearConversionFunctions();
60 
62  virtual DtVrlinkNetworkInterface* networkInterface();
63 
64 #if DtHLA
65  virtual EventList defaultNetnEtrMoveToLocationConverter(const DtInteraction* inter,
69  DtCommunicationManager* commMgr);
70 
74  virtual EventList defaultNetnEtrMagicMoveConverter(const DtInteraction* inter,
75  DtCommunicationManager* commMgr);
76 
80  virtual EventList defaultNetnEtrMagicResourceConverter(const DtInteraction* inter,
81  DtCommunicationManager* commMgr);
82 
86  virtual EventList defaultNetnEtrFireAtEntityConverter(const DtInteraction* inter,
87  DtCommunicationManager* commMgr);
88 
92  virtual EventList defaultNetnEtrFireAtLocationConverter(const DtInteraction* inter,
93  DtCommunicationManager* commMgr);
94 
98  virtual EventList defaultNetnEtrMountConverter(const DtInteraction* inter,
99  DtCommunicationManager* commMgr);
100 
104  virtual EventList defaultNetnEtrDismountConverter(const DtInteraction* inter,
105  DtCommunicationManager* commMgr);
106 
110  virtual EventList defaultNetnEtrSetOrderedSpeedConverter(const DtInteraction* inter,
111  DtCommunicationManager* commMgr);
112 
116  virtual EventList defaultNetnEtrSetOrderedAltitudeConverter(const DtInteraction* inter,
117  DtCommunicationManager* commMgr);
118 
122  virtual EventList defaultNetnEtrSetRulesOfEngagementConverter(const DtInteraction* inter,
123  DtCommunicationManager* commMgr);
124 #endif
125 
126  protected:
127 
130  virtual bool processEvent(const makVrfEvents::DtEvent&) override { return true; };
131 
132  protected:
133 
135  {
136  protected:
138  : myFcn(fcn), myTranslator(converter) {};
139 
141  {
142  myFcn = fcn;
143  myTranslator = converter;
144  }
145 
148  };
149 
150  template <typename InteractionType>
152  {
153  public:
154 
156 
158 
159  protected:
160 
161  void registerCallback();
162 
163  void unregisterCallback();
164 
165  static void processInteractionCallback(InteractionType* inter, void* converter);
166 
167  void processInteraction(InteractionType* inter);
168  };
169 
170  using ConverterPtr = std::unique_ptr<InteractionConverterBase>;
171  using ConverterList = std::vector<ConverterPtr>;
173 
174  };
175 
176 }
177 
178 #include <vrlinkNetworkInterface/vrlinkCommandInteractionTranslator.inl>
Definition: event.h:13
The DtCommunicationManager class is a convenience class that will create both the DtNetworkInterfaceM...
Definition: communicationManager.h:54
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)