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 , myCheckForNameReservation(true)
30 , myPhysicalLineHeight(0.)
31 , myPhysicalLineWidth(0.)
78 double myPhysicalLineHeight;
79 double myPhysicalLineWidth;
80 double myCeilingHeight;
82 DtString myMarkingText;
83 DtEntityIdentifier myEntityId;
86 bool myCheckForNameReservation;
98 : DtSimulatedObjectStateComponent(storage)
99 , myUUIDColumn(0xFFFFFFFF)
100 , myMarkingTextColumn(0xFFFFFFFF)
101 , myForceTypeColumn(0xFFFFFFFF)
102 , myEntityIdColumn(0xFFFFFFFF)
103 , myAppearanceBitsColumn(0xFFFFFFFF)
104 , myObjectTypeColumn(0xFFFFFFFF)
115 virtual
double intelAreaModifierForForce(
int forceType)
const {
throw DtUnimplementedMethod(
"intelAreaModifierForForce(int) is not implemented for this class"); };
152 const bool& isLocal()
const;
153 void setIsLocal(
const bool&);
155 const bool& checkForNameReservation()
const;
156 void setCheckForNameReservation(
const bool&);
161 const DtUUID& uuid()
const;
162 void setUUID(
const DtUUID&);
164 const DtString& markingText()
const;
165 void setMarkingText(
const DtString&);
167 const DtForceType forceType()
const;
168 void setForceType(
const DtForceType&);
170 const UInt32 appearanceBits()
const;
171 void setAppearanceBits(
const UInt32&);
172 void setAppearance(
const DtAppearance&);
174 const DtEntityType
entityType()
const {
return DtEntityType(objectType()); };
175 const DtObjectType objectType()
const;
176 void setEntityType(
const DtEntityType& t);
178 const DtEntityIdentifier& entityId()
const;
179 void setEntityId(
const DtEntityIdentifier&);
181 const int tickPeriod()
const;
182 void setTickPeriod(
const int&);
184 const int color()
const;
185 void setColor(
const int&);
190 const double& physicalLineHeight()
const;
191 void setPhysicalLineHeight(
const double&);
193 const double& ceilingHeight()
const;
194 void setCeilingHeight(
const double&);
196 const double& physicalLineWidth()
const;
197 void setPhysicalLineWidth(
const double&);
200 double floor()
const;
203 virtual void makeWritable();
206 virtual void makeReadOnly();
208 int recordCount()
const;
211 std::vector<UInt64> records()
const;
214 void addRecord(Legion::WriteStateInstance);
217 void removeRecord(Legion::WriteStateInstance);
220 UInt64 instanceHandle()
const;
222 void updateVrfStateComponentParameters();
225 void updatePhysicalLineHeightInformation();
226 void updateCeilingInformation();
227 void updatePhysicalLineWidthInformation();
246 const bool& isLocal()
const;
247 const bool& checkForNameReservation()
const;
249 const DtUUID& uuid()
const;
250 const DtString& markingText()
const;
251 const DtForceType forceType()
const;
252 const DtEntityType
entityType()
const {
return DtEntityType(objectType()); };
253 const DtObjectType objectType()
const;
254 const DtEntityIdentifier& entityId()
const;
255 const UInt32 appearanceBits()
const;
256 const int tickPeriod()
const;
257 const int color()
const;
259 const double& physicalLineHeight()
const;
260 const double& physicalLineWidth()
const;
261 const double& ceilingHeight()
const;
262 double intelAreaModifierForForce(
int forceType)
const;
264 bool readComponentValid()
const;
266 bool findReadComponent();
268 virtual int recordCount()
const;
271 virtual std::vector<UInt64> records()
const;
274 UInt64 instanceHandle()
const;
276 bool checkForUpdatedItems();
279 const DtUUID _uuid()
const;
280 const DtString _markingText()
const;
281 const DtEntityIdentifier _entityId()
const;
283 void completeSetup();
284 void updateVrfStateComponentParameters();
286 void updatePhysicalLineHeightInformation();
287 void updateCeilingInformation();
288 void updatePhysicalLineWidthInformation();
290 void handleDataUpdated(
const std::vector<UInt32>& attributesUpdated);
291 bool checkUUIDChanged();
292 bool checkForceChanged();
293 bool checkMarkingTextChanged();
294 bool checkEntityIdChanged();
332 virtual bool forceAdvance();
333 static void addAdditionalTableColumns(Legion::SimulationDatabase* db);
337 if (!myFoundComponent)
339 myFoundComponent = myCurrentFrameState.findReadComponent();
342 if (myNextFrameState.isWritable())
344 myNextFrameState.updateVrfStateComponentParameters();
345 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
348 myCurrentFrameState.checkForUpdatedItems();
349 myCurrentFrameState.emitComponentUpdated();
354 myCurrentFrameState.updateStateData(sd);
355 myNextFrameState.updateStateData(sd);
359 virtual void convertToRemote();
362 virtual void convertToLocal();
364 Legion::WriteStateInstance
writeStateInstance()
override {
return myWriteEnvironmentProcessRepository; };
366 virtual void addAdditionalStateComponents()
override;
369 virtual void firstFrameAdvance()
override;
374 myCurrentFrameState.aboutToBeDeleted();
375 myNextFrameState.aboutToBeDeleted();
UUID is a unique ID wrapper class.
Definition: uuid.h:59
bool myFoundComponent
Definition: environmentalStateComponent.h:382
double myPhysicalLineHeight
Definition: environmentalStateComponent.h:78
UInt32 myCenterPointColumn
Definition: environmentalStateComponent.h:309
unsigned int UInt32
Definition: stateDataTypes.h:18
DtEnvironmentalStateComponentData & operator=(const DtEnvironmentalStateComponentData &orig)
Definition: environmentalStateComponent.h:50
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: environmentalStateComponent.h:320
DtEnvironmentalStateComponentData & frameState()
Definition: environmentalStateComponent.h:150
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:149
virtual std::vector< UInt64 > records() const
Returns instance handles to all the records in this environmental.
Definition: environmentalStateComponent.h:121
LOM::WriteEnvironmentProcessRepository myWriteEnvironmentProcessRepository
Definition: environmentalStateComponent.h:381
DtEnvironmentalStateComponentData(const DtEnvironmentalStateComponentData &orig)
Definition: environmentalStateComponent.h:36
virtual void aboutToBeDeleted() override
Definition: environmentalStateComponent.h:371
unsigned int myCallbackHandle
Definition: environmentalStateComponent.h:307
bool isDoubleBuffered()
Definition: environmentalStateComponent.h:326
DtEnvironmentalStateComponentData myData
Definition: environmentalStateComponent.h:315
Definition: stateComponent.h:266
UInt32 myOrientationColumn
Definition: environmentalStateComponent.h:310
The DtSimulatedObjectStateComponent is an interface that all main components (those that are consider...
Definition: simulatedObjectStateComponent.h:21
double myCeilingHeight
Definition: environmentalStateComponent.h:80
std::string myMarkingText
Definition: environmentalStateComponent.h:312
DtEnvironmentalStateComponentCurrentFrame myCurrentFrameState
Definition: environmentalStateComponent.h:379
VRF::ReadVrfEnvironmentRecordRepository myReadVrfEnvironmentRecordRepository
Definition: environmentalStateComponent.h:306
virtual int recordCount() const
Number of additional records.
Definition: environmentalStateComponent.h:118
DtEnvironmentalStateComponentData()
Definition: environmentalStateComponent.h:26
UInt32 myMarkingTextColumn
Definition: environmentalStateComponent.h:134
void advanceFrame(const DtEnvironmentalStateComponentData &data)
Definition: environmentalStateComponent.h:297
DtStateComponentCreator< DtEnvironmentalStateComponentImplementation > DtEnvironmentalStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: environmentalStateComponent.h:389
VRF::WriteVrfEnvironmentRecordRepository myWriteVrfEnvironmentRecordRepository
Definition: environmentalStateComponent.h:231
DtRwIntelCollectionArea * myIntelCollectionAreaInformation
Definition: environmentalStateComponent.h:304
UInt32 myAppearanceBitsColumn
Definition: environmentalStateComponent.h:137
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:339
2) Define the next frame class. This will be used for write access.
Definition: environmentalStateComponent.h:142
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:228
int myTickPeriod
Definition: environmentalStateComponent.h:87
LOM::ReadEnvironmentProcessRepository myReadEnvironmentProcessRepository
Definition: environmentalStateComponent.h:305
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: environmentalStateComponent.h:352
bool myCheckForNameReservation
Definition: environmentalStateComponent.h:86
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:379
DtString myMarkingText
Definition: environmentalStateComponent.h:82
bool myCheckedForVrfStateComponent
Definition: environmentalStateComponent.h:383
3) Define the current frame class. This will be used for read access.
Definition: environmentalStateComponent.h:237
const DtEntityType entityType() const
Definition: environmentalStateComponent.h:174
unsigned int myDataCallbackHandle
Definition: environmentalStateComponent.h:308
DtEnvironmentalStateComponentNextFrame myNextFrameState
Definition: environmentalStateComponent.h:380
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
unsigned long long UInt64
Definition: stateDataTypes.h:17
Definition: environmentalStateComponent.h:24
virtual void aboutToBeDeleted()
virtual DtFrameStateInterface * nextFrameState()
Definition: environmentalStateComponent.h:328
UInt32 myForceTypeColumn
Definition: environmentalStateComponent.h:135
boost::signals2::scoped_connection myVrfStateComponentChangedConnection
Definition: environmentalStateComponent.h:384
const DtEnvironmentalStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: environmentalStateComponent.h:244
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:364
UInt32 myObjectTypeColumn
Definition: environmentalStateComponent.h:138
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
int myForceId
Definition: environmentalStateComponent.h:311
double myPhysicalLineWidth
Definition: environmentalStateComponent.h:79
Definition: stateComponent.h:63
DtEntityIdentifier myEntityId
Definition: environmentalStateComponent.h:83
LOM::WriteEnvironmentProcessRepository myWriteEnvironmentProcessRepository
Definition: environmentalStateComponent.h:230
virtual void removeRecord(Legion::WriteStateInstance)
Removes a record from this environmental (this must be an instance handle)
Definition: environmentalStateComponent.h:127
#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:85
DtStateData * myStateData
Definition: environmentalStateComponent.h:232
DtUUID myUUID
Definition: environmentalStateComponent.h:84
virtual const DtFrameStateInterface * nextFrameState() const
Definition: environmentalStateComponent.h:329
const DtEntityType entityType() const
Definition: environmentalStateComponent.h:252
const DtFrameStateInterface * currentFrameState() const
Definition: environmentalStateComponent.h:327
DtString myGlobalId
Definition: environmentalStateComponent.h:81
UInt32 myEntityIdColumn
Definition: environmentalStateComponent.h:136
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:291
DtStateData * myStateData
Definition: environmentalStateComponent.h:314
DtEnvironmentalStateComponentData myData
Definition: environmentalStateComponent.h:233
virtual void addRecord(Legion::WriteStateInstance)
Adds a new record to this environmental (this must be an instance handle)
Definition: environmentalStateComponent.h:124
boost::signals2::scoped_connection myVrfStateComponentChangedConnection
Definition: environmentalStateComponent.h:303
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:92
void updateDataStorage()
Implement to update data storage. Called from advanceFrame.
Definition: environmentalStateComponent.h:335