VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
cgfDispatcher.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 
13 
14 #include <vrfmsgs/messageTypes.h>
16 #include "vrfmsgs/ifLoadScenario.h"
17 #include "vrfmsgs/ifSaveScenario.h"
19 #include "vrfmsgs/ifControl.h"
22 #include "vrfcgf/cgf.h"
23 #include <vlutil/vlFilename.h>
25 #include <vl/startResumeInteraction.h>
26 #include <vl/stopFreezeInteraction.h>
27 
28 class DtIfControlMsg;
29 class DtTimer;
32 class DtEvent;
33 
37 #include "vrfcgf/vrfcgfDefines.h"
39 {
40 public:
48  DtVrfMessageInterface* messageIf,
49  int receivePort = 8000);
50 
51  virtual ~DtCgfDispatcher();
52 
54  virtual void closeScenario(DtIfCloseScenario* msg);
55  virtual void loadScenario(DtIfLoadScenario* msg);
56  virtual void reinitializeScenario();
57 
60  virtual void saveScenario(DtIfSaveScenario* msg,
61  const DtSimulationAddress& requester);
62 
65  virtual void saveSimulationObjectGroup(DtIfSaveSimulationObjectGroup* msg,
66  const DtSimulationAddress& requester);
67 
70  virtual void createSimulationObjectGroup(DtIfCreateSimulationObjectGroup* msg,
71  const DtSimulationAddress& requester);
72 
74  virtual void importScenarioDescriptionFile(DtIfImportScenarioDescriptionFile*);
75 
77  virtual void exportScenarioDescriptionFile(DtIfExportScenarioDescriptionFile*);
78 
84  virtual void controlScenario(DtIfControl* msgData,
85  const DtSimulationAddress& sender);
86 
87  virtual void setEnableResourceMonitor(bool b);
88 
90  virtual void tick();
91 
93  virtual void setTimeToQuit(bool yesNo);
94  virtual bool timeToQuit() const;
95 
97  virtual void clearSimulationObjects();
98 
100  virtual DtVrfMessageInterface* messageInterface() const;
101 
103  virtual DtCgf* cgf() const;
104 
106  virtual int port() const;
107 
109  virtual const DtFilename& tempDirectory();
110  virtual void setTempDirectory(const DtFilename& f);
111 
115  virtual void cleanupSockets();
116 
122  virtual unsigned int simMgmtPduProcessLevel() const;
123  virtual void setSimMgmtPduProcessLevel(unsigned int level);
124 
125  virtual void processCapableTaskAndSetQuery(DtSimMessage* msg);
126  virtual void processDIGuyAppearAndAnimationsQuery(DtSimMessage* msg);
127 
128 public:
129 
130  typedef struct dtSimRunDurationUsrData
131  {
133  DtSimulationAddress replyTo;
135 
138  static void processMessageCb(DtSimMessage* msg, void* usr);
139 
141  virtual void startResumeSimCb(const DtEvent&);
142 
144  virtual void stopFreezeSimCb(const DtEvent&);
145 
147  static void receiveFileCb(const DtFilename& f, void* usr);
148 
155  static void runDurationCompleteCallback(void* timer);
156  virtual void processRunDurationComplete(DtSimRunDurationUsrData*);
157 
158 protected:
162  virtual bool shouldTryReload(const DtScenario& scenario);
163 
167  virtual bool shouldTryReload(const DtIfImportScenarioDescriptionFile*);
168 
170  virtual void pause();
171 
173  virtual void run();
174 
176  virtual void rewind(int scenarioRunId = 0);
177 
180  virtual void step(const DtSimulationAddress& sender);
181 
191  virtual void runForDuration(double duration, const DtSimulationAddress& sender);
192 
193 protected:
194 
195  int myPort;
199  DtFilename myDir;
201 
208 
210 };
Definition: ifImportScenarioDescriptionFile.h:25
DtIfLoadScenario is a composite message containing all the elements needed to begin a simulation...
Definition: ifLoadScenario.h:21
Instances of DtTimer are used to maintain the information needed to represent some kind of scheduled ...
Definition: timer.h:45
Definition: scenario.h:52
DtFilename myDir
Definition: cgfDispatcher.h:199
Message sent to start the Export of a scenario file.
Definition: ifExportScenarioDescriptionFile.h:24
DtVrfMessageInterface * myMessageIf
Definition: cgfDispatcher.h:198
DT_DLL_VRVCORE DtTaitBryan level(const DtCoordinateSystem &cs, const DtVector &localOrigin, double topoHeading)
Returns a level orientation with the topographic heading.
This class handles messages from the front-end for loading and saving scenarios, and controlling the ...
Definition: cgfDispatcher.h:38
class DtIfSaveScenario:
Definition: ifSaveScenario.h:23
DtCgf * myCgf
Definition: cgfDispatcher.h:197
class DtIfSaveSimulationObjectGroup:
Definition: ifSaveSimulationObjectGroup.h:22
Definition: events.h:49
Definition: cgfDispatcher.h:130
File: DtIfCreateSimulationObjectGroup.h.
Definition: ifCreateSimulationObjectGroup.h:22
File: ifControl.h.
Definition: ifControl.h:32
File: simMsg.h.
Definition: simMessage.h:35
Definition: compressedFileTransporter.h:24
class DtIfCloseScenario:
Definition: ifCloseScenario.h:27
DtCgfDispatcher * cgfDispatcher
Definition: cgfDispatcher.h:132
DtIfLoadScenario * myPendingLoadScenario
This pointer is used to keep a scenario load message in queue for those times that a load scenario me...
Definition: cgfDispatcher.h:206
int myPort
Definition: cgfDispatcher.h:195
unsigned int mySimMgmtPduProcessLevel
Definition: cgfDispatcher.h:207
DtIfImportScenarioDescriptionFile * myPendingScenarioDescriptionImport
Definition: cgfDispatcher.h:209
An instance of DtCgf is an object representing a CGF (Computer Generated Forces). ...
Definition: cgf.h:115
#define DT_DLL_vrfcgf
This file is used to determine how to build.
Definition: vrfcgfDefines.h:25
DtSimulationAddress replyTo
Definition: cgfDispatcher.h:133
bool myTimeToQuit
Definition: cgfDispatcher.h:196
Definition: vrfMessageInterface.h:46
DtCompressedFileTransporter myTransporter
Definition: cgfDispatcher.h:200

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)