10 #include <legionStandardOM/sets/readEnvironmentProcessRepository.hpp>
11 #include <legionStandardOM/sets/writeEnvironmentProcessRepository.hpp>
12 #include "vrfOM/sets/writeVrfEnvironmentRecordRepository.hpp"
13 #include "vrfOM/sets/readVrfEnvironmentRecordRepository.hpp"
14 #include <boost/signals2.hpp>
16 #include <vlutil/vlString.h>
27 : myUUID(
DtUUID::nullUUID())
29 , myPhysicalLineHeight(0.)
30 , myPhysicalLineWidth(0.)
74 double myPhysicalLineHeight;
75 double myPhysicalLineWidth;
76 double myCeilingHeight;
78 DtString myMarkingText;
79 DtEntityIdentifier myEntityId;
93 : DtSimulatedObjectStateComponent(storage)
94 , myUUIDColumn(0xFFFFFFFF)
95 , myMarkingTextColumn(0xFFFFFFFF)
96 , myForceTypeColumn(0xFFFFFFFF)
97 , myEntityIdColumn(0xFFFFFFFF)
98 , myAppearanceBitsColumn(0xFFFFFFFF)
99 , myObjectTypeColumn(0xFFFFFFFF)
110 virtual
double intelAreaModifierForForce(
int forceType)
const {
throw DtUnimplementedMethod(
"intelAreaModifierForForce(int) is not implemented for this class"); };
147 const bool& isLocal()
const;
148 void setIsLocal(
const bool&);
153 const DtUUID& uuid()
const;
154 void setUUID(
const DtUUID&);
156 const DtString& markingText()
const;
157 void setMarkingText(
const DtString&);
159 const DtForceType forceType()
const;
160 void setForceType(
const DtForceType&);
162 const UInt32 appearanceBits()
const;
163 void setAppearanceBits(
const UInt32&);
164 void setAppearance(
const DtAppearance&);
166 const DtEntityType
entityType()
const {
return DtEntityType(objectType()); };
168 void setEntityType(
const DtEntityType& t);
170 const DtEntityIdentifier& entityId()
const;
171 void setEntityId(
const DtEntityIdentifier&);
173 const int tickPeriod()
const;
174 void setTickPeriod(
const int&);
176 const int color()
const;
177 void setColor(
const int&);
182 const double& physicalLineHeight()
const;
183 void setPhysicalLineHeight(
const double&);
185 const double& ceilingHeight()
const;
186 void setCeilingHeight(
const double&);
188 const double& physicalLineWidth()
const;
189 void setPhysicalLineWidth(
const double&);
192 double floor()
const;
195 virtual void makeWritable();
198 virtual void makeReadOnly();
200 int recordCount()
const;
203 std::vector<UInt64> records()
const;
206 void addRecord(Legion::WriteStateInstance);
209 void removeRecord(Legion::WriteStateInstance);
212 UInt64 instanceHandle()
const;
214 void updateVrfStateComponentParameters();
217 void updatePhysicalLineHeightInformation();
218 void updateCeilingInformation();
219 void updatePhysicalLineWidthInformation();
238 const bool& isLocal()
const;
240 const DtUUID& uuid()
const;
241 const DtString& markingText()
const;
242 const DtForceType forceType()
const;
243 const DtEntityType
entityType()
const {
return DtEntityType(objectType()); };
245 const DtEntityIdentifier& entityId()
const;
246 const UInt32 appearanceBits()
const;
247 const int tickPeriod()
const;
248 const int color()
const;
250 const double& physicalLineHeight()
const;
251 const double& physicalLineWidth()
const;
252 const double& ceilingHeight()
const;
253 double intelAreaModifierForForce(
int forceType)
const;
255 bool readComponentValid()
const;
257 bool findReadComponent();
259 virtual int recordCount()
const;
262 virtual std::vector<UInt64> records()
const;
265 UInt64 instanceHandle()
const;
267 bool checkForUpdatedItems();
270 const DtUUID _uuid()
const;
271 const DtString _markingText()
const;
272 const DtEntityIdentifier _entityId()
const;
274 void completeSetup();
275 void updateVrfStateComponentParameters();
277 void updatePhysicalLineHeightInformation();
278 void updateCeilingInformation();
279 void updatePhysicalLineWidthInformation();
281 void handleDataUpdated(
const std::vector<UInt32>& attributesUpdated);
282 bool checkUUIDChanged();
283 bool checkForceChanged();
284 bool checkMarkingTextChanged();
285 bool checkEntityIdChanged();
323 virtual bool forceAdvance();
324 static void addAdditionalTableColumns(Legion::SimulationDatabase* db);
328 if (!myFoundComponent)
330 myFoundComponent = myCurrentFrameState.findReadComponent();
333 if (myNextFrameState.isWritable())
335 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
338 myCurrentFrameState.checkForUpdatedItems();
339 myCurrentFrameState.emitComponentUpdated();
344 myCurrentFrameState.updateStateData(sd);
345 myNextFrameState.updateStateData(sd);
349 virtual void convertToRemote();
352 virtual void convertToLocal();
354 Legion::WriteStateInstance
writeStateInstance()
override {
return myWriteEnvironmentProcessRepository; };
356 virtual void addAdditionalStateComponents()
override;
359 virtual void firstFrameAdvance()
override;
364 myCurrentFrameState.aboutToBeDeleted();
365 myNextFrameState.aboutToBeDeleted();
UUID is a unique ID wrapper class.
Definition: rwUUID.h:229
bool myFoundComponent
Definition: environmentalStateComponent.h:372
double myPhysicalLineHeight
Definition: environmentalStateComponent.h:74
UInt32 myCenterPointColumn
Definition: environmentalStateComponent.h:300
unsigned int UInt32
Definition: stateDataTypes.h:18
DtEnvironmentalStateComponentData & operator=(const DtEnvironmentalStateComponentData &orig)
Definition: environmentalStateComponent.h:48
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: environmentalStateComponent.h:311
DtEnvironmentalStateComponentData & frameState()
Definition: environmentalStateComponent.h:145
Definition: stateDataTypes.h:23
DT_DLL_vrfStateData Legion::AttributeSetId theVrfEnvironmentRecordSetType
const DtEnvironmentalStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: environmentalStateComponent.h:144
virtual std::vector< UInt64 > records() const
Returns instance handles to all the records in this environmental.
Definition: environmentalStateComponent.h:116
LOM::WriteEnvironmentProcessRepository myWriteEnvironmentProcessRepository
Definition: environmentalStateComponent.h:371
DtEnvironmentalStateComponentData(const DtEnvironmentalStateComponentData &orig)
Definition: environmentalStateComponent.h:35
virtual void aboutToBeDeleted() override
Definition: environmentalStateComponent.h:361
unsigned int myCallbackHandle
Definition: environmentalStateComponent.h:298
bool isDoubleBuffered()
Definition: environmentalStateComponent.h:317
DtEnvironmentalStateComponentData myData
Definition: environmentalStateComponent.h:306
Definition: stateComponent.h:257
UInt32 myOrientationColumn
Definition: environmentalStateComponent.h:301
The DtSimulatedObjectStateComponent is an interface that all main components (those that are consider...
Definition: simulatedObjectStateComponent.h:21
double myCeilingHeight
Definition: environmentalStateComponent.h:76
std::string myMarkingText
Definition: environmentalStateComponent.h:303
DtEnvironmentalStateComponentCurrentFrame myCurrentFrameState
Definition: environmentalStateComponent.h:369
VRF::ReadVrfEnvironmentRecordRepository myReadVrfEnvironmentRecordRepository
Definition: environmentalStateComponent.h:297
virtual int recordCount() const
Number of additional records.
Definition: environmentalStateComponent.h:113
DtEnvironmentalStateComponentData()
Definition: environmentalStateComponent.h:26
UInt32 myMarkingTextColumn
Definition: environmentalStateComponent.h:129
void advanceFrame(const DtEnvironmentalStateComponentData &data)
Definition: environmentalStateComponent.h:288
DtStateComponentCreator< DtEnvironmentalStateComponentImplementation > DtEnvironmentalStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: environmentalStateComponent.h:379
Definition: objectType.h:27
VRF::WriteVrfEnvironmentRecordRepository myWriteVrfEnvironmentRecordRepository
Definition: environmentalStateComponent.h:223
DtRwIntelCollectionArea * myIntelCollectionAreaInformation
Definition: environmentalStateComponent.h:295
UInt32 myAppearanceBitsColumn
Definition: environmentalStateComponent.h:132
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:336
2) Define the next frame class. This will be used for write access.
Definition: environmentalStateComponent.h:137
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:219
int myTickPeriod
Definition: environmentalStateComponent.h:82
LOM::ReadEnvironmentProcessRepository myReadEnvironmentProcessRepository
Definition: environmentalStateComponent.h:296
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: environmentalStateComponent.h:342
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:370
DtString myMarkingText
Definition: environmentalStateComponent.h:78
bool myCheckedForVrfStateComponent
Definition: environmentalStateComponent.h:373
3) Define the current frame class. This will be used for read access.
Definition: environmentalStateComponent.h:229
const DtEntityType entityType() const
Definition: environmentalStateComponent.h:166
unsigned int myDataCallbackHandle
Definition: environmentalStateComponent.h:299
DtEnvironmentalStateComponentNextFrame myNextFrameState
Definition: environmentalStateComponent.h:370
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
Definition: environmentalStateComponent.h:24
virtual void aboutToBeDeleted()
virtual DtFrameStateInterface * nextFrameState()
Definition: environmentalStateComponent.h:319
UInt32 myForceTypeColumn
Definition: environmentalStateComponent.h:130
boost::signals2::scoped_connection myVrfStateComponentChangedConnection
Definition: environmentalStateComponent.h:374
const DtEnvironmentalStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: environmentalStateComponent.h:236
class DtRwIntelCollectionArea:
Definition: rwIntelCollectionArea.h:22
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
Legion::WriteStateInstance writeStateInstance() override
Definition: environmentalStateComponent.h:354
UInt32 myObjectTypeColumn
Definition: environmentalStateComponent.h:133
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
int myForceId
Definition: environmentalStateComponent.h:302
double myPhysicalLineWidth
Definition: environmentalStateComponent.h:75
Definition: stateComponent.h:63
DtEntityIdentifier myEntityId
Definition: environmentalStateComponent.h:79
LOM::WriteEnvironmentProcessRepository myWriteEnvironmentProcessRepository
Definition: environmentalStateComponent.h:222
virtual void removeRecord(Legion::WriteStateInstance)
Removes a record from this environmental (this must be an instance handle)
Definition: environmentalStateComponent.h:122
#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
bool myIsLocal
Definition: environmentalStateComponent.h:81
DtStateData * myStateData
Definition: environmentalStateComponent.h:224
DtUUID myUUID
Definition: environmentalStateComponent.h:80
virtual const DtFrameStateInterface * nextFrameState() const
Definition: environmentalStateComponent.h:320
const DtEntityType entityType() const
Definition: environmentalStateComponent.h:243
const DtFrameStateInterface * currentFrameState() const
Definition: environmentalStateComponent.h:318
DtString myGlobalId
Definition: environmentalStateComponent.h:77
UInt32 myEntityIdColumn
Definition: environmentalStateComponent.h:131
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:282
DtStateData * myStateData
Definition: environmentalStateComponent.h:305
DtEnvironmentalStateComponentData myData
Definition: environmentalStateComponent.h:225
virtual void addRecord(Legion::WriteStateInstance)
Adds a new record to this environmental (this must be an instance handle)
Definition: environmentalStateComponent.h:119
boost::signals2::scoped_connection myVrfStateComponentChangedConnection
Definition: environmentalStateComponent.h:294
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: environmentalStateComponent.h:87
void updateDataStorage()
Implement to update data storage. Called from advanceFrame.
Definition: environmentalStateComponent.h:326