VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
remoteEnvironmentController.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2021 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
13 #include <vlutil/vlString.h>
14 #include <vrfutil/rwUUID.h>
15 #include <matrix/vlVector.h>
17 #include <boost/signals2.hpp>
18 
19 #include <map>
20 
23 
24 namespace makVrf
25 {
26  class DtExternalCurrentFrameState;
27  class DtStateData;
28  class DtWeatherStateComponent;
29  class DtGlobalEnvironmentStateComponent;
30 }
31 
33 typedef DtRemoteEnvironmentController* (*DtRemoteEnvironmentControllerCreatorFcn)();
34 
44 
46 
50 {
51 public:
54 
57 
61  virtual void init(DtCommunicationManager* msgIf, DtVrfMessageInterface*, int sessionId);
62 
66  bool reflectingCurrentWeatherState();
67 
70  {
71  return myGlobalWeatherSR;
72  }
73 
75 
76  virtual void setAirTurbidity(double value, const DtUUID& weatherArea = DtUUID::nullUUID());
78  virtual double airTurbidity(const DtVector& geocentricLocation);
80 
82 
83  virtual void setAmbientAirTemperature(double value, const DtUUID& weatherArea = DtUUID::nullUUID());
85  virtual double ambientAirTemperature(const DtVector& geocentricLocation);
87 
89 
90  virtual void setPrecipitationIntensity(double value, const DtUUID& weatherArea = DtUUID::nullUUID());
92  virtual double precipitationIntensity(const DtVector& geocentricLocation);
94 
96 
97  virtual void setPrecipitationType(int, const DtUUID& weatherArea = DtUUID::nullUUID());
99  virtual int precipitationType(const DtVector& geocentricLocation);
101 
103 
104  virtual void setWindSpeed(double value, const DtUUID& weatherArea = DtUUID::nullUUID());
106  virtual double windSpeed(const DtVector& geocentricLocation);
108 
110 
111  virtual void setWindDirection(double value, const DtUUID& weatherArea = DtUUID::nullUUID());
113  virtual double windDirection(const DtVector& geocentricLocation);
115 
117 
118  virtual void setVisibility(double value, const DtUUID& weatherArea = DtUUID::nullUUID());
120  virtual double visibility(const DtVector& geocentricLocation);
122 
125 
126  virtual void setTimeOfDay(double secondsPastMidnight);
128  virtual double timeOfDay();
130 
133 
134  virtual void setDateAndTimeOfDay(double secondsPastUtc);
135  virtual void setDateAndTimeOfDay(int year, int month, int day, int hours, int minutes, int seconds);
136 
138  virtual double dateAndTimeOfDay();
139  virtual void dateAndTimeOfDay(int& year, int& month, int& day, int& hours, int& minutes, int& seconds);
141 
143  virtual void setUseDayNightIlluminationModel(bool value);
144 
146 
147  virtual void setTimeOfDayAdvancementSpeed(double speed);
149  virtual double timeOfDayAdvancementSpeed();
151 
153 
154  virtual void setLightningPresent(bool isPresent, const DtUUID& weatherArea = DtUUID::nullUUID());
155  virtual bool lightningPresent(const DtVector& geocentricLocation) const;
157 
159 
160  virtual void setUnderwaterVisibility(double underwaterVisibility, const DtUUID& weatherArea = DtUUID::nullUUID());
161  virtual double underwaterVisibility(const DtVector& geocentricLocation);
163 
165 
166  virtual void setSurfaceTransparency(double transparency, const DtUUID& weatherArea = DtUUID::nullUUID());
167  virtual double surfaceTransparency(const DtVector& geocentricLocation);
169 
171 
172  virtual void setWaterCurrentSpeed(double waterCurrentSpeed, const DtUUID& weatherArea = DtUUID::nullUUID());
173  virtual double waterCurrentSpeed(const DtVector& geocentricLocation);
175 
177 
178  virtual void setWaterCurrentDirection(double waterCurrentDirection, const DtUUID& weatherArea = DtUUID::nullUUID());
179  virtual double waterCurrentDirection(const DtVector& geocentricLocation);
181 
183 
184  virtual void setAmbientWaterTemperature(double waterTemperature, const DtUUID& weatherArea = DtUUID::nullUUID());
185  virtual double ambientWaterTemperature(const DtVector& geocentricLocation);
187 
189 
190  virtual void setTidalOffset(double tidalOffset, const DtUUID& weatherArea = DtUUID::nullUUID());
191  virtual double tidalOffset(const DtVector& geocentricLocation);
193 
196 
197  virtual void setTidalDirection(bool tidalDirection, const DtUUID& weatherArea = DtUUID::nullUUID());
198  virtual bool tidalDirection(const DtVector& geocentricLocation);
200 
202 
203  virtual void setSwellState(unsigned int state, const DtUUID& weatherArea = DtUUID::nullUUID());
204  virtual unsigned int swellState(const DtVector& geocentricLocation);
206 
208 
209  virtual void setSwellStateDirection(double direction, const DtUUID& weatherArea = DtUUID::nullUUID());
210  virtual double swellStateDirection(const DtVector& geocentricLocation);
212 
215  virtual void setSeaState(unsigned int douglasScale, const DtUUID& weatherArea = DtUUID::nullUUID());
216  virtual unsigned int seaState(const DtVector& geocentricLocation);
218 
221  virtual void setSeaStateDirection(double radiansFromNorth, const DtUUID& weatherArea = DtUUID::nullUUID());
222  virtual double seaStateDirection(const DtVector& geocentricLocation);
224 
227  virtual void setWindDrivenSeaStateEnabled(bool enabled, const DtUUID& weatherArea = DtUUID::nullUUID());
228  virtual bool windDrivenSeaStateEnabled(const DtVector& geocentricLocation);
230 
232 
233  virtual void setChoppiness(double choppiness, const DtUUID& weatherArea = DtUUID::nullUUID());
234  virtual double choppiness(const DtVector& geocentricLocation);
236 
238 
239  virtual void setSurgeDepth(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
240  virtual double surgeDepth(const DtVector& geocentricLocation);
242 
245  virtual void setFogColor(const DtVector&, const DtUUID& weatherArea = DtUUID::nullUUID());
246  virtual DtVector fogColor(const DtVector& geocentricLocation);
247 
248  virtual void setFogHeight(double, const DtUUID& weatherArea = DtUUID::nullUUID());
249  virtual double fogHeight(const DtVector& geocentricLocation);
251 
254  virtual void setSnowAccumulation(double, const DtUUID& weatherArea = DtUUID::nullUUID());
255  virtual double snowAccumulation(const DtVector& geocentricLocation);
256 
257  virtual void setSnowMinimumAltitude(double, const DtUUID& weatherArea = DtUUID::nullUUID());
258  virtual double snowMinimumAltitude(const DtVector& geocentricLocation);
259 
260  virtual void setSnowRoadAccumulation(double, const DtUUID& weatherArea = DtUUID::nullUUID());
261  virtual double snowRoadAccumulation(const DtVector& geocentricLocation);
262 
264  virtual void setRainAccumulation(double, const DtUUID& weatherArea = DtUUID::nullUUID());
265  virtual double rainAccumulation(const DtVector& geocentricLocation);
266 
268 
271 
272  virtual void setThermoclineLayer1Depth(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
273  virtual double thermoclineLayer1Depth(const DtVector& geocentricLocation);
274  virtual void setThermoclineLayer1Permeability(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
275  virtual double thermoclineLayer1Permeability(const DtVector& geocentricLocation);
276  virtual void setThermoclineLayer2Depth(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
277  virtual double thermoclineLayer2Depth(const DtVector& geocentricLocation);
278  virtual void setThermoclineLayer2Permeability(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
279  virtual double thermoclineLayer2Permeability(const DtVector& geocentricLocation);
280  virtual void setThermoclineLayer3Depth(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
281  virtual double thermoclineLayer3Depth(const DtVector& geocentricLocation);
282  virtual void setThermoclineLayer3Permeability(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
283  virtual double thermoclineLayer3Permeability(const DtVector& geocentricLocation);
284  virtual void setThermoclineLayer4Depth(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
285  virtual double thermoclineLayer4Depth(const DtVector& geocentricLocation);
286  virtual void setThermoclineLayer4Permeability(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
287  virtual double thermoclineLayer4Permeability(const DtVector& geocentricLocation);
288  virtual void setThermoclineLayer5Depth(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
289  virtual double thermoclineLayer5Depth(const DtVector& geocentricLocation);
290  virtual void setThermoclineLayer5Permeability(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
291  virtual double thermoclineLayer5Permeability(const DtVector& geocentricLocation);
293 
295  virtual double dT() const;
296 
298 
299  virtual void addGlobalEnvironmentCreatedCallback(
301  virtual void removeGlobalEnvironmentCreatedCallback(
303  virtual void invokeGlobalWeatherCreatedCallbacks();
305 
306  static DtRemoteEnvironmentControllerCreatorFcn setRemoteEnvironmentControllerCreatorFcn(DtRemoteEnvironmentControllerCreatorFcn);
307  static DtRemoteEnvironmentController* createRemoteEnvironmentController();
308  static DtRemoteEnvironmentControllerCreatorFcn remoteEnvironmentControllerCreatorFcn();
309 
310 protected:
311 
313  virtual const makVrf::DtWeatherStateComponent* weatherObjectFor(const DtVector& geocentricLocation) const;
314 
316  virtual bool inside(const DtVector&, const std::vector<DtVector>&) const;
317 
318  virtual void processEnvironmentProcessAdded(makVrf::DtStateData*);
319  virtual void processEnvironmentProcessRemoved(const makVrf::DtStateData*);
320 
321  virtual void updateGlobalEnvironment();
322 
323 protected:
326 
327  typedef std::map<DtUUID, const makVrf::DtExternalCurrentFrameState*> WeatherObjects;
329 
333 
336 
339  boost::signals2::scoped_connection myEnvironmentalAddedConnection;
340  boost::signals2::scoped_connection myEnvironmentalRemovedConnection;
341  boost::signals2::scoped_connection myGlobalEnvironmentUpdatedCallback;
342 };
const makVrf::DtExternalCurrentFrameState * globalEnvironment() const
The current global environment.
Definition: remoteEnvironmentController.h:69
UUID is a unique ID wrapper class.
Definition: rwUUID.h:229
static DtRemoteEnvironmentControllerCreatorFcn theRemoteEnvironmentControllerCreatorFcn
Definition: remoteEnvironmentController.h:338
#define DT_DLL_vrfcontrol
This file is used to determine how to build.
Definition: vrfcontrolDefines.h:28
boost::signals2::scoped_connection myEnvironmentalAddedConnection
Definition: remoteEnvironmentController.h:339
boost::signals2::scoped_connection myEnvironmentalRemovedConnection
Definition: remoteEnvironmentController.h:340
Contains the DtUUID class declaration.
double myLastTimeReceived
Definition: remoteEnvironmentController.h:334
DtCommunicationManager * myCommunicationManager
Definition: remoteEnvironmentController.h:324
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: weatherStateComponent.h:21
DT_DLL_vrfutil bool inside(const DtVector &localPoint, const DtLocalVertexList &localVertexList, const Coordinate_System &coordinateSystem)
Returns true if localPoint is inside localVertexList in 2D. Always returns false if localVertexList i...
DtGlobalWeatherCreatedCallbackList myGlobalEnvironmentCreated
Definition: remoteEnvironmentController.h:337
static const DtUUID & nullUUID()
boost::signals2::scoped_connection myGlobalEnvironmentUpdatedCallback
Definition: remoteEnvironmentController.h:341
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:336
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: globalEnvironmentStateComponent.h:69
DtCallbackList< const makVrf::DtExternalCurrentFrameState * > DtGlobalWeatherCreatedCallbackList
DtRemoteEnvironmentController allows the user to interrogate the back-end which is simulating the env...
Definition: remoteEnvironmentController.h:45
The DtCommunicationManager class is a convenience class that will create both the DtNetworkInterfaceM...
Definition: communicationManager.h:50
DtRemoteEnvironmentController *(* DtRemoteEnvironmentControllerCreatorFcn)()
Definition: remoteEnvironmentController.h:33
Definition: stateData.h:260
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
DtVrfMessageInterface * myMessageInterface
Definition: remoteEnvironmentController.h:325
const makVrf::DtGlobalEnvironmentStateComponent * myGlobalEnvironmentStateComponent
Definition: remoteEnvironmentController.h:331
void(* DtCallbackFunctionType)(const makVrf::DtExternalCurrentFrameState *, void *)
The function signature of the callback function.
Definition: noArgumentCallbackList.h:95
DtRemoteEnvironmentController; remotely controls and reflects the weather state of VR-Forces...
Definition: remoteEnvironmentController.h:49
WeatherObjects myWeatherObjects
Definition: remoteEnvironmentController.h:328
std::map< DtUUID, const makVrf::DtExternalCurrentFrameState * > WeatherObjects
Definition: remoteEnvironmentController.h:327
const makVrf::DtExternalCurrentFrameState * myGlobalWeatherSR
Definition: remoteEnvironmentController.h:330
DtUUID myGlobalWeatherUUID
Definition: remoteEnvironmentController.h:332
int mySessionId
Definition: remoteEnvironmentController.h:335
Definition: vrfMessageInterface.h:40

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)