10 #include <vlutil/vlString.h>
11 #include <matrix/vlVector.h>
65 std::vector<DtVector> myWorldPositions{};
105 virtual const double& width()
const override;
108 virtual void setWidth(
const double&)
override;
111 virtual const double& height()
const override;
114 virtual void setHeight(
const double&)
override;
117 virtual const std::vector<DtVector> worldPositions()
const override;
120 virtual void setWorldPositions(
const std::vector<DtVector>&)
override;
123 virtual const double& windSpeed()
const override;
126 virtual void setWindSpeed(
const double&)
override;
129 virtual const int& priority()
const override;
132 virtual void setPriority(
const int&)
override;
135 virtual void updateWindCorridorData();
144 virtual void completeSetup();
167 virtual const double& width()
const override;
169 virtual const double& height()
const override;
171 virtual const std::vector<DtVector> worldPositions()
const override;
173 virtual const double& windSpeed()
const override;
175 virtual const int& priority()
const override;
180 void completeSetup();
184 void updateVrfStateComponentParameters();
187 void updateWindCorridorData();
223 virtual void completeSetup()
override;
228 if (myNextFrameState.isWritable())
230 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
233 myCurrentFrameState.emitComponentUpdated();
240 myCurrentFrameState.updateStateData(sd);
241 myNextFrameState.updateStateData(sd);
248 myCurrentFrameState.aboutToBeDeleted();
249 myNextFrameState.aboutToBeDeleted();
DtWindCorridorStateComponentData()
Default constructor. Initializes wind speed and dimensions to zero with default priority.
Definition: windCorridorStateComponent.h:19
virtual const DtFrameStateInterface * nextFrameState() const override
Returns the next (write) frame state interface (const overload).
Definition: windCorridorStateComponent.h:220
std::vector< DtVector > myWorldPositions
World-space positions defining the corridor path vertices.
Definition: windCorridorStateComponent.h:65
virtual void makeWritable() override
Override to make component writable.
Definition: windCorridorStateComponent.h:138
const DtWindCorridorStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: windCorridorStateComponent.h:164
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
double myWindSpeed
Wind speed of the corridor in meters per second.
Definition: windCorridorStateComponent.h:59
DtWindCorridorStateComponentNextFrame myNextFrameState
Next frame state instance providing write access to wind corridor data.
Definition: windCorridorStateComponent.h:256
virtual const DtFrameStateInterface * currentFrameState() const override
Returns the current (read) frame state interface.
Definition: windCorridorStateComponent.h:216
double myHeight
Height of the wind corridor in meters.
Definition: windCorridorStateComponent.h:63
2) Define the next frame class. This will be used for write access.
Definition: windCorridorStateComponent.h:92
DtWindCorridorStateComponentData myData
Local copy of the wind corridor data for the next frame.
Definition: windCorridorStateComponent.h:150
DtWindCorridorStateComponentCurrentFrame myCurrentFrameState
Current frame state instance providing read access to wind corridor data.
Definition: windCorridorStateComponent.h:254
DtWindCorridorStateComponentData & frameState()
Returns a mutable reference to the next frame state data for write access.
Definition: windCorridorStateComponent.h:102
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
boost::signals2::scoped_connection myVrfStateComponentChangedConnection
Connection to the VRF state component's extended data modification signal.
Definition: windCorridorStateComponent.h:199
#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
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:489
virtual DtFrameStateInterface * nextFrameState() override
Returns the next (write) frame state interface.
Definition: windCorridorStateComponent.h:218
virtual void makeReadOnly() override
Override to make component read-only.
Definition: windCorridorStateComponent.h:141
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: windCorridorStateComponent.h:72
Definition: stateComponent.h:95
#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
virtual void updateStateData(DtStateData *sd) override
Updates the state data pointer for both current and next frame state components.
Definition: windCorridorStateComponent.h:238
virtual void aboutToBeDeleted()
Called when the component is about to be deleted; emits signal_stateComponentAboutToBeDeleted.
bool isDoubleBuffered()
Returns true since this component uses double-buffered data storage.
Definition: windCorridorStateComponent.h:214
Data container holding all state properties for a wind corridor entity.
Definition: windCorridorStateComponent.h:16
DtWindCorridorStateComponentData(const DtWindCorridorStateComponentData &orig)
Copy constructor.
Definition: windCorridorStateComponent.h:28
const DtWindCorridorStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: windCorridorStateComponent.h:100
DtStateComponentCreator< DtWindCorridorStateComponentImplementation > DtWindCorridorStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: windCorridorStateComponent.h:261
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Defines an undefined virtual const-reference accessor and an undefined virtual setter, both throwing DtUnimplementedMethod and requiring overrides in a derived class.
Definition: doubleBufferedDataStorage.h:112
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Defines a const reference accessor and an inline setter for a member variable.
Definition: doubleBufferedDataStorage.h:37
DtWindCorridorStateComponentData myData
Local copy of the wind corridor data for the current frame.
Definition: windCorridorStateComponent.h:201
virtual void updateDataStorage() override
Advances the current frame state from the next frame state if the next frame is writable.
Definition: windCorridorStateComponent.h:226
void advanceFrame(const DtWindCorridorStateComponentData &data)
Advances to the next frame by replacing the current frame state with the provided data...
Definition: windCorridorStateComponent.h:192
#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
3) Define the current frame class. This will be used for read access.
Definition: windCorridorStateComponent.h:154
int myPriority
Priority of this wind corridor relative to other wind corridors.
Definition: windCorridorStateComponent.h:67
virtual void aboutToBeDeleted() override
Notifies both frame state components that this component is about to be deleted.
Definition: windCorridorStateComponent.h:245
DtWindCorridorStateComponentData & operator=(const DtWindCorridorStateComponentData &orig)
Assignment operator.
Definition: windCorridorStateComponent.h:40
Contains the DtStateComponent class declaration.
double myWidth
Width of the wind corridor in meters.
Definition: windCorridorStateComponent.h:61
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: windCorridorStateComponent.h:206
boost::signals2::scoped_connection myVrfStateComponentChangedConnection
Connection to the VRF state component's extended data modification signal.
Definition: windCorridorStateComponent.h:148