VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
cloudLayerStateComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 #include <vlpi/netStructs.h>
12 #include <matrix/vlVector.h>
13 #include <vrfOM/sets/writeCloudLayerRepository.hpp>
14 #include <vrfOM/sets/readCloudLayerRepository.hpp>
15 
16 namespace makVrf
17 {
21  {
22  public:
24 
26  : DtFrameStateInterface(storage)
27  {
28  }
29 
31  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, cloudAltitude, CloudAltitude)
32  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, cloudThickness, CloudThickness)
33  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, cornerRadius, CornerRadius)
34  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, cloudDensity, CloudDensity)
35  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(bool, lightningPresent, LightningPresent)
37  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, ceiling, Ceiling)
38  UNDEFINED_RETURNVALUE_ACCESSOR(double, floor)
39 
40  virtual void setCloudBox(const DtVector& geocentricCenter, double length, double width) { throw DtUnimplementedMethod("void setCloudBox in unimplemented."); };
41  virtual void cloudBox(DtVector& geocentricCenter, double& length, double& width) const { throw DtUnimplementedMethod("void cloudBox in unimplemented."); };
42 
44  virtual const bool cloudLayerEnabled() const { throw DtUnimplementedMethod("void cloudLayerEnabled in unimplemented."); };
45  };
46 
49  {
50  public:
52 
53  const CloudLayerCloudType cloudType() const;
54  void setCloudType(const CloudLayerCloudType&);
55 
56  const double cloudAltitude() const;
57  void setCloudAltitude(const double&);
58 
59  const double cloudThickness() const;
60  void setCloudThickness(const double&);
61 
62  const double cornerRadius() const;
63  void setCornerRadius(const double&);
64 
65  const double cloudDensity() const;
66  void setCloudDensity(const double&);
67 
68  const bool lightningPresent() const;
69  void setLightningPresent(const bool&);
70 
71  const UInt32 flags() const;
72  void setFlags(const UInt32&);
73 
74  const double ceiling() const;
75  void setCeiling(const double&);
76 
77  void setCloudBox(const DtVector& geocentricCenter, double length, double width);
78  void cloudBox(DtVector& geocentricCenter, double& length, double& width) const;
79 
80  const double floor() const;
81 
83  virtual void makeWritable();
84 
86  virtual void makeReadOnly();
87 
88  protected:
89  VRF::WriteCloudLayerRepository myWriteCloudLayerRepository;
91  };
92 
95  {
96  public:
99 
100  const CloudLayerCloudType cloudType() const;
101  const double cloudAltitude() const;
102  const double cloudThickness() const;
103  const double cornerRadius() const;
104  const double cloudDensity() const;
105  const bool lightningPresent() const;
106  const UInt32 flags() const;
107  const double ceiling() const;
108  const double floor() const;
109  const bool cloudLayerEnabled() const;
110  void cloudBox(DtVector& geocentricCenter, double& length, double& width) const;
111 
112  bool readComponentValid() const;
113  bool findReadComponent();
114  void cloudLayerUpdated();
115 
116  protected:
117  VRF::ReadCloudLayerRepository myReadCloudLayerRepository;
119  unsigned int myCallbackHandle;
120  };
121 
125  {
126  public:
128 
129  bool isDoubleBuffered() { return true; };
130  const DtFrameStateInterface* currentFrameState() const { return &myCurrentFrameState; }
131  virtual DtFrameStateInterface* nextFrameState() { return &myNextFrameState; };
132  virtual const DtFrameStateInterface* nextFrameState() const { return &myNextFrameState; };
133 
135  {
136  if (!myFoundComponent)
137  {
138  myFoundComponent = myCurrentFrameState.findReadComponent();
139  }
140 
141  myCurrentFrameState.emitComponentUpdated();
142  }
143 
145  {
146  myCurrentFrameState.updateStateData(sd);
147  myNextFrameState.updateStateData(sd);
148  }
149 
150  virtual void aboutToBeDeleted() override
151  {
153  myCurrentFrameState.aboutToBeDeleted();
154  myNextFrameState.aboutToBeDeleted();
155  }
156 
157  virtual bool forceAdvance() override;
158 
160  virtual void firstFrameAdvance() override;
161 
162  protected:
166  };
167 
171 }
virtual const bool cloudLayerEnabled() const
This will only be relevant for the current frame as this looks at another component.
Definition: cloudLayerStateComponent.h:44
unsigned int UInt32
Definition: stateDataTypes.h:18
Definition: stateDataTypes.h:23
virtual const DtFrameStateInterface * nextFrameState() const
Definition: cloudLayerStateComponent.h:132
VRF::ReadCloudLayerRepository myReadCloudLayerRepository
Definition: cloudLayerStateComponent.h:117
Definition: stateComponent.h:257
void updateDataStorage()
Implement to update data storage. Called from advanceFrame.
Definition: cloudLayerStateComponent.h:134
DtStateComponentCreator< DtCloudLayerStateComponentImplementation > DtCloudLayerStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: cloudLayerStateComponent.h:170
virtual void cloudBox(DtVector &geocentricCenter, double &length, double &width) const
Definition: cloudLayerStateComponent.h:41
#define UNDEFINED_RETURNVALUE_ACCESSOR(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:31
unsigned int myCallbackHandle
Definition: cloudLayerStateComponent.h:119
CloudLayerCloudType
Definition: vrfCloudLayerStateEnums.h:14
virtual void aboutToBeDeleted() override
Definition: cloudLayerStateComponent.h:150
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:336
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:219
Contains the enums for cloud layers.
bool isDoubleBuffered()
Definition: cloudLayerStateComponent.h:129
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:365
virtual DtFrameStateInterface * nextFrameState()
Definition: cloudLayerStateComponent.h:131
bool myFoundComponent
Definition: cloudLayerStateComponent.h:165
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
virtual void aboutToBeDeleted()
3) Define the current frame class. This will be used for read access.
Definition: cloudLayerStateComponent.h:94
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: cloudLayerStateComponent.h:144
DtCloudLayerStateComponentCurrentFrame myCurrentFrameState
Definition: cloudLayerStateComponent.h:163
DtStateData * myStateData
Definition: cloudLayerStateComponent.h:90
2) Define the next frame class. This will be used for write access.
Definition: cloudLayerStateComponent.h:48
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: cloudLayerStateComponent.h:124
DtCloudLayerStateComponentNextFrame myNextFrameState
Definition: cloudLayerStateComponent.h:164
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:26
const DtFrameStateInterface * currentFrameState() const
Definition: cloudLayerStateComponent.h:130
VRF::WriteCloudLayerRepository myWriteCloudLayerRepository
Definition: cloudLayerStateComponent.h:89
Contains the DtStateComponent class declaration.
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: cloudLayerStateComponent.h:20
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:282
DtStateData * myStateData
Definition: cloudLayerStateComponent.h:118

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)