VR-Forces 5.0.1 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  const double zoomLevel() const;
58  void setZoomLevel(const double&);
59 
60  const double maximumZoomLevel() const;
61  void setMaximumZoomLevel(const double&);
62 
63  const unsigned int color() const;
64  void setColor(const unsigned int&);
65 
66  const DtUUID host() const;
67 
68  const DtString fovId() const;
69  void setFovId(const DtString&);
70 
71  const DtVector relativeLocation() const;
72  void setRelativeLocation(const DtVector&);
73 
74  const DtUUID& targetedEntity() const;
75  void setTargetedEntity(const DtUUID&);
76 
77  const DtVector targetedLocation() const;
78  void setTargetedLocation(const DtVector&);
79 
80  const DtTaitBryan relativeOrientation() const;
81  void setRelativeOrientation(const DtTaitBryan&);
82 
83  const unsigned int trackingMode() const;
84  void setTrackingMode(const unsigned int&);
85 
86  const double radius() const;
87  void setRadius(const double&);
88 
89  const double xHalfAngle() const;
90  void setXHalfAngle(const double&);
91 
92  const double yHalfAngle() const;
93  void setYHalfAngle(const double&);
94 
95  const double minimumAzimuthAngle() const;
96  void setMinimumAzimuthAngle(const double&);
97 
98  const double maximumAzimuthAngle() const;
99  void setMaximumAzimuthAngle(const double&);
100 
101  const double minimumElevationAngle() const;
102  void setMinimumElevationAngle(const double&);
103 
104  const double maximumElevationAngle() const;
105  void setMaximumElevationAngle(const double&);
106 
108  virtual void makeWritable();
109 
111  virtual void makeReadOnly();
112 
113  protected:
114  VRF::WriteSensorFieldOfViewRepository myWriteSensorFieldOfViewRepository;
117  };
118 
121  {
122  public:
125 
126  const double zoomLevel() const;
127  const double maximumZoomLevel() const;
128  const unsigned int color() const;
129  const DtUUID host() const;
130  const DtString fovId() const;
131  const DtVector relativeLocation() const;
132  const DtUUID& targetedEntity() const;
133  const DtVector targetedLocation() const;
134  const DtTaitBryan relativeOrientation() const;
135  const unsigned int trackingMode() const;
136  const double radius() const;
137  const double xHalfAngle() const;
138  const double yHalfAngle() const;
139  const double minimumAzimuthAngle() const;
140  const double maximumAzimuthAngle() const;
141  const double minimumElevationAngle() const;
142  const double maximumElevationAngle() const;
143 
144  bool readComponentValid() const;
145  bool findReadComponent();
146 
147  protected:
148  virtual void handleDataUpdated();
149 
151  void setTargetedEntity(const DtUUID& u) { myTargetedEntity = u; };
152 
153  protected:
154  VRF::ReadSensorFieldOfViewRepository myReadSensorFieldOfViewRepository;
158  };
159 
163  {
164  public:
166 
167  bool isDoubleBuffered() { return true; };
168  const DtFrameStateInterface* currentFrameState() const { return &myCurrentFrameState; }
169  virtual DtFrameStateInterface* nextFrameState() { return &myNextFrameState; };
170  virtual const DtFrameStateInterface* nextFrameState() const { return &myNextFrameState; };
171 
173  {
174  myCurrentFrameState.setTargetedEntity(myNextFrameState.targetedEntity());
175  myCurrentFrameState.emitComponentUpdated();
176  }
177 
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: rwUUID.h:226
DtStateData * myStateData
Definition: sensorFieldOfViewStateComponent.h:116
DtSensorFieldOfViewStateComponentCurrentFrame myCurrentFrameState
Definition: sensorFieldOfViewStateComponent.h:195
virtual DtFrameStateInterface * nextFrameState()
Definition: sensorFieldOfViewStateComponent.h:169
Definition: stateComponent.h:257
bool isDoubleBuffered()
Definition: sensorFieldOfViewStateComponent.h:167
#define UNDEFINED_RETURNVALUE_ACCESSOR(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:31
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: sensorFieldOfViewStateComponent.h:178
Contains the DtUUID class declaration.
3) Define the current frame class. This will be used for read access.
Definition: sensorFieldOfViewStateComponent.h:120
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
void updateDataStorage()
Implement to update data storage. Called from advanceFrame.
Definition: sensorFieldOfViewStateComponent.h:172
const DtFrameStateInterface * currentFrameState() const
Definition: sensorFieldOfViewStateComponent.h:168
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:336
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:219
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:365
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
virtual void aboutToBeDeleted()
void setTargetedEntity(const DtUUID &u)
Definition: sensorFieldOfViewStateComponent.h:151
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
VRF::WriteSensorFieldOfViewRepository myWriteSensorFieldOfViewRepository
Definition: sensorFieldOfViewStateComponent.h:114
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:115
int myCallbackHandle
Definition: sensorFieldOfViewStateComponent.h:157
virtual const DtFrameStateInterface * nextFrameState() const
Definition: sensorFieldOfViewStateComponent.h:170
#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
DtStateData * myStateData
Definition: sensorFieldOfViewStateComponent.h:156
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:282
DtUUID myTargetedEntity
Definition: sensorFieldOfViewStateComponent.h:155

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)