12 #include <matrix/vlVector.h>
13 #include <matrix/vlTaitBryan.h>
14 #include "vrfOM/sets/readSensorFieldOfViewRepository.hpp"
15 #include "vrfOM/sets/writeSensorFieldOfViewRepository.hpp"
71 : DtFrameStateInterface(storage)
142 virtual const unsigned int color()
const override;
143 virtual void setColor(
const unsigned int&)
override;
149 virtual const double maximumAzimuthAngle()
const override;
150 virtual void setMaximumAzimuthAngle(
const double&)
override;
156 virtual const double maximumElevationAngle()
const override;
157 virtual void setMaximumElevationAngle(
const double&)
override;
163 virtual const double maximumZoomLevel()
const override;
164 virtual void setMaximumZoomLevel(
const double&)
override;
170 virtual const double minimumAzimuthAngle()
const override;
171 virtual void setMinimumAzimuthAngle(
const double&)
override;
177 virtual const double minimumElevationAngle()
const override;
178 virtual void setMinimumElevationAngle(
const double&)
override;
184 virtual const double radius()
const override;
185 virtual void setRadius(
const double&)
override;
191 virtual const double xHalfAngle()
const override;
192 virtual void setXHalfAngle(
const double&)
override;
198 virtual const double yHalfAngle()
const override;
199 virtual void setYHalfAngle(
const double&)
override;
205 virtual const double zoomLevel()
const override;
206 virtual void setZoomLevel(
const double&)
override;
213 virtual const bool powerOn()
const override;
214 virtual void setPowerOn(
const bool&)
override;
220 virtual const unsigned int trackingMode()
const override;
221 virtual void setTrackingMode(
const unsigned int&)
override;
226 virtual const DtString fovId()
const override;
227 virtual void setFovId(
const DtString&)
override;
233 virtual const DtTaitBryan relativeOrientation()
const override;
234 virtual void setRelativeOrientation(
const DtTaitBryan&)
override;
240 virtual const DtVector targetedLocation()
const override;
241 virtual void setTargetedLocation(
const DtVector&)
override;
247 virtual const DtVector targetedRelativeLocation()
const override;
248 virtual void setTargetedRelativeLocation(
const DtVector&)
override;
254 virtual const DtUUID& targetedEntity()
const override;
255 virtual void setTargetedEntity(
const DtUUID&)
override;
260 virtual const DtUUID& host()
const override;
262 virtual const DtEntityIdentifier& entityId()
const override;
267 virtual const DtVector relativeLocation()
const override;
268 virtual void setRelativeLocation(
const DtVector&)
override;
272 virtual void makeWritable()
override;
275 virtual Legion::WriteStateInstance writeStateInstance()
override;
278 virtual void makeReadOnly()
override;
305 virtual const unsigned int color()
const override;
307 virtual const double maximumAzimuthAngle()
const override;
309 virtual const double maximumElevationAngle()
const override;
311 virtual const double maximumZoomLevel()
const override;
313 virtual const double minimumAzimuthAngle()
const override;
315 virtual const double minimumElevationAngle()
const override;
317 virtual const double radius()
const override;
319 virtual const double xHalfAngle()
const override;
321 virtual const double yHalfAngle()
const override;
323 virtual const double zoomLevel()
const override;
327 virtual const bool powerOn()
const override;
329 virtual const unsigned int trackingMode()
const override;
331 virtual const DtString fovId()
const override;
333 virtual const DtTaitBryan relativeOrientation()
const override;
335 virtual const DtVector targetedLocation()
const override;
337 virtual const DtVector targetedRelativeLocation()
const override;
339 virtual const DtUUID& targetedEntity()
const override;
343 virtual const DtUUID& host()
const override;
345 virtual const DtEntityIdentifier& entityId()
const override;
347 virtual const DtVector relativeLocation()
const override;
350 bool readComponentValid()
const;
353 bool findReadComponent();
357 virtual void handleDataUpdated();
369 VRF::ReadSensorFieldOfViewRepository myReadSensorFieldOfViewRepository;
400 if (myNextFrameState.isWritable())
402 myCurrentFrameState.setTargetedEntity(myNextFrameState.targetedEntity());
403 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
405 myCurrentFrameState.emitComponentUpdated();
412 myCurrentFrameState.updateStateData(sd);
413 myNextFrameState.updateStateData(sd);
420 myCurrentFrameState.aboutToBeDeleted();
421 myNextFrameState.aboutToBeDeleted();
425 virtual void firstFrameAdvance()
override;
428 virtual bool forceAdvance()
override;
UUID is a unique ID wrapper class.
Definition: uuid.h:59
virtual void setTargetedEntity(const DtUUID &u) override
Directly sets the cached targeted entity UUID (used by the implementation class). ...
Definition: sensorFieldOfViewStateComponent.h:363
virtual DtFrameStateInterface * nextFrameState() override
Definition: sensorFieldOfViewStateComponent.h:393
const DtSensorFieldOfViewStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: sensorFieldOfViewStateComponent.h:301
virtual void updateStateData(DtStateData *sd) override
Propagates the new state data pointer to both the current- and next-frame states. ...
Definition: sensorFieldOfViewStateComponent.h:410
DtSensorFieldOfViewStateComponentData myData
Definition: sensorFieldOfViewStateComponent.h:375
Cached frame data for the sensor field-of-view state component.
Definition: sensorFieldOfViewStateComponent.h:21
DtSensorFieldOfViewStateComponentCurrentFrame myCurrentFrameState
The current-frame (read-only) state instance.
Definition: sensorFieldOfViewStateComponent.h:432
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
bool myPowerOn
Boolean indicating whether or not the system is powered on.
Definition: sensorFieldOfViewStateComponent.h:54
virtual void updateDataStorage() override
Copies next-frame targeted entity into the current frame and emits a component-updated signal...
Definition: sensorFieldOfViewStateComponent.h:398
DtSensorFieldOfViewStateComponentData & frameState()
Definition: sensorFieldOfViewStateComponent.h:136
bool isDoubleBuffered()
Definition: sensorFieldOfViewStateComponent.h:389
Contains the DtUUID class declaration.
Read-only access implementation of DtSensorFieldOfViewStateComponent for the current simulation frame...
Definition: sensorFieldOfViewStateComponent.h:291
#define UNDEFINED_RETURNREF_ACCESSOR(ReturnType, Member)
Defines a virtual const reference accessor that throws DtUnimplementedMethod, marking the method as r...
Definition: doubleBufferedDataStorage.h:60
Abstract interface representing the sensor field-of-view state for an entity. Provides accessors and ...
Definition: sensorFieldOfViewStateComponent.h:63
DtVector myTargetedRelativeLocation
Body-relative location relative to the targeted entity that the sensor is pointing at (meters)...
Definition: sensorFieldOfViewStateComponent.h:56
Write-access implementation of DtSensorFieldOfViewStateComponent for the next simulation frame...
Definition: sensorFieldOfViewStateComponent.h:124
Definition: stateComponent.h:89
const DtSensorFieldOfViewStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: sensorFieldOfViewStateComponent.h:135
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
virtual void aboutToBeDeleted() override
Notifies both frame states that this component is about to be removed.
Definition: sensorFieldOfViewStateComponent.h:417
DtSensorFieldOfViewStateComponentData myData
Definition: sensorFieldOfViewStateComponent.h:286
DtSensorFieldOfViewStateComponentNextFrame myNextFrameState
The next-frame (writable) state instance.
Definition: sensorFieldOfViewStateComponent.h:434
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:489
#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.
DtStateComponentCreator< DtSensorFieldOfViewStateComponentImplementation > DtSensorFieldOfViewStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: sensorFieldOfViewStateComponent.h:441
virtual const DtFrameStateInterface * currentFrameState() const override
Definition: sensorFieldOfViewStateComponent.h:391
VRF::WriteSensorFieldOfViewRepository myWriteSensorFieldOfViewRepository
Legion write repository providing access to the next-frame sensor field-of-view data.
Definition: sensorFieldOfViewStateComponent.h:282
Concrete double-buffered state component implementation for sensor field-of-view data. Owns both a current-frame (read) and next-frame (write) state and manages advancing data between them each simulation frame.
Definition: sensorFieldOfViewStateComponent.h:381
#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
DtSensorFieldOfViewStateComponentData(const DtSensorFieldOfViewStateComponentData &orig)
Copy constructor.
Definition: sensorFieldOfViewStateComponent.h:31
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Defines a const reference accessor and an inline setter for a member variable.
Definition: doubleBufferedDataStorage.h:37
DtUUID myTargetedEntity
UUID of the entity currently targeted by this sensor (cached locally).
Definition: sensorFieldOfViewStateComponent.h:284
int myCallbackHandle
Handle for the instance-updated callback registered with the state data manager.
Definition: sensorFieldOfViewStateComponent.h:373
#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 const DtFrameStateInterface * nextFrameState() const override
Definition: sensorFieldOfViewStateComponent.h:395
bool myFoundComponent
True after the read component has been successfully located and bound.
Definition: sensorFieldOfViewStateComponent.h:436
Contains the DtStateComponent class declaration.
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
DtSensorFieldOfViewStateComponentData & operator=(const DtSensorFieldOfViewStateComponentData &orig)
Assignment operator.
Definition: sensorFieldOfViewStateComponent.h:40
DtSensorFieldOfViewStateComponentData()
Default constructor. Initializes the power state to off and a default targeted relative location...
Definition: sensorFieldOfViewStateComponent.h:24
DtUUID myTargetedEntity
Cached UUID of the entity currently targeted by this sensor.
Definition: sensorFieldOfViewStateComponent.h:371