10 #include "legionDataStore/writeStateInstance.h"
13 #include <vlutil/vlString.h>
148 : DtFrameStateInterface(sd)
209 virtual const unsigned lightType()
const override;
210 virtual void setLightType(
const unsigned&)
override;
216 virtual const unsigned color()
const override;
217 virtual void setColor(
const unsigned&)
override;
223 virtual const double intensity()
const override;
224 virtual void setIntensity(
const double&)
override;
230 virtual const double range()
const override;
231 virtual void setRange(
const double&)
override;
237 virtual const double coneAngle()
const override;
238 virtual void setConeAngle(
const double&)
override;
246 virtual const bool powerOn()
const override;
247 virtual void setPowerOn(
const bool&)
override;
253 virtual const unsigned trackingMode()
const override;
254 virtual void setTrackingMode(
const unsigned&)
override;
260 virtual const DtString& searchId()
const override;
261 virtual void setSearchId(
const DtString&)
override;
267 virtual const DtTaitBryan& relativeOrientation()
const override;
268 virtual void setRelativeOrientation(
const DtTaitBryan&)
override;
274 virtual const DtVector& targetedLocation()
const override;
275 virtual void setTargetedLocation(
const DtVector&)
override;
281 virtual const DtVector& targetedRelativeLocation()
const override;
282 virtual void setTargetedRelativeLocation(
const DtVector&)
override;
288 virtual const DtUUID& targetedEntity()
const override;
289 virtual void setTargetedEntity(
const DtUUID&)
override;
295 virtual const DtUUID& host()
const override;
298 virtual const DtEntityIdentifier& entityId()
const override;
303 virtual const DtVector& relativeLocation()
const override;
304 virtual void setRelativeLocation(
const DtVector&)
override;
311 virtual void makeReadOnly()
override {};
333 virtual const unsigned lightType()
const override;
335 virtual const unsigned color()
const override;
337 virtual const double intensity()
const override;
339 virtual const double range()
const override;
341 virtual const double coneAngle()
const override;
345 virtual const bool powerOn()
const override;
347 virtual const unsigned trackingMode()
const override;
349 virtual const DtString& searchId()
const override;
351 virtual const DtTaitBryan& relativeOrientation()
const override;
353 virtual const DtVector& targetedLocation()
const override;
355 virtual const DtVector& targetedRelativeLocation()
const override;
357 virtual const DtUUID& targetedEntity()
const override;
361 virtual const DtUUID& host()
const override;
363 virtual const DtEntityIdentifier& entityId()
const override;
365 virtual const DtVector& relativeLocation()
const override;
367 friend class DtSearchLightStateImplementation;
399 if (myNextFrameState.isWritable())
401 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
404 myCurrentFrameState.emitComponentUpdated();
411 myCurrentFrameState.updateStateData(sd);
412 myNextFrameState.updateStateData(sd);
419 myCurrentFrameState.aboutToBeDeleted();
420 myNextFrameState.aboutToBeDeleted();
UUID is a unique ID wrapper class.
Definition: uuid.h:59
DtUUID myTargetedEntity
UUID of the entity currently targeted by this search light.
Definition: searchLightStateComponent.h:129
DtStateComponentCreator< DtSearchLightStateComponentImplementation > DtSearchLightStateComponentCreator
Factory creator type for DtSearchLightStateComponentImplementation; register with REGISTER_STATE_COMP...
Definition: searchLightStateComponent.h:431
double myRange
Maximum effective range of the search-light beam (meters).
Definition: searchLightStateComponent.h:111
DtString mySearchId
Application-defined string identifier for this search-light entry.
Definition: searchLightStateComponent.h:121
bool isDoubleBuffered()
Definition: searchLightStateComponent.h:388
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
DtSearchLightStateComponentNextFrame myNextFrameState
The next-frame (writable) state instance.
Definition: searchLightStateComponent.h:427
const DtSearchLightStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: searchLightStateComponent.h:201
Contains the DtUUID class declaration.
virtual void aboutToBeDeleted() override
Notifies both frame states that this component is about to be removed.
Definition: searchLightStateComponent.h:416
unsigned myLightType
Search Light accessor/mutators:
Definition: searchLightStateComponent.h:105
DtVector myRelativeLocation
Embedded System members: Position of the search light relative to the host entity (meters...
Definition: searchLightStateComponent.h:133
unsigned myTrackingMode
Tracking mode controlling how the search light follows a target.
Definition: searchLightStateComponent.h:119
Write-access implementation of DtSearchLightStateComponent for the next simulation frame...
Definition: searchLightStateComponent.h:190
DtSearchLightStateComponentData & frameState()
Definition: searchLightStateComponent.h:202
#define UNDEFINED_RETURNREF_ACCESSOR(ReturnType, Member)
Defines a virtual const reference accessor that throws DtUnimplementedMethod, marking the method as r...
Definition: doubleBufferedDataStorage.h:60
DtSearchLightStateComponentData(const DtSearchLightStateComponentData &orig)
Copy constructor.
Definition: searchLightStateComponent.h:39
const DtSearchLightStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: searchLightStateComponent.h:329
virtual const DtFrameStateInterface * currentFrameState() const override
Definition: searchLightStateComponent.h:390
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
DtVector myTargetedLocation
World-space location that the search light is pointing at (meters, geocentric).
Definition: searchLightStateComponent.h:125
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:489
LightType
Definition: DtLight.h:31
#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.
virtual DtFrameStateInterface * nextFrameState() override
Definition: searchLightStateComponent.h:392
DtSearchLightStateComponentData & operator=(const DtSearchLightStateComponentData &orig)
Assignment operator.
Definition: searchLightStateComponent.h:61
Abstract interface representing the search-light state for an entity. Provides accessors and mutators...
Definition: searchLightStateComponent.h:140
Concrete double-buffered state component implementation for search-light data. Owns both a current-fr...
Definition: searchLightStateComponent.h:380
double myConeAngle
Half-angle of the search-light cone (radians).
Definition: searchLightStateComponent.h:113
virtual void updateStateData(DtStateData *sd) override
Propagates the new state data pointer to both the current- and next-frame states. ...
Definition: searchLightStateComponent.h:409
#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
Definition: stateComponent.h:106
virtual void makeWritable() override
Override to make component writable.
Definition: searchLightStateComponent.h:308
bool myPowerOn
Aimable System members: Boolean indicating whether or not the system is powered on.
Definition: searchLightStateComponent.h:117
#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
Read-only access implementation of DtSearchLightStateComponent for the current simulation frame...
Definition: searchLightStateComponent.h:319
DtSearchLightStateComponentData()
Default constructor. Initializes all light properties and aim state to their off/zero defaults...
Definition: searchLightStateComponent.h:21
Cached frame data for the search-light state component.
Definition: searchLightStateComponent.h:18
DtVector myTargetedRelativeLocation
Body-relative location relative to the targeted entity that the search light is pointing at (meters)...
Definition: searchLightStateComponent.h:127
double myIntensity
Luminous intensity of the search-light beam.
Definition: searchLightStateComponent.h:109
virtual void updateDataStorage() override
Copies next-frame state into the current frame and emits a component-updated signal.
Definition: searchLightStateComponent.h:397
Contains the DtStateComponent class declaration.
virtual const DtFrameStateInterface * nextFrameState() const override
Definition: searchLightStateComponent.h:394
DtTaitBryan myRelativeOrientation
Orientation of the search light relative to the host entity body frame (Tait-Bryan angles)...
Definition: searchLightStateComponent.h:123
DtSearchLightStateComponentCurrentFrame myCurrentFrameState
The current-frame (read-only) state instance.
Definition: searchLightStateComponent.h:425
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
unsigned myColor
Packed RGBA color of the search-light beam.
Definition: searchLightStateComponent.h:107