10 #include "legionDataStore/writeStateInstance.h"
13 #include <vlutil/vlString.h>
136 : DtFrameStateInterface(sd)
193 virtual const unsigned signal()
const override;
194 virtual void setSignal(
const unsigned&)
override;
200 virtual const double spread()
const override;
201 virtual void setSpread(
const double&)
override;
207 virtual const double wavelength()
const override;
208 virtual void setWavelength(
const double&)
override;
216 virtual const bool powerOn()
const override;
217 virtual void setPowerOn(
const bool&)
override;
223 virtual const unsigned trackingMode()
const override;
224 virtual void setTrackingMode(
const unsigned&)
override;
230 virtual const DtString& laserId()
const override;
231 virtual void setLaserId(
const DtString&)
override;
237 virtual const DtTaitBryan& relativeOrientation()
const override;
238 virtual void setRelativeOrientation(
const DtTaitBryan&)
override;
244 virtual const DtVector& targetedLocation()
const override;
245 virtual void setTargetedLocation(
const DtVector&)
override;
251 virtual const DtVector& targetedRelativeLocation()
const override;
252 virtual void setTargetedRelativeLocation(
const DtVector&)
override;
258 virtual const DtUUID& targetedEntity()
const override;
259 virtual void setTargetedEntity(
const DtUUID&)
override;
265 virtual const DtUUID& host()
const override;
268 virtual const DtEntityIdentifier& entityId()
const override;
273 virtual const DtVector& relativeLocation()
const override;
274 virtual void setRelativeLocation(
const DtVector&)
override;
281 virtual void makeReadOnly()
override {};
303 virtual const unsigned signal()
const override;
305 virtual const double spread()
const override;
307 virtual const double wavelength()
const override;
311 virtual const bool powerOn()
const override;
313 virtual const unsigned trackingMode()
const override;
315 virtual const DtString& laserId()
const override;
317 virtual const DtTaitBryan& relativeOrientation()
const override;
319 virtual const DtVector& targetedLocation()
const override;
321 virtual const DtVector& targetedRelativeLocation()
const override;
323 virtual const DtUUID& targetedEntity()
const override;
327 virtual const DtUUID& host()
const override;
329 virtual const DtEntityIdentifier& entityId()
const override;
331 virtual const DtVector& relativeLocation()
const override;
333 friend class DtLaserLightStateImplementation;
365 if (myNextFrameState.isWritable())
367 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
370 myCurrentFrameState.emitComponentUpdated();
377 myCurrentFrameState.updateStateData(sd);
378 myNextFrameState.updateStateData(sd);
385 myCurrentFrameState.aboutToBeDeleted();
386 myNextFrameState.aboutToBeDeleted();
UUID is a unique ID wrapper class.
Definition: uuid.h:59
virtual const DtFrameStateInterface * currentFrameState() const override
Definition: laserLightStateComponent.h:356
DtString myLaserId
Application-defined string identifier for this laser-light entry.
Definition: laserLightStateComponent.h:109
DtLaserLightStateComponentNextFrame myNextFrameState
The next-frame (writable) state instance.
Definition: laserLightStateComponent.h:393
Read-only access implementation of DtLaserLightStateComponent for the current simulation frame...
Definition: laserLightStateComponent.h:289
unsigned myTrackingMode
Tracking mode controlling how the laser light follows a target.
Definition: laserLightStateComponent.h:107
DtStateComponentCreator< DtLaserLightStateComponentImplementation > DtLaserLightStateComponentCreator
Factory creator type for DtLaserLightStateComponentImplementation; register with REGISTER_STATE_COMPO...
Definition: laserLightStateComponent.h:397
DtLaserLightStateComponentData()
Default constructor. Initializes all laser properties and aim state to their off/zero defaults...
Definition: laserLightStateComponent.h:21
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
virtual const DtFrameStateInterface * nextFrameState() const override
Definition: laserLightStateComponent.h:360
Contains the DtUUID class declaration.
bool isDoubleBuffered()
Definition: laserLightStateComponent.h:354
unsigned mySignal
Laser Light accessor/mutators:
Definition: laserLightStateComponent.h:97
#define UNDEFINED_RETURNREF_ACCESSOR(ReturnType, Member)
Defines a virtual const reference accessor that throws DtUnimplementedMethod, marking the method as r...
Definition: doubleBufferedDataStorage.h:60
DtUUID myTargetedEntity
UUID of the entity currently targeted by this laser light.
Definition: laserLightStateComponent.h:117
virtual DtFrameStateInterface * nextFrameState() override
Definition: laserLightStateComponent.h:358
Abstract interface representing the laser-light state for an entity. Provides accessors and mutators ...
Definition: laserLightStateComponent.h:128
Cached frame data for the laser-light state component.
Definition: laserLightStateComponent.h:18
const DtLaserLightStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: laserLightStateComponent.h:185
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
Definition: stateComponent.h:105
DtLaserLightStateComponentCurrentFrame myCurrentFrameState
The current-frame (read-only) state instance.
Definition: laserLightStateComponent.h:391
DtLaserLightStateComponentData & operator=(const DtLaserLightStateComponentData &orig)
Assignment operator.
Definition: laserLightStateComponent.h:57
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:489
virtual void aboutToBeDeleted() override
Notifies both frame states that this component is about to be removed.
Definition: laserLightStateComponent.h:382
virtual void updateStateData(DtStateData *sd) override
Propagates the new state data pointer to both the current- and next-frame states. ...
Definition: laserLightStateComponent.h:375
#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 aboutToBeDeleted()
Called when the component is about to be deleted; emits signal_stateComponentAboutToBeDeleted.
DtVector myTargetedLocation
World-space location that the laser light is pointing at (meters, geocentric).
Definition: laserLightStateComponent.h:113
Concrete double-buffered state component implementation for laser-light data. Owns both a current-fra...
Definition: laserLightStateComponent.h:346
DtVector myRelativeLocation
Embedded System members: Position of the laser light relative to the host entity (meters, body frame).
Definition: laserLightStateComponent.h:121
Write-access implementation of DtLaserLightStateComponent for the next simulation frame...
Definition: laserLightStateComponent.h:174
#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
double mySpread
Angular spread of the laser beam (radians).
Definition: laserLightStateComponent.h:99
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Defines a const reference accessor and an inline setter for a member variable.
Definition: doubleBufferedDataStorage.h:37
DtLaserLightStateComponentData & frameState()
Definition: laserLightStateComponent.h:186
double myWavelength
Wavelength of the laser beam (nanometers).
Definition: laserLightStateComponent.h:101
#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 void updateDataStorage() override
Copies next-frame state into the current frame and emits a component-updated signal.
Definition: laserLightStateComponent.h:363
const DtLaserLightStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: laserLightStateComponent.h:299
DtLaserLightStateComponentData(const DtLaserLightStateComponentData &orig)
Copy constructor.
Definition: laserLightStateComponent.h:37
Contains the DtStateComponent class declaration.
DtVector myTargetedRelativeLocation
Body-relative location relative to the targeted entity that the laser light is pointing at (meters)...
Definition: laserLightStateComponent.h:115
virtual void makeWritable() override
Override to make component writable.
Definition: laserLightStateComponent.h:278
DtTaitBryan myRelativeOrientation
Orientation of the laser light relative to the host entity body frame (Tait-Bryan angles)...
Definition: laserLightStateComponent.h:111
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
bool myPowerOn
Aimable System members: Boolean indicating whether or not the system is powered on.
Definition: laserLightStateComponent.h:105