VR-Forces 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 DtTimeAndDateStateComponent;
29 }
30 
32 typedef DtRemoteEnvironmentController* (*DtRemoteEnvironmentControllerCreatorFcn)();
33 
43 
45 
49 {
50 public:
53 
56 
60  virtual void init(DtCommunicationManager* msgIf, DtVrfMessageInterface*, int sessionId);
61 
65  bool reflectingCurrentWeatherState();
66 
69  {
70  return myGlobalWeatherSR;
71  }
72 
74 
75  virtual void setAmbientAirTemperature(double value, const DtUUID& weatherArea = DtUUID::nullUUID());
77  virtual double ambientAirTemperature(const DtVector& geocentricLocation);
79 
81 
82  virtual void setPrecipitationIntensity(double value, const DtUUID& weatherArea = DtUUID::nullUUID());
84  virtual double precipitationIntensity(const DtVector& geocentricLocation);
86 
88 
89  virtual void setPrecipitationType(int, const DtUUID& weatherArea = DtUUID::nullUUID());
91  virtual int precipitationType(const DtVector& geocentricLocation);
93 
95 
96  virtual void setWindSpeed(double value, const DtUUID& weatherArea = DtUUID::nullUUID());
98  virtual double windSpeed(const DtVector& geocentricLocation);
100 
102 
103  virtual void setWindDirection(double value, const DtUUID& weatherArea = DtUUID::nullUUID());
105  virtual double windDirection(const DtVector& geocentricLocation);
107 
109 
110  virtual void setVisibility(double value, const DtUUID& weatherArea = DtUUID::nullUUID());
112  virtual double visibility(const DtVector& geocentricLocation);
114 
117 
118  virtual void setTimeOfDay(double secondsPastMidnight);
120  virtual double timeOfDay();
122 
125 
126  virtual void setDateAndTimeOfDay(double secondsPastUtc);
127  virtual void setDateAndTimeOfDay(int year, int month, int day, int hours, int minutes, int seconds);
128 
130  virtual double dateAndTimeOfDay();
131  virtual void dateAndTimeOfDay(int& year, int& month, int& day, int& hours, int& minutes, int& seconds);
133 
135  virtual void setUseDayNightIlluminationModel(bool value);
136 
138 
139  virtual void setTimeOfDayAdvancementSpeed(double speed);
141  virtual double timeOfDayAdvancementSpeed();
143 
145 
146  virtual void setLightningPresent(bool isPresent, const DtUUID& weatherArea = DtUUID::nullUUID());
147  virtual bool lightningPresent(const DtVector& geocentricLocation) const;
149 
151 
152  virtual void setUnderwaterVisibility(double underwaterVisibility, const DtUUID& weatherArea = DtUUID::nullUUID());
153  virtual double underwaterVisibility(const DtVector& geocentricLocation);
155 
157 
158  virtual void setSurfaceTransparency(double transparency, const DtUUID& weatherArea = DtUUID::nullUUID());
159  virtual double surfaceTransparency(const DtVector& geocentricLocation);
161 
163 
164  virtual void setWaterCurrentSpeed(double waterCurrentSpeed, const DtUUID& weatherArea = DtUUID::nullUUID());
165  virtual double waterCurrentSpeed(const DtVector& geocentricLocation);
167 
169 
170  virtual void setWaterCurrentDirection(double waterCurrentDirection, const DtUUID& weatherArea = DtUUID::nullUUID());
171  virtual double waterCurrentDirection(const DtVector& geocentricLocation);
173 
175 
176  virtual void setAmbientWaterTemperature(double waterTemperature, const DtUUID& weatherArea = DtUUID::nullUUID());
177  virtual double ambientWaterTemperature(const DtVector& geocentricLocation);
179 
181 
182  virtual void setTidalOffset(double tidalOffset, const DtUUID& weatherArea = DtUUID::nullUUID());
183  virtual double tidalOffset(const DtVector& geocentricLocation);
185 
187 
188  virtual void setSwellState(unsigned int state, const DtUUID& weatherArea = DtUUID::nullUUID());
189  virtual unsigned int swellState(const DtVector& geocentricLocation);
191 
193 
194  virtual void setSwellStateDirection(double direction, const DtUUID& weatherArea = DtUUID::nullUUID());
195  virtual double swellStateDirection(const DtVector& geocentricLocation);
197 
200  virtual void setSeaState(unsigned int douglasScale, const DtUUID& weatherArea = DtUUID::nullUUID());
201  virtual unsigned int seaState(const DtVector& geocentricLocation);
203 
206  virtual void setSeaStateDirection(double radiansFromNorth, const DtUUID& weatherArea = DtUUID::nullUUID());
207  virtual double seaStateDirection(const DtVector& geocentricLocation);
209 
212  virtual void setWindDrivenSeaStateEnabled(bool enabled, const DtUUID& weatherArea = DtUUID::nullUUID());
213  virtual bool windDrivenSeaStateEnabled(const DtVector& geocentricLocation);
215 
217 
218  virtual void setChoppiness(double choppiness, const DtUUID& weatherArea = DtUUID::nullUUID());
219  virtual double choppiness(const DtVector& geocentricLocation);
221 
223 
224  virtual void setSurgeDepth(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
225  virtual double surgeDepth(const DtVector& geocentricLocation);
227 
230  virtual void setFogColor(const DtVector&, const DtUUID& weatherArea = DtUUID::nullUUID());
231  virtual DtVector fogColor(const DtVector& geocentricLocation);
232 
233  virtual void setFogHeight(double, const DtUUID& weatherArea = DtUUID::nullUUID());
234  virtual double fogHeight(const DtVector& geocentricLocation);
236 
239  virtual void setSnowAccumulation(double, const DtUUID& weatherArea = DtUUID::nullUUID());
240  virtual double snowAccumulation(const DtVector& geocentricLocation);
241 
242  virtual void setSnowMinimumAltitude(double, const DtUUID& weatherArea = DtUUID::nullUUID());
243  virtual double snowMinimumAltitude(const DtVector& geocentricLocation);
244 
245  virtual void setSnowRoadAccumulation(double, const DtUUID& weatherArea = DtUUID::nullUUID());
246  virtual double snowRoadAccumulation(const DtVector& geocentricLocation);
247 
249  virtual void setRainAccumulation(double, const DtUUID& weatherArea = DtUUID::nullUUID());
250  virtual double rainAccumulation(const DtVector& geocentricLocation);
251 
253 
256 
257  virtual void setThermoclineLayer1Depth(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
258  virtual double thermoclineLayer1Depth(const DtVector& geocentricLocation);
259  virtual void setThermoclineLayer1Permeability(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
260  virtual double thermoclineLayer1Permeability(const DtVector& geocentricLocation);
261  virtual void setThermoclineLayer2Depth(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
262  virtual double thermoclineLayer2Depth(const DtVector& geocentricLocation);
263  virtual void setThermoclineLayer2Permeability(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
264  virtual double thermoclineLayer2Permeability(const DtVector& geocentricLocation);
265  virtual void setThermoclineLayer3Depth(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
266  virtual double thermoclineLayer3Depth(const DtVector& geocentricLocation);
267  virtual void setThermoclineLayer3Permeability(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
268  virtual double thermoclineLayer3Permeability(const DtVector& geocentricLocation);
269  virtual void setThermoclineLayer4Depth(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
270  virtual double thermoclineLayer4Depth(const DtVector& geocentricLocation);
271  virtual void setThermoclineLayer4Permeability(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
272  virtual double thermoclineLayer4Permeability(const DtVector& geocentricLocation);
273  virtual void setThermoclineLayer5Depth(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
274  virtual double thermoclineLayer5Depth(const DtVector& geocentricLocation);
275  virtual void setThermoclineLayer5Permeability(double depth, const DtUUID& weatherArea = DtUUID::nullUUID());
276  virtual double thermoclineLayer5Permeability(const DtVector& geocentricLocation);
278 
280  virtual double dT() const;
281 
283 
284  virtual void addGlobalEnvironmentCreatedCallback(
286  virtual void removeGlobalEnvironmentCreatedCallback(
288  virtual void invokeGlobalWeatherCreatedCallbacks();
290 
291  static DtRemoteEnvironmentControllerCreatorFcn setRemoteEnvironmentControllerCreatorFcn(DtRemoteEnvironmentControllerCreatorFcn);
292  static DtRemoteEnvironmentController* createRemoteEnvironmentController();
293  static DtRemoteEnvironmentControllerCreatorFcn remoteEnvironmentControllerCreatorFcn();
294 
295 protected:
296 
298  template<typename WeatherStateType>
299  const WeatherStateType* weatherStateFor(const DtVector& geocentricLocation) const;
300 
302  virtual bool inside(const DtVector&, const std::vector<DtVector>&) const;
303 
304  virtual void processEnvironmentProcessAdded(makVrf::DtStateData*);
305  virtual void processEnvironmentProcessRemoved(const makVrf::DtStateData*);
306 
307  virtual void updateGlobalEnvironment();
308 
309 protected:
312 
313  typedef std::map<DtUUID, const makVrf::DtExternalCurrentFrameState*> WeatherObjects;
315 
319 
322 
325  boost::signals2::scoped_connection myEnvironmentalAddedConnection;
326  boost::signals2::scoped_connection myEnvironmentalRemovedConnection;
327  boost::signals2::scoped_connection myGlobalEnvironmentUpdatedCallback;
328 };
const makVrf::DtExternalCurrentFrameState * globalEnvironment() const
The current global environment.
Definition: remoteEnvironmentController.h:68
UUID is a unique ID wrapper class.
Definition: uuid.h:59
static DtRemoteEnvironmentControllerCreatorFcn theRemoteEnvironmentControllerCreatorFcn
Definition: remoteEnvironmentController.h:324
#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:325
boost::signals2::scoped_connection myEnvironmentalRemovedConnection
Definition: remoteEnvironmentController.h:326
const makVrf::DtTimeAndDateStateComponent * myTimeAndDateStateComponent
Definition: remoteEnvironmentController.h:317
Contains the DtUUID class declaration.
double myLastTimeReceived
Definition: remoteEnvironmentController.h:320
DtCommunicationManager * myCommunicationManager
Definition: remoteEnvironmentController.h:310
DT_DLL_vrfutil bool inside(const DtVector &localPoint, const DtLocalVertexList &localVertexList, const Coordinate_System &coordinateSystem)
Determine if the given localPoint is inside the polygon defined by the given localVertexList.
DtGlobalWeatherCreatedCallbackList myGlobalEnvironmentCreated
Definition: remoteEnvironmentController.h:323
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: timeAndDateStateComponent.h:72
static const DtUUID & nullUUID()
boost::signals2::scoped_connection myGlobalEnvironmentUpdatedCallback
Definition: remoteEnvironmentController.h:327
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:339
DtCallbackList< const makVrf::DtExternalCurrentFrameState * > DtGlobalWeatherCreatedCallbackList
DtRemoteEnvironmentController allows the user to interrogate the back-end which is simulating the env...
Definition: remoteEnvironmentController.h:44
The DtCommunicationManager class is a convenience class that will create both the DtNetworkInterfaceM...
Definition: communicationManager.h:51
DtRemoteEnvironmentController *(* DtRemoteEnvironmentControllerCreatorFcn)()
Definition: remoteEnvironmentController.h:32
Definition: stateData.h:263
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
DtVrfMessageInterface * myMessageInterface
Definition: remoteEnvironmentController.h:311
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:48
WeatherObjects myWeatherObjects
Definition: remoteEnvironmentController.h:314
std::map< DtUUID, const makVrf::DtExternalCurrentFrameState * > WeatherObjects
Definition: remoteEnvironmentController.h:313
const makVrf::DtExternalCurrentFrameState * myGlobalWeatherSR
Definition: remoteEnvironmentController.h:316
DtUUID myGlobalWeatherUUID
Definition: remoteEnvironmentController.h:318
int mySessionId
Definition: remoteEnvironmentController.h:321
Definition: vrfMessageInterface.h:40

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)