VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
sensorFieldOfViewStateComponent.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 
11 #include <vrfutil/rwUUID.h>
12 #include <matrix/vlVector.h>
13 #include <matrix/vlTaitBryan.h>
14 #include "vrfOM/sets/readSensorFieldOfViewRepository.hpp"
15 #include "vrfOM/sets/writeSensorFieldOfViewRepository.hpp"
16 
17 namespace makVrf
18 {
22  {
23  public:
25 
27  : DtFrameStateInterface(storage)
28  {
29  }
30 
31  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, zoomLevel, ZoomLevel)
32  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, maximumZoomLevel, MaximumZoomLevel)
33  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(unsigned int, color, Color)
36  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(DtVector, relativeLocation, RelativeLocation)
37  UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(DtUUID, targetedEntity, TargetedEntity)
38  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(DtVector, targetedLocation, TargetedLocation)
39  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(DtTaitBryan, relativeOrientation, RelativeOrientation)
40  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(unsigned int, trackingMode, TrackingMode)
41  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, radius, Radius)
42  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, xHalfAngle, XHalfAngle)
43  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, yHalfAngle, YHalfAngle)
44  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, minimumAzimuthAngle, MinimumAzimuthAngle)
45  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, maximumAzimuthAngle, MaximumAzimuthAngle)
46  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, minimumElevationAngle, MinimumElevationAngle)
47  UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(double, maximumElevationAngle, MaximumElevationAngle)
48  };
49 
52  {
53  public:
56 
57  virtual const double zoomLevel() const override;
58  virtual void setZoomLevel(const double&) override;
59 
60  virtual const double maximumZoomLevel() const override;
61  virtual void setMaximumZoomLevel(const double&) override;
62 
63  virtual const unsigned int color() const override;
64  virtual void setColor(const unsigned int&) override;
65 
66  virtual const DtUUID host() const override;
67 
68  virtual const DtString fovId() const override;
69  virtual void setFovId(const DtString&) override;
70 
71  virtual const DtVector relativeLocation() const override;
72  virtual void setRelativeLocation(const DtVector&) override;
73 
74  virtual const DtUUID& targetedEntity() const override;
75  virtual void setTargetedEntity(const DtUUID&) override;
76 
77  virtual const DtVector targetedLocation() const override;
78  virtual void setTargetedLocation(const DtVector&) override;
79 
80  virtual const DtTaitBryan relativeOrientation() const override;
81  virtual void setRelativeOrientation(const DtTaitBryan&) override;
82 
83  virtual const unsigned int trackingMode() const override;
84  virtual void setTrackingMode(const unsigned int&) override;
85 
86  virtual const double radius() const override;
87  virtual void setRadius(const double&) override;
88 
89  virtual const double xHalfAngle() const override;
90  virtual void setXHalfAngle(const double&) override;
91 
92  virtual const double yHalfAngle() const override;
93  virtual void setYHalfAngle(const double&) override;
94 
95  virtual const double minimumAzimuthAngle() const override;
96  virtual void setMinimumAzimuthAngle(const double&) override;
97 
98  virtual const double maximumAzimuthAngle() const override;
99  virtual void setMaximumAzimuthAngle(const double&) override;
100 
101  virtual const double minimumElevationAngle() const override;
102  virtual void setMinimumElevationAngle(const double&) override;
103 
104  virtual const double maximumElevationAngle() const override;
105  virtual void setMaximumElevationAngle(const double&) override;
106 
108  virtual void makeWritable() override;
109 
110  virtual Legion::WriteStateInstance writeStateInstance() override;
111 
113  virtual void makeReadOnly() override;
114 
115  protected:
116  VRF::WriteSensorFieldOfViewRepository myWriteSensorFieldOfViewRepository;
118  };
119 
122  {
123  public:
126 
127  virtual const double zoomLevel() const override;
128  virtual const double maximumZoomLevel() const override;
129  virtual const unsigned int color() const override;
130  virtual const DtUUID host() const override;
131  virtual const DtString fovId() const override;
132  virtual const DtVector relativeLocation() const override;
133  virtual const DtUUID& targetedEntity() const override;
134  virtual const DtVector targetedLocation() const override;
135  virtual const DtTaitBryan relativeOrientation() const override;
136  virtual const unsigned int trackingMode() const override;
137  virtual const double radius() const override;
138  virtual const double xHalfAngle() const override;
139  virtual const double yHalfAngle() const override;
140  virtual const double minimumAzimuthAngle() const override;
141  virtual const double maximumAzimuthAngle() const override;
142  virtual const double minimumElevationAngle() const override;
143  virtual const double maximumElevationAngle() const override;
144 
145  bool readComponentValid() const;
146  bool findReadComponent();
147 
148  protected:
149  virtual void handleDataUpdated();
150 
152  virtual void setTargetedEntity(const DtUUID& u) override { myTargetedEntity = u; };
153 
154  protected:
155  VRF::ReadSensorFieldOfViewRepository myReadSensorFieldOfViewRepository;
158  };
159 
163  {
164  public:
166 
167  bool isDoubleBuffered() { return true; };
168  virtual const DtFrameStateInterface* currentFrameState() const override { return &myCurrentFrameState; }
169  virtual DtFrameStateInterface* nextFrameState() override { return &myNextFrameState; };
170  virtual const DtFrameStateInterface* nextFrameState() const override { return &myNextFrameState; };
171 
172  virtual void updateDataStorage() override
173  {
174  myCurrentFrameState.setTargetedEntity(myNextFrameState.targetedEntity());
175  myCurrentFrameState.emitComponentUpdated();
176  }
177 
178  virtual void updateStateData(DtStateData* sd) override
179  {
180  myCurrentFrameState.updateStateData(sd);
181  myNextFrameState.updateStateData(sd);
182  }
183 
184  virtual void aboutToBeDeleted() override
185  {
187  myCurrentFrameState.aboutToBeDeleted();
188  myNextFrameState.aboutToBeDeleted();
189  }
190 
191  virtual void firstFrameAdvance() override;
192  virtual bool forceAdvance() override;
193 
194  protected:
198  };
199 
203 }
UUID is a unique ID wrapper class.
Definition: uuid.h:59
virtual void setTargetedEntity(const DtUUID &u) override
Definition: sensorFieldOfViewStateComponent.h:152
virtual DtFrameStateInterface * nextFrameState() override
Definition: sensorFieldOfViewStateComponent.h:169
virtual void updateStateData(DtStateData *sd) override
Implement to update data storage to the new state data.
Definition: sensorFieldOfViewStateComponent.h:178
DtSensorFieldOfViewStateComponentCurrentFrame myCurrentFrameState
Definition: sensorFieldOfViewStateComponent.h:195
Definition: stateComponent.h:269
virtual void updateDataStorage() override
Implement to update data storage. Called from advanceFrame.
Definition: sensorFieldOfViewStateComponent.h:172
bool isDoubleBuffered()
Definition: sensorFieldOfViewStateComponent.h:167
#define UNDEFINED_RETURNVALUE_ACCESSOR(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:31
Contains the DtUUID class declaration.
3) Define the current frame class. This will be used for read access.
Definition: sensorFieldOfViewStateComponent.h:121
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: sensorFieldOfViewStateComponent.h:21
2) Define the next frame class. This will be used for write access.
Definition: sensorFieldOfViewStateComponent.h:51
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:398
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:231
virtual void aboutToBeDeleted() override
Definition: sensorFieldOfViewStateComponent.h:184
DtSensorFieldOfViewStateComponentNextFrame myNextFrameState
Definition: sensorFieldOfViewStateComponent.h:196
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:384
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
virtual void aboutToBeDeleted()
DtStateComponentCreator< DtSensorFieldOfViewStateComponentImplementation > DtSensorFieldOfViewStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: sensorFieldOfViewStateComponent.h:202
virtual const DtFrameStateInterface * currentFrameState() const override
Definition: sensorFieldOfViewStateComponent.h:168
VRF::WriteSensorFieldOfViewRepository myWriteSensorFieldOfViewRepository
Definition: sensorFieldOfViewStateComponent.h:116
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: sensorFieldOfViewStateComponent.h:162
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
DtUUID myTargetedEntity
Definition: sensorFieldOfViewStateComponent.h:117
int myCallbackHandle
Definition: sensorFieldOfViewStateComponent.h:157
#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
virtual const DtFrameStateInterface * nextFrameState() const override
Definition: sensorFieldOfViewStateComponent.h:170
bool myFoundComponent
Definition: sensorFieldOfViewStateComponent.h:197
Contains the DtStateComponent class declaration.
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:294
DtUUID myTargetedEntity
Definition: sensorFieldOfViewStateComponent.h:156

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)