VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
landSurfaceStateComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
12 #include <matrix/vlVector.h>
13 
14 
15 
16 
17 namespace makVrf
18 {
19 
23  {
25  : mySnowAccumulation(0.)
26  , myRainAccumulation(0.)
27  , myAmbientAirPressure(0.)
28  , myAmbientAirTemperature(0.)
29  , myAirPressureAltitude(0.)
30  , myAirTemperatureAltitude(0)
31  , mySnowMinimumAltitude(0.)
32  , mySnowRoadAccumulation(0)
33  , myBlowingParticulateMatter(0)
34  , mySeaLevelWaterConcentration(0.)
35  , myLightningPresent(false)
36  , myFogHeight(0.)
37  , myFogColor()
38  , myPriority(0)
39  , myPrecipitationIntensity(0.)
40  , myPrecipitationType(DtVrfWeatherPrecipitationNone)
41  {};
42 
44  {
45  *this = orig;
46  };
47 
49  {
50  myBlowingParticulateMatter = orig.myBlowingParticulateMatter;
51  mySnowAccumulation = orig.mySnowAccumulation;
52  myRainAccumulation = orig.myRainAccumulation;
53  myAmbientAirPressure = orig.myAmbientAirPressure;
54  myAmbientAirTemperature = orig.myAmbientAirTemperature;
55  myAirPressureAltitude = orig.myAirPressureAltitude;
56  myAirTemperatureAltitude = orig.myAirTemperatureAltitude;
57  mySnowMinimumAltitude = orig.mySnowMinimumAltitude;
58  mySnowRoadAccumulation = orig.mySnowRoadAccumulation;
59  mySeaLevelWaterConcentration = orig.mySeaLevelWaterConcentration;
60  myLightningPresent = orig.myLightningPresent;
61  myFogHeight = orig.myFogHeight;
62  myFogColor = orig.myFogColor;
63  myPriority = orig.myPriority;
64  myPrecipitationIntensity = orig.myPrecipitationIntensity;
65  myPrecipitationType = orig.myPrecipitationType;
66 
67  return *this;
68  };
69  ACCESSOR_MUTATOR_MEMBER(double, snowAccumulation, SnowAccumulation);
70  ACCESSOR_MUTATOR_MEMBER(double, rainAccumulation, RainAccumulation);
71  ACCESSOR_MUTATOR_MEMBER(double, ambientAirPressure, AmbientAirPressure);
72  ACCESSOR_MUTATOR_MEMBER(double, ambientAirTemperature, AmbientAirTemperature);
73  ACCESSOR_MUTATOR_MEMBER(double, airPressureAltitude, AirPressureAltitude);
74  ACCESSOR_MUTATOR_MEMBER(double, airTemperatureAltitude, AirTemperatureAltitude);
75  ACCESSOR_MUTATOR_MEMBER(double, snowMinimumAltitude, SnowMinimumAltitude);
76  ACCESSOR_MUTATOR_MEMBER(double, snowRoadAccumulation, SnowRoadAccumulation);
77  ACCESSOR_MUTATOR_MEMBER(double, seaLevelWaterConcentration, SeaLevelWaterConcentration);
78  ACCESSOR_MUTATOR_MEMBER(bool, lightningPresent, LightningPresent);
79  ACCESSOR_MUTATOR_MEMBER(double, fogHeight, FogHeight);
80  ACCESSOR_MUTATOR_MEMBER(DtVector, fogColor, FogColor);
81  ACCESSOR_MUTATOR_MEMBER(int, priority, Priority);
82  ACCESSOR_MUTATOR_MEMBER(int, blowingParticulateMatter, BlowingParticulateMatter);
83  ACCESSOR_MUTATOR_MEMBER(double, precipitationIntensity, PrecipitationIntensity);
84  ACCESSOR_MUTATOR_MEMBER(DtVrfWeatherPrecipitationType, precipitationType, PrecipitationType);
85  };
86 
91  {
92  public:
94 
95 
98  : DtFrameStateInterface(storage)
99  {
100  }
101 
102  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, snowAccumulation, SnowAccumulation);
103  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, rainAccumulation, RainAccumulation);
104  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, ambientAirPressure, AmbientAirPressure);
105  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, ambientAirTemperature, AmbientAirTemperature);
106  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, airPressureAltitude, AirPressureAltitude);
107  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, airTemperatureAltitude, AirTemperatureAltitude);
108  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, snowMinimumAltitude, SnowMinimumAltitude);
109  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, snowRoadAccumulation, SnowRoadAccumulation);
110  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, seaLevelWaterConcentration, SeaLevelWaterConcentration);
111  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, lightningPresent, LightningPresent);
112  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, fogHeight, FogHeight);
113  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(DtVector, fogColor, FogColor);
114  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, priority, Priority);
115  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(int, blowingParticulateMatter, BlowingParticulateMatter);
116  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, precipitationIntensity, PrecipitationIntensity);
117  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(DtVrfWeatherPrecipitationType, precipitationType, PrecipitationType);
118 
121  void setIsRemoteComponent(bool b) { myIsRemoteComponent = b; };
122 
123  protected:
125  bool myIsRemoteComponent = false;
126  };
127 
129  class DT_DLL_vrfStateData DtLandSurfaceStateComponentNextFrame : public DtStateComponentNextFrameTemplate< DtLandSurfaceStateComponent, DtLandSurfaceStateComponentData >
130  {
131  public:
136  {
137 
138  };
141  NEXTFRAME_ACCESSOR_MUTATOR(double, snowAccumulation, SnowAccumulation);
142  NEXTFRAME_ACCESSOR_MUTATOR(double, rainAccumulation, RainAccumulation);
143  NEXTFRAME_ACCESSOR_MUTATOR(double, ambientAirPressure, AmbientAirPressure);
144  NEXTFRAME_ACCESSOR_MUTATOR(double, ambientAirTemperature, AmbientAirTemperature);
145  NEXTFRAME_ACCESSOR_MUTATOR(double, airPressureAltitude, AirPressureAltitude);
146  NEXTFRAME_ACCESSOR_MUTATOR(double, airTemperatureAltitude, AirTemperatureAltitude);
147  NEXTFRAME_ACCESSOR_MUTATOR(double, snowMinimumAltitude, SnowMinimumAltitude);
148  NEXTFRAME_ACCESSOR_MUTATOR(double, snowRoadAccumulation, SnowRoadAccumulation);
149  NEXTFRAME_ACCESSOR_MUTATOR(double, seaLevelWaterConcentration, SeaLevelWaterConcentration);
150  NEXTFRAME_ACCESSOR_MUTATOR(bool, lightningPresent, LightningPresent);
151  NEXTFRAME_ACCESSOR_MUTATOR(double, fogHeight, FogHeight);
152  NEXTFRAME_ACCESSOR_MUTATOR(DtVector, fogColor, FogColor);
153  NEXTFRAME_ACCESSOR_MUTATOR(int, priority, Priority);
154  NEXTFRAME_ACCESSOR_MUTATOR(int, blowingParticulateMatter, BlowingParticulateMatter);
155  NEXTFRAME_ACCESSOR_MUTATOR(double, precipitationIntensity, PrecipitationIntensity);
156  NEXTFRAME_ACCESSOR_MUTATOR(DtVrfWeatherPrecipitationType, precipitationType, PrecipitationType);
157 
158  };
159 
161  class DT_DLL_vrfStateData DtLandSurfaceStateComponentCurrentFrame : public DtStateComponentCurrentFrameTemplate< DtLandSurfaceStateComponent, DtLandSurfaceStateComponentNextFrame, DtLandSurfaceStateComponentData>
162  {
163  public:
168  {
169  };
170 
171  CURRENTFRAME_ACCESSOR(double, snowAccumulation, SnowAccumulation);
172  CURRENTFRAME_ACCESSOR(double, rainAccumulation, RainAccumulation);
173  CURRENTFRAME_ACCESSOR(double, ambientAirPressure, AmbientAirPressure);
174  CURRENTFRAME_ACCESSOR(double, ambientAirTemperature, AmbientAirTemperature);
175  CURRENTFRAME_ACCESSOR(double, airPressureAltitude, AirPressureAltitude);
176  CURRENTFRAME_ACCESSOR(double, airTemperatureAltitude, AirTemperatureAltitude);
177  CURRENTFRAME_ACCESSOR(double, snowMinimumAltitude, SnowMinimumAltitude);
178  CURRENTFRAME_ACCESSOR(double, snowRoadAccumulation, SnowRoadAccumulation);
179  CURRENTFRAME_ACCESSOR(double, seaLevelWaterConcentration, SeaLevelWaterConcentration);
180  CURRENTFRAME_ACCESSOR(bool, lightningPresent, LightningPresent);
181  CURRENTFRAME_ACCESSOR(double, fogHeight, FogHeight);
182  CURRENTFRAME_ACCESSOR(DtVector, fogColor, FogColor);
183  CURRENTFRAME_ACCESSOR(int, priority, Priority);
184  CURRENTFRAME_ACCESSOR(int, blowingParticulateMatter, BlowingParticulateMatter);
185  CURRENTFRAME_ACCESSOR(double, precipitationIntensity, PrecipitationIntensity);
186  CURRENTFRAME_ACCESSOR(DtVrfWeatherPrecipitationType, precipitationType, PrecipitationType);
187  };
188 
192 
196 
197 }
DtVrfWeatherPrecipitationType
Definition: vrfWeatherStateEnums.h:13
Template for the next-frame (writable) portion of a double-buffered state component. Frame-state access is intended for single-threaded use from a controller thread.
Definition: stateComponentImplementationTemplate.h:87
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
DtLandSurfaceStateComponentData(const DtLandSurfaceStateComponentData &orig)
Definition: landSurfaceStateComponent.h:43
DtStateComponentCreator< DtLandSurfaceStateComponentImplementation > DtLandSurfaceStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: landSurfaceStateComponent.h:195
#define CURRENTFRAME_ACCESSOR(MemberType, Accessor, MutatorAndMember)
Declares a read-only current-frame accessor (by value). The MutatorAndMember parameter is unused...
Definition: stateComponentImplementationTemplate.h:77
Template that combines a current-frame and next-frame sub-component into a fully double-buffered stat...
Definition: stateComponentImplementationTemplate.h:111
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Macro to define all required static and virtual state component type methods. Place in the public sec...
Definition: stateComponent.h:272
#define NEXTFRAME_ACCESSOR_MUTATOR(MemberType, Accessor, MutatorAndMember)
Declares a public next-frame accessor (by value) and next-frame mutator pair.
Definition: stateComponentImplementationTemplate.h:62
void setIsRemoteComponent(bool b)
Sets whether this component represents state from a remote (networked) entity.
Definition: landSurfaceStateComponent.h:121
Holds land surface environmental state data including precipitation, temperature, air pressure...
Definition: landSurfaceStateComponent.h:22
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Defines an undefined virtual by-value accessor and an undefined virtual setter, both throwing DtUnimp...
Definition: doubleBufferedDataStorage.h:103
Provides write access to the land surface state for the next simulation frame.
Definition: landSurfaceStateComponent.h:129
DtLandSurfaceStateComponentCurrentFrame(DtStateData *sd)
Constructs the current frame wrapper with the given state data storage.
Definition: landSurfaceStateComponent.h:166
Definition: vrfWeatherStateEnums.h:15
DtLandSurfaceStateComponentNextFrame(DtStateData *sd)
Constructs the next frame wrapper with the given state data storage.
Definition: landSurfaceStateComponent.h:134
DtLandSurfaceStateComponentData()
Definition: landSurfaceStateComponent.h:24
Abstract interface for the land surface state component, representing both the next and current frame...
Definition: landSurfaceStateComponent.h:90
#define ACCESSOR_MUTATOR_MEMBER(MemberType, Accessor, MutatorAndMember)
Declares a public accessor (by value and reference), a public mutator, and a protected member field...
Definition: stateComponentImplementationTemplate.h:30
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:29
virtual ~DtLandSurfaceStateComponentNextFrame() override
Destructor.
Definition: landSurfaceStateComponent.h:140
Provides read access to the land surface state for the current simulation frame.
Definition: landSurfaceStateComponent.h:161
Contains the DtStateComponent class declaration.
DtLandSurfaceStateComponentData & operator=(const DtLandSurfaceStateComponentData &orig)
Definition: landSurfaceStateComponent.h:48
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
Template for the current-frame (read-only) view of a double-buffered state component. Exposes promoted current-frame data through read-only accessors.
Definition: stateComponentImplementationTemplate.h:176

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)