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>
20 #define DtLineWidthFromAppearance(theAppr) ((theAppr >> 28) & 0x0000000F)
21 #define DtLineWidthToAppearance(theLineWidth) (theLineWidth << 28)
22 #define DtLineStyleFromAppearance(theAppr) ((theAppr >> 8) & 0x0000000F)
23 #define DtLineStyleToAppearance(theLineStyle) (theLineStyle << 8)
24 #define DtFillStyleFromAppearance(theAppr) ((theAppr >> 12) & 0x0000000F)
25 #define DtFillStyleToAppearance(theFillStyle) (theFillStyle << 12)
34 : myUUID(
DtUUID::nullUUID())
36 , myCheckForNameReservation(true)
37 , myPhysicalLineHeight(0.)
38 , myPhysicalLineWidth(0.)
88 double myPhysicalLineHeight;
89 double myPhysicalLineWidth;
90 double myCeilingHeight;
91 unsigned long long myUserData = 0;
93 DtString myMarkingText;
94 DtEntityIdentifier myEntityId;
97 bool myCheckForNameReservation;
109 : DtSimulatedObjectStateComponent(storage)
110 , myUUIDColumn(0xFFFFFFFF)
111 , myMarkingTextColumn(0xFFFFFFFF)
112 , myForceTypeColumn(0xFFFFFFFF)
113 , myEntityIdColumn(0xFFFFFFFF)
114 , myAppearanceBitsColumn(0xFFFFFFFF)
115 , myObjectTypeColumn(0xFFFFFFFF)
129 virtual
double intelAreaModifierForForce(
int forceType)
const {
throw DtUnimplementedMethod(
"intelAreaModifierForForce(int) is not implemented for this class"); };
166 virtual const int penStyle()
const override;
167 virtual const int fillStyle()
const override;
168 virtual const int lineWidth()
const override;
170 virtual const bool& isLocal()
const override;
171 virtual void setIsLocal(
const bool&)
override;
173 virtual const unsigned long long orbatId()
const override {
return 0; };
174 virtual void setOrbatId(
const unsigned long long&)
override {}
176 virtual const bool& checkForNameReservation()
const override;
177 virtual void setCheckForNameReservation(
const bool&)
override;
179 virtual const DtString& globalId()
const override;
180 virtual void setGlobalId(
const DtString&)
override;
182 virtual const DtUUID& uuid()
const override;
183 virtual void setUUID(
const DtUUID&)
override;
185 virtual const DtString& markingText()
const override;
186 virtual void setMarkingText(
const DtString&)
override;
188 virtual const DtForceType forceType()
const override;
189 virtual void setForceType(
const DtForceType&)
override;
191 virtual const UInt32 appearanceBits()
const override;
192 virtual void setAppearanceBits(
const UInt32&)
override;
193 void setAppearance(
const DtAppearance&);
195 virtual const DtEntityType
entityType()
const override {
return objectType(); };
196 virtual const DtEntityType objectType()
const override;
197 virtual void setEntityType(
const DtEntityType& t)
override;
199 virtual const DtSimulationAddress simEngineAddress()
const override;
201 virtual const unsigned long long userLongLongData()
const override;
202 virtual void setUserLongLongData(
const unsigned long long&)
override;
204 virtual const DtEntityIdentifier& entityId()
const override;
205 virtual void setEntityId(
const DtEntityIdentifier&)
override;
207 virtual const int tickPeriod()
const override;
208 virtual void setTickPeriod(
const int&)
override;
210 virtual const int color()
const override;
211 virtual void setColor(
const int&)
override;
213 virtual const DtString userData()
const override;
214 virtual void setUserData(
const DtString&)
override;
216 virtual const double& physicalLineHeight()
const override;
217 virtual void setPhysicalLineHeight(
const double&)
override;
219 virtual const double& ceilingHeight()
const override;
220 virtual void setCeilingHeight(
const double&)
override;
222 virtual const double& physicalLineWidth()
const override;
223 virtual void setPhysicalLineWidth(
const double&)
override;
226 double floor()
const;
229 virtual void makeWritable()
override;
232 virtual void makeReadOnly()
override;
234 virtual int recordCount()
const override;
237 virtual std::vector<UInt64> records()
const override;
240 virtual void addRecord(Legion::WriteStateInstance)
override;
243 virtual void removeRecord(Legion::WriteStateInstance)
override;
246 virtual UInt64 instanceHandle()
const override;
248 void updateVrfStateComponentParameters();
251 void updatePhysicalLineHeightInformation();
252 void updateCeilingInformation();
253 void updatePhysicalLineWidthInformation();
271 virtual const bool& isLocal()
const override;
272 virtual const bool& checkForNameReservation()
const override;
273 virtual const DtString& globalId()
const override;
274 virtual const DtUUID& uuid()
const override;
275 virtual const DtString& markingText()
const override;
276 virtual const DtForceType forceType()
const override;
277 virtual const DtEntityType
entityType()
const override {
return objectType(); };
278 virtual const DtEntityType objectType()
const override;
279 virtual const DtEntityIdentifier& entityId()
const override;
280 virtual const UInt32 appearanceBits()
const override;
281 virtual const int tickPeriod()
const override;
282 virtual const int color()
const override;
283 virtual const DtString userData()
const override;
284 virtual const double& physicalLineHeight()
const override;
285 virtual const double& physicalLineWidth()
const override;
286 virtual const double& ceilingHeight()
const override;
287 virtual double intelAreaModifierForForce(
int forceType)
const override;
288 virtual const unsigned long long userLongLongData()
const override;
289 virtual const unsigned long long orbatId()
const override {
return 0; };
290 virtual const DtSimulationAddress simEngineAddress()
const override;
292 virtual const int penStyle()
const override;
293 virtual const int fillStyle()
const override;
294 virtual const int lineWidth()
const override;
296 bool readComponentValid()
const;
298 bool findReadComponent();
300 virtual int recordCount()
const override;
303 virtual std::vector<UInt64> records()
const override;
306 virtual UInt64 instanceHandle()
const override;
308 bool checkForUpdatedItems();
311 const DtUUID _uuid()
const;
312 const DtString _markingText()
const;
313 const DtEntityIdentifier _entityId()
const;
315 void completeSetup();
316 void updateVrfStateComponentParameters();
318 void updatePhysicalLineHeightInformation();
319 void updateCeilingInformation();
320 void updatePhysicalLineWidthInformation();
322 void handleDataUpdated(
const std::vector<UInt32>& attributesUpdated);
323 bool checkUUIDChanged();
324 bool checkForceChanged();
325 bool checkMarkingTextChanged();
326 bool checkEntityIdChanged();
363 virtual bool forceAdvance()
override;
364 static void addAdditionalTableColumns(Legion::SimulationDatabase* db);
368 if (!myFoundComponent)
370 myFoundComponent = myCurrentFrameState.findReadComponent();
373 if (myNextFrameState.isWritable())
375 myNextFrameState.updateVrfStateComponentParameters();
376 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
379 myCurrentFrameState.checkForUpdatedItems();
380 myCurrentFrameState.emitComponentUpdated();
385 myCurrentFrameState.updateStateData(sd);
386 myNextFrameState.updateStateData(sd);
390 virtual void convertToRemote()
override;
393 virtual void convertToLocal()
override;
395 virtual Legion::WriteStateInstance
writeStateInstance()
override {
return myWriteEnvironmentProcessRepository; };
397 virtual void addAdditionalStateComponents()
override;
400 virtual void firstFrameAdvance()
override;
405 myCurrentFrameState.aboutToBeDeleted();
406 myNextFrameState.aboutToBeDeleted();
UUID is a unique ID wrapper class.
Definition: uuid.h:59
bool myFoundComponent
Definition: environmentalStateComponent.h:413
double myPhysicalLineHeight
Definition: environmentalStateComponent.h:88
UInt32 myCenterPointColumn
Definition: environmentalStateComponent.h:341
DtEnvironmentalStateComponentData & operator=(const DtEnvironmentalStateComponentData &orig)
Definition: environmentalStateComponent.h:58
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: environmentalStateComponent.h:351
DtEnvironmentalStateComponentData & frameState()
Definition: environmentalStateComponent.h:164
Definition: stateDataTypes.h:23
virtual Legion::WriteStateInstance writeStateInstance() override
Definition: environmentalStateComponent.h:395
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:163
virtual std::vector< UInt64 > records() const
Returns instance handles to all the records in this environmental.
Definition: environmentalStateComponent.h:135
LOM::WriteEnvironmentProcessRepository myWriteEnvironmentProcessRepository
Definition: environmentalStateComponent.h:412
DtEnvironmentalStateComponentData(const DtEnvironmentalStateComponentData &orig)
Definition: environmentalStateComponent.h:43
virtual void aboutToBeDeleted() override
Definition: environmentalStateComponent.h:402
unsigned int myCallbackHandle
Definition: environmentalStateComponent.h:339
bool isDoubleBuffered()
Definition: environmentalStateComponent.h:357
DtEnvironmentalStateComponentData myData
Definition: environmentalStateComponent.h:346
unsigned int UInt32
Definition: stateDataTypes.h:18
Definition: stateComponent.h:269
virtual void setOrbatId(const unsigned long long &) override
Definition: environmentalStateComponent.h:174
UInt32 myOrientationColumn
Definition: environmentalStateComponent.h:342
The DtSimulatedObjectStateComponent is an interface that all main components (those that are consider...
Definition: simulatedObjectStateComponent.h:21
double myCeilingHeight
Definition: environmentalStateComponent.h:90
std::string myMarkingText
Definition: environmentalStateComponent.h:344
DtEnvironmentalStateComponentCurrentFrame myCurrentFrameState
Definition: environmentalStateComponent.h:410
VRF::ReadVrfEnvironmentRecordRepository myReadVrfEnvironmentRecordRepository
Definition: environmentalStateComponent.h:338
#define UNDEFINED_RETURNVALUE_ACCESSOR(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:31
virtual DtFrameStateInterface * nextFrameState() override
Definition: environmentalStateComponent.h:359
virtual int recordCount() const
Number of additional records.
Definition: environmentalStateComponent.h:132
DtEnvironmentalStateComponentData()
Definition: environmentalStateComponent.h:33
unsigned long long UInt64
Definition: stateDataTypes.h:17
UInt32 myMarkingTextColumn
Definition: environmentalStateComponent.h:148
void advanceFrame(const DtEnvironmentalStateComponentData &data)
Definition: environmentalStateComponent.h:329
DtStateComponentCreator< DtEnvironmentalStateComponentImplementation > DtEnvironmentalStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: environmentalStateComponent.h:420
VRF::WriteVrfEnvironmentRecordRepository myWriteVrfEnvironmentRecordRepository
Definition: environmentalStateComponent.h:257
DtRwIntelCollectionArea * myIntelCollectionAreaInformation
Definition: environmentalStateComponent.h:336
virtual void updateDataStorage() override
Implement to update data storage. Called from advanceFrame.
Definition: environmentalStateComponent.h:366
UInt32 myAppearanceBitsColumn
Definition: environmentalStateComponent.h:151
virtual const unsigned long long orbatId() const override
Definition: environmentalStateComponent.h:289
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:398
2) Define the next frame class. This will be used for write access.
Definition: environmentalStateComponent.h:156
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:231
int myTickPeriod
Definition: environmentalStateComponent.h:98
LOM::ReadEnvironmentProcessRepository myReadEnvironmentProcessRepository
Definition: environmentalStateComponent.h:337
bool myCheckForNameReservation
Definition: environmentalStateComponent.h:97
virtual const unsigned long long orbatId() const override
Definition: environmentalStateComponent.h:173
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:384
DtString myMarkingText
Definition: environmentalStateComponent.h:93
bool myCheckedForVrfStateComponent
Definition: environmentalStateComponent.h:414
3) Define the current frame class. This will be used for read access.
Definition: environmentalStateComponent.h:262
unsigned int myDataCallbackHandle
Definition: environmentalStateComponent.h:340
DtEnvironmentalStateComponentNextFrame myNextFrameState
Definition: environmentalStateComponent.h:411
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
Definition: environmentalStateComponent.h:31
virtual void aboutToBeDeleted()
UInt32 myForceTypeColumn
Definition: environmentalStateComponent.h:149
boost::signals2::scoped_connection myVrfStateComponentChangedConnection
Definition: environmentalStateComponent.h:415
virtual const DtFrameStateInterface * nextFrameState() const override
Definition: environmentalStateComponent.h:360
const DtEnvironmentalStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: environmentalStateComponent.h:269
class DtRwIntelCollectionArea:
Definition: rwIntelCollectionArea.h:22
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
UInt32 myObjectTypeColumn
Definition: environmentalStateComponent.h:152
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
int myForceId
Definition: environmentalStateComponent.h:343
double myPhysicalLineWidth
Definition: environmentalStateComponent.h:89
Definition: stateComponent.h:64
virtual const DtEntityType entityType() const override
Definition: environmentalStateComponent.h:195
DtEntityIdentifier myEntityId
Definition: environmentalStateComponent.h:94
virtual const DtEntityType entityType() const override
Definition: environmentalStateComponent.h:277
LOM::WriteEnvironmentProcessRepository myWriteEnvironmentProcessRepository
Definition: environmentalStateComponent.h:256
virtual void removeRecord(Legion::WriteStateInstance)
Removes a record from this environmental (this must be an instance handle)
Definition: environmentalStateComponent.h:141
#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:96
virtual void updateStateData(DtStateData *sd) override
Implement to update data storage to the new state data.
Definition: environmentalStateComponent.h:383
DtUUID myUUID
Definition: environmentalStateComponent.h:95
DtString myGlobalId
Definition: environmentalStateComponent.h:92
UInt32 myEntityIdColumn
Definition: environmentalStateComponent.h:150
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:294
DtEnvironmentalStateComponentData myData
Definition: environmentalStateComponent.h:258
virtual const DtFrameStateInterface * currentFrameState() const override
Definition: environmentalStateComponent.h:358
unsigned long long myUserData
Definition: environmentalStateComponent.h:91
virtual void addRecord(Legion::WriteStateInstance)
Adds a new record to this environmental (this must be an instance handle)
Definition: environmentalStateComponent.h:138
boost::signals2::scoped_connection myVrfStateComponentChangedConnection
Definition: environmentalStateComponent.h:335
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:103