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)
36 : myUUID(
DtUUID::nullUUID())
38 , myCheckForNameReservation(true)
39 , myPhysicalLineHeight(0.)
40 , myPhysicalLineWidth(0.)
95 double myPhysicalLineHeight;
97 double myPhysicalLineWidth;
99 double myCeilingHeight;
101 unsigned long long myUserData = 0;
105 DtString myMarkingText;
107 DtEntityIdentifier myEntityId;
113 bool myCheckForNameReservation;
128 : DtSimulatedObjectStateComponent(storage)
129 , myUUIDColumn(0xFFFFFFFF)
130 , myMarkingTextColumn(0xFFFFFFFF)
131 , myForceTypeColumn(0xFFFFFFFF)
132 , myEntityIdColumn(0xFFFFFFFF)
133 , myAppearanceBitsColumn(0xFFFFFFFF)
134 , myObjectTypeColumn(0xFFFFFFFF)
160 virtual
double intelAreaModifierForForce(
int forceType)
const {
throw DtUnimplementedMethod(
"intelAreaModifierForForce(int) is not implemented for this class"); };
206 virtual const int penStyle()
const override;
207 virtual const int fillStyle()
const override;
208 virtual const int lineWidth()
const override;
210 virtual const bool& isLocal()
const override;
211 virtual void setIsLocal(
const bool&)
override;
213 virtual const unsigned long long orbatId()
const override {
return 0; };
214 virtual void setOrbatId(
const unsigned long long&)
override {}
216 virtual const bool& checkForNameReservation()
const override;
217 virtual void setCheckForNameReservation(
const bool&)
override;
219 virtual const DtString& globalId()
const override;
220 virtual void setGlobalId(
const DtString&)
override;
222 virtual const DtUUID& uuid()
const override;
223 virtual void setUUID(
const DtUUID&)
override;
225 virtual const DtString& markingText()
const override;
226 virtual void setMarkingText(
const DtString&)
override;
229 virtual const DtString& sidc()
const override;
231 virtual void setSidc(
const DtString&)
override;
233 virtual const DtForceType forceType()
const override;
234 virtual void setForceType(
const DtForceType&)
override;
236 virtual const UInt32 appearanceBits()
const override;
237 virtual void setAppearanceBits(
const UInt32&)
override;
238 void setAppearance(
const DtAppearance&);
240 virtual const DtEntityType
entityType()
const override {
return objectType(); };
241 virtual const DtEntityType objectType()
const override;
242 virtual void setEntityType(
const DtEntityType& t)
override;
244 virtual const DtSimulationAddress simEngineAddress()
const override;
246 virtual const unsigned long long userLongLongData()
const override;
247 virtual void setUserLongLongData(
const unsigned long long&)
override;
249 virtual const DtEntityIdentifier& entityId()
const override;
250 virtual void setEntityId(
const DtEntityIdentifier&)
override;
252 virtual const int tickPeriod()
const override;
253 virtual void setTickPeriod(
const int&)
override;
255 virtual const int color()
const override;
256 virtual void setColor(
const int&)
override;
258 virtual const DtString userData()
const override;
259 virtual void setUserData(
const DtString&)
override;
261 virtual const double& physicalLineHeight()
const override;
262 virtual void setPhysicalLineHeight(
const double&)
override;
264 virtual const double& ceilingHeight()
const override;
265 virtual void setCeilingHeight(
const double&)
override;
267 virtual const double& physicalLineWidth()
const override;
268 virtual void setPhysicalLineWidth(
const double&)
override;
271 double floor()
const;
274 virtual void makeWritable()
override;
277 virtual void makeReadOnly()
override;
280 virtual int recordCount()
const override;
283 virtual std::vector<UInt64> records()
const override;
286 virtual void addRecord(Legion::WriteStateInstance)
override;
289 virtual void removeRecord(Legion::WriteStateInstance)
override;
292 virtual UInt64 instanceHandle()
const override;
295 void updateVrfStateComponentParameters();
299 void updatePhysicalLineHeightInformation();
301 void updateCeilingInformation();
303 void updatePhysicalLineWidthInformation();
327 virtual const bool& isLocal()
const override;
328 virtual const bool& checkForNameReservation()
const override;
329 virtual const DtString& globalId()
const override;
330 virtual const DtUUID& uuid()
const override;
331 virtual const DtString& markingText()
const override;
333 virtual const DtString& sidc()
const override;
334 virtual const DtForceType forceType()
const override;
335 virtual const DtEntityType
entityType()
const override {
return objectType(); };
336 virtual const DtEntityType objectType()
const override;
337 virtual const DtEntityIdentifier& entityId()
const override;
338 virtual const UInt32 appearanceBits()
const override;
339 virtual const int tickPeriod()
const override;
340 virtual const int color()
const override;
341 virtual const DtString userData()
const override;
342 virtual const double& physicalLineHeight()
const override;
343 virtual const double& physicalLineWidth()
const override;
344 virtual const double& ceilingHeight()
const override;
345 virtual double intelAreaModifierForForce(
int forceType)
const override;
346 virtual const unsigned long long userLongLongData()
const override;
347 virtual const unsigned long long orbatId()
const override {
return 0; };
348 virtual const DtSimulationAddress simEngineAddress()
const override;
350 virtual const int penStyle()
const override;
351 virtual const int fillStyle()
const override;
352 virtual const int lineWidth()
const override;
355 bool readComponentValid()
const;
359 bool findReadComponent();
362 virtual int recordCount()
const override;
365 virtual std::vector<UInt64> records()
const override;
368 virtual UInt64 instanceHandle()
const override;
372 bool checkForUpdatedItems();
376 const DtUUID _uuid()
const;
378 const DtString _markingText()
const;
380 const DtEntityIdentifier _entityId()
const;
383 void completeSetup();
385 void updateVrfStateComponentParameters();
388 void updatePhysicalLineHeightInformation();
390 void updateCeilingInformation();
392 void updatePhysicalLineWidthInformation();
396 void handleDataUpdated(
const std::vector<UInt32>& attributesUpdated);
399 bool checkUUIDChanged();
402 bool checkForceChanged();
405 bool checkMarkingTextChanged();
408 bool checkEntityIdChanged();
465 virtual bool forceAdvance()
override;
468 static void addAdditionalTableColumns(Legion::SimulationDatabase* db);
473 if (!myFoundComponent)
475 myFoundComponent = myCurrentFrameState.findReadComponent();
478 if (myNextFrameState.isWritable())
480 myNextFrameState.updateVrfStateComponentParameters();
481 myCurrentFrameState.checkForUpdatedItems();
484 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
485 myCurrentFrameState.emitComponentUpdated();
492 myCurrentFrameState.updateStateData(sd);
493 myNextFrameState.updateStateData(sd);
497 virtual void convertToRemote()
override;
500 virtual void convertToLocal()
override;
503 virtual Legion::WriteStateInstance
writeStateInstance()
override {
return myWriteEnvironmentProcessRepository; };
505 virtual void addAdditionalStateComponents()
override;
508 virtual void firstFrameAdvance()
override;
514 myCurrentFrameState.aboutToBeDeleted();
515 myNextFrameState.aboutToBeDeleted();
UUID is a unique ID wrapper class.
Definition: uuid.h:59
Instances of DtVrfObjectParameters are the readable/writeable objects that contain the information ne...
Definition: vrfObjectParameters.h:64
bool myFoundComponent
True once the read component has been successfully located.
Definition: environmentalStateComponent.h:528
double myPhysicalLineHeight
Accessor/mutator for the visual Sidc Code.
Definition: environmentalStateComponent.h:95
UInt32 myCenterPointColumn
Column index for the center-point position attribute.
Definition: environmentalStateComponent.h:432
DtEnvironmentalStateComponentData & operator=(const DtEnvironmentalStateComponentData &orig)
Definition: environmentalStateComponent.h:61
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: environmentalStateComponent.h:446
DtEnvironmentalStateComponentData & frameState()
Definition: environmentalStateComponent.h:204
Exception thrown when a required method has not been implemented.
Definition: stateDataTypes.h:30
virtual Legion::WriteStateInstance writeStateInstance() override
Returns the write state instance for the underlying environment process repository.
Definition: environmentalStateComponent.h:503
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:203
virtual std::vector< UInt64 > records() const
Returns instance handles to all the records in this environmental.
Definition: environmentalStateComponent.h:166
LOM::WriteEnvironmentProcessRepository myWriteEnvironmentProcessRepository
Write-access repository for the underlying Legion environment process.
Definition: environmentalStateComponent.h:526
DtEnvironmentalStateComponentData(const DtEnvironmentalStateComponentData &orig)
Definition: environmentalStateComponent.h:45
virtual void aboutToBeDeleted() override
Called before this component is deleted; notifies both frame states.
Definition: environmentalStateComponent.h:511
unsigned int myCallbackHandle
Handle for the VRF environment record attribute-update callback.
Definition: environmentalStateComponent.h:428
bool isDoubleBuffered()
Returns true, indicating this component uses double-buffered data storage.
Definition: environmentalStateComponent.h:456
DtEnvironmentalStateComponentData myData
Cached state data for this current-frame component.
Definition: environmentalStateComponent.h:441
unsigned int UInt32
32-bit unsigned integer type.
Definition: stateDataTypes.h:21
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
virtual void setOrbatId(const unsigned long long &) override
Definition: environmentalStateComponent.h:214
UInt32 myOrientationColumn
Column index for the orientation attribute.
Definition: environmentalStateComponent.h:434
The DtSimulatedObjectStateComponent is an interface that all main components (those that are consider...
Definition: simulatedObjectStateComponent.h:21
double myCeilingHeight
Ceiling height of the environmental object, in meters above the floor.
Definition: environmentalStateComponent.h:99
std::string myMarkingText
Cached marking text string for change detection.
Definition: environmentalStateComponent.h:438
DtEnvironmentalStateComponentCurrentFrame myCurrentFrameState
The current-frame state for read access.
Definition: environmentalStateComponent.h:522
VRF::ReadVrfEnvironmentRecordRepository myReadVrfEnvironmentRecordRepository
Read-access repository for the VRF-specific environment record.
Definition: environmentalStateComponent.h:426
#define UNDEFINED_RETURNVALUE_ACCESSOR(ReturnType, Member)
Defines a virtual const accessor that throws DtUnimplementedMethod, marking the method as requiring a...
Definition: doubleBufferedDataStorage.h:53
virtual DtFrameStateInterface * nextFrameState() override
Returns a writable pointer to the next-frame state interface.
Definition: environmentalStateComponent.h:460
virtual int recordCount() const
Number of additional records.
Definition: environmentalStateComponent.h:163
DtEnvironmentalStateComponentData()
Definition: environmentalStateComponent.h:35
unsigned long long UInt64
64-bit unsigned integer type.
Definition: stateDataTypes.h:19
UInt32 myMarkingTextColumn
Column index for the marking text attribute in the simulation database.
Definition: environmentalStateComponent.h:181
void advanceFrame(const DtEnvironmentalStateComponentData &data)
Advances the internal data cache to the given snapshot.
Definition: environmentalStateComponent.h:413
DtStateComponentCreator< DtEnvironmentalStateComponentImplementation > DtEnvironmentalStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: environmentalStateComponent.h:537
DtString mySidc
Visual Sidc code.
Definition: environmentalStateComponent.h:117
VRF::WriteVrfEnvironmentRecordRepository myWriteVrfEnvironmentRecordRepository
Write-access repository for the VRF-specific environment record.
Definition: environmentalStateComponent.h:309
DtRwIntelCollectionArea * myIntelCollectionAreaInformation
Intel collection area information parsed from extended data.
Definition: environmentalStateComponent.h:422
virtual void updateDataStorage() override
Advances the double-buffer and propagates next-frame data to the current frame.
Definition: environmentalStateComponent.h:471
UInt32 myAppearanceBitsColumn
Column index for the appearance bits attribute in the simulation database.
Definition: environmentalStateComponent.h:187
virtual const unsigned long long orbatId() const override
Definition: environmentalStateComponent.h:347
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
2) Define the next frame class. This will be used for write access.
Definition: environmentalStateComponent.h:193
#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
int myTickPeriod
Tick period override for this environmental object; -1 uses the default period.
Definition: environmentalStateComponent.h:115
LOM::ReadEnvironmentProcessRepository myReadEnvironmentProcessRepository
Read-access repository for the Legion environment process record.
Definition: environmentalStateComponent.h:424
bool myCheckForNameReservation
True if the simulation should check whether a name is already reserved before claiming it...
Definition: environmentalStateComponent.h:113
virtual const unsigned long long orbatId() const override
Definition: environmentalStateComponent.h:213
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:489
DtString myMarkingText
Human-readable marking text label for this environmental object.
Definition: environmentalStateComponent.h:105
bool myCheckedForVrfStateComponent
True once a check for the VRF state component has been performed.
Definition: environmentalStateComponent.h:530
3) Define the current frame class. This will be used for read access.
Definition: environmentalStateComponent.h:315
unsigned int myDataCallbackHandle
Handle for the environment process attribute-update callback.
Definition: environmentalStateComponent.h:430
DtEnvironmentalStateComponentNextFrame myNextFrameState
The next-frame state for write access.
Definition: environmentalStateComponent.h:524
#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
Data container for environmental objects such as lines, areas, and points. Stores physical and identi...
Definition: environmentalStateComponent.h:33
virtual void aboutToBeDeleted()
Called when the component is about to be deleted; emits signal_stateComponentAboutToBeDeleted.
UInt32 myForceTypeColumn
Column index for the force type attribute in the simulation database.
Definition: environmentalStateComponent.h:183
boost::signals2::scoped_connection myVrfStateComponentChangedConnection
Connection to the VRF state component's extended-data-modified signal.
Definition: environmentalStateComponent.h:532
virtual const DtFrameStateInterface * nextFrameState() const override
Returns a const pointer to the next-frame state interface.
Definition: environmentalStateComponent.h:462
const DtEnvironmentalStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: environmentalStateComponent.h:325
class DtRwIntelCollectionArea:
Definition: rwIntelCollectionArea.h:22
#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
UInt32 myObjectTypeColumn
Column index for the object type attribute in the simulation database.
Definition: environmentalStateComponent.h:189
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Defines a const reference accessor and an inline setter for a member variable.
Definition: doubleBufferedDataStorage.h:37
int myForceId
Cached force type identifier for change detection.
Definition: environmentalStateComponent.h:436
double myPhysicalLineWidth
Physical width of the environmental line object, in meters.
Definition: environmentalStateComponent.h:97
Definition: stateComponent.h:64
virtual const DtEntityType entityType() const override
Definition: environmentalStateComponent.h:240
DtEntityIdentifier myEntityId
DIS entity identifier for this environmental object.
Definition: environmentalStateComponent.h:107
virtual const DtEntityType entityType() const override
Definition: environmentalStateComponent.h:335
LOM::WriteEnvironmentProcessRepository myWriteEnvironmentProcessRepository
Write-access repository for the Legion environment process record.
Definition: environmentalStateComponent.h:307
virtual void removeRecord(Legion::WriteStateInstance)
Removes a record from this environmental (this must be an instance handle)
Definition: environmentalStateComponent.h:172
#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
bool myIsLocal
True if this environmental object is locally owned by this simulation engine.
Definition: environmentalStateComponent.h:111
virtual void updateStateData(DtStateData *sd) override
Updates the state data pointer on both frame states.
Definition: environmentalStateComponent.h:490
DtUUID myUUID
Universally unique identifier for this environmental object.
Definition: environmentalStateComponent.h:109
DtString myGlobalId
Global identifier string for this environmental object.
Definition: environmentalStateComponent.h:103
UInt32 myEntityIdColumn
Column index for the entity identifier attribute in the simulation database.
Definition: environmentalStateComponent.h:185
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
DtEnvironmentalStateComponentData myData
Cached state data for this next-frame component.
Definition: environmentalStateComponent.h:311
virtual const DtFrameStateInterface * currentFrameState() const override
Returns a const pointer to the current-frame state interface.
Definition: environmentalStateComponent.h:458
unsigned long long myUserData
Application-defined user data attached to this environmental object.
Definition: environmentalStateComponent.h:101
virtual void addRecord(Legion::WriteStateInstance)
Adds a new record to this environmental (this must be an instance handle)
Definition: environmentalStateComponent.h:169
boost::signals2::scoped_connection myVrfStateComponentChangedConnection
Connection to the VRF state component's extended-data-modified signal.
Definition: environmentalStateComponent.h:420
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:122