11 #include <vlpi/articulatedPartCollection.h>
17 class DtArticulatedPartStateRepository;
24 : myArtPartListModified(false)
31 myarticulatedPartManager = std::shared_ptr<DtArticulatedPartManager>(
new DtArticulatedPartManager(
nullptr,
"articulated-parts"));
38 : myarticulatedPartManager(orig.myarticulatedPartManager)
39 , myartPartList(orig.myartPartList)
40 , myArtPartListModified(orig.myArtPartListModified)
57 bool initialized()
const {
return (myarticulatedPartManager.get() != 0); };
74 void clearArtPartListModified() { myArtPartListModified =
false; };
78 std::shared_ptr<DtArticulatedPartManager> myarticulatedPartManager;
107 virtual
DtArticulatedPart& attachPartToListIfMissing(DtArtPartType partType) {
throw DtUnimplementedMethod(
"DtArticulatedPart& attachPartToListIfMissing(DtArtPartType partType) is not implemented for this class."); };
166 virtual DtArticulatedPart& attachPartToListIfMissing(DtArtPartType partType)
override;
173 virtual void detachPartIfAttached(DtArtPartType partType)
override;
176 virtual void detachPart(DtArtPartType partType)
override;
180 void setPublishOnLegionNetwork(
bool b);
183 virtual void clearModified()
override;
185 virtual bool artPartListModified()
const override;
190 virtual void addParameterType(
int partType,
int parameterType)
override;
219 void setUpdateFromLegionNetwork(
bool);
221 virtual void clearModified()
override;
223 virtual bool artPartListModified()
const override;
264 virtual void updateDataStorage()
override;
270 myCurrentFrameState.updateStateData(sd);
271 myNextFrameState.updateStateData(sd);
276 virtual void setPublishingOnLegionNetwork(
bool b)
override;
286 myCurrentFrameState.aboutToBeDeleted();
287 myNextFrameState.aboutToBeDeleted();
293 static void SetAddMissingParameterToAllParts(
bool);
295 static bool AddMissingParameterToAllParts();
299 virtual void createPartsFromDescriptors(
const std::list<DtSimArtPartDescriptor*>& descriptors,
300 const std::list<DtSimArtPartDescriptor*>& partDefaultsFromActuators);
Instances of DtVrfObjectParameters are the readable/writeable objects that contain the information ne...
Definition: vrfObjectParameters.h:64
The articulated part manager maintains a tree of articulated and attached parts for the state reposit...
Definition: articulatedPartManager.h:33
Exception thrown when a required method has not been implemented.
Definition: stateDataTypes.h:30
std::shared_ptr< DtArticulatedPartCollection > myartPartList
DIS/HLA articulated part collection used for network transmission.
Definition: articulatedPartStateComponent.h:80
DtArticulatedPartCollection & artPartList()
Returns a mutable reference to the articulated part collection used for network transmission.
Definition: articulatedPartStateComponent.h:66
2) Define the next frame class. This will be used for write access.
Definition: articulatedPartStateComponent.h:127
A readable, writable type that holds an articulated part type, attached-to part type, attachment point, and a list of art-part params (DtSimArtPartParamList). The read/write name is not used for anything in particular, and therefore may be used for file readability.
Definition: simArtPartDescriptor.h:28
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
In order to be a well defined state component, you must:
Definition: articulatedPartStateComponent.h:89
virtual bool artPartListModified() const
Returns true if the articulated part list has been modified since last cleared.
Definition: articulatedPartStateComponent.h:113
DtArticulatedPartManager & articulatedPartManager()
Returns a mutable reference to the articulated part manager.
Definition: articulatedPartStateComponent.h:61
#define UNDEFINED_RETURNREF_ACCESSORS(ReturnType, Member)
Defines both const and non-const virtual reference accessors that throw DtUnimplementedMethod, requiring overrides in a derived class.
Definition: doubleBufferedDataStorage.h:74
virtual DtFrameStateInterface * nextFrameState() override
Returns a mutable pointer to the next (write) frame state interface.
Definition: articulatedPartStateComponent.h:255
const DtArticulatedPartStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: articulatedPartStateComponent.h:208
DtArticulatedPartStateComponentNextFrame myNextFrameState
Next (write) frame state for the articulated parts.
Definition: articulatedPartStateComponent.h:306
DtArticulatedPartStateComponentData()
Definition: articulatedPartStateComponent.h:23
bool isDoubleBuffered()
Returns true, indicating this component uses double-buffered state storage.
Definition: articulatedPartStateComponent.h:251
virtual void aboutToBeDeleted() override
Notifies both frame state components that the owning entity is about to be deleted.
Definition: articulatedPartStateComponent.h:283
const DtArticulatedPartStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: articulatedPartStateComponent.h:135
bool myArtPartListModified
Dirty flag indicating the articulated part list has been modified and needs to be transmitted...
Definition: articulatedPartStateComponent.h:82
virtual void detachPartIfAttached(DtArtPartType partType)
Detaches the part of the given type if it is currently attached; a no-op if not present.
Definition: articulatedPartStateComponent.h:120
virtual void updateStateData(DtStateData *sd) override
Updates the state data pointer in both the current and next frame state components.
Definition: articulatedPartStateComponent.h:268
Definition: coordSystem.h:54
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
DtArticulatedPartStateComponentData myData
The articulated part state data for the next simulation frame.
Definition: articulatedPartStateComponent.h:194
#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
virtual void makeWritable() override
Override to make component writable.
Definition: articulatedPartStateComponent.h:158
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:489
DtArticulatedPartStateComponentData(const DtArticulatedPartStateComponentData &orig)
Copy constructor. Shares ownership of the manager and collection via shared_ptr.
Definition: articulatedPartStateComponent.h:37
Definition: stateComponent.h:75
DtStateComponentCreator< DtArticulatedPartStateComponentImplementation > DtArticulatedPartStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: articulatedPartStateComponent.h:311
virtual void aboutToBeDeleted()
Called when the component is about to be deleted; emits signal_stateComponentAboutToBeDeleted.
virtual void detachPart(DtArtPartType partType)
Detaches the part of the given type.
Definition: articulatedPartStateComponent.h:123
virtual const DtFrameStateInterface * currentFrameState() const override
Returns a const pointer to the current (read) frame state interface.
Definition: articulatedPartStateComponent.h:253
virtual const DtFrameStateInterface * nextFrameState() const override
Returns a const pointer to the next (write) frame state interface.
Definition: articulatedPartStateComponent.h:257
bool initialized() const
Returns true if create() has been called and the manager has been allocated.
Definition: articulatedPartStateComponent.h:57
DtArticulatedPartStateComponentData & frameState()
Definition: articulatedPartStateComponent.h:136
std::shared_ptr< DtArticulatedPartManager > myarticulatedPartManager
Manages the tree of articulated parts for this entity.
Definition: articulatedPartStateComponent.h:74
DtArticulatedPartStateComponentData & operator=(const DtArticulatedPartStateComponentData &rhs)
Assignment operator. Shares ownership of the manager and collection via shared_ptr.
Definition: articulatedPartStateComponent.h:47
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: articulatedPartStateComponent.h:243
bool artPartListModified() const
Returns true if the articulated part list has been modified since last cleared.
Definition: articulatedPartStateComponent.h:72
void create()
Allocates the articulated part manager and the part collection. Must be called before use when not co...
Definition: articulatedPartStateComponent.h:29
The DtArticulatedPartStateRepository class is used to represent articulated parts for an entity...
Definition: articulatedPartStateRepository.h:40
void advanceFrame(const DtArticulatedPartStateComponentData &data)
Advances the current frame buffer by copying in the latest next-frame data.
Definition: articulatedPartStateComponent.h:229
DtArticulatedPartStateComponentCurrentFrame myCurrentFrameState
Current (read) frame state for the articulated parts.
Definition: articulatedPartStateComponent.h:304
#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
const DtArticulatedPartManager & articulatedPartManager() const
Returns a const reference to the articulated part manager.
Definition: articulatedPartStateComponent.h:59
void setArtPartListModified(bool b)
Sets the dirty flag indicating the articulated part list has been modified.
Definition: articulatedPartStateComponent.h:70
const DtArticulatedPartCollection & artPartList() const
Returns a const reference to the articulated part collection used for network transmission.
Definition: articulatedPartStateComponent.h:64
bool myPublishOnLegionNetwork
If true, publishes articulated part state on the LEGION network.
Definition: articulatedPartStateComponent.h:196
virtual DtArticulatedPartStateRepository * attachPart(DtArtPartType partType)
Attaches a part of the given type and returns its state repository.
Definition: articulatedPartStateComponent.h:111
Holds the articulated part state data shared between the next and current frame buffers. Manages the hierarchy of articulated parts and the DIS/HLA collection for network transmission.
Definition: articulatedPartStateComponent.h:21
3) Define the current frame class. This will be used for read access.
Definition: articulatedPartStateComponent.h:200
virtual void addParameterType(int partType, int parameterType)
Adds a parameter metric type for the specified articulated part type.
Definition: articulatedPartStateComponent.h:117
Contains the DtStateComponent class declaration.
DtArticulatedPartStateComponentData myData
The articulated part state data for the current simulation frame.
Definition: articulatedPartStateComponent.h:236
virtual void makeReadOnly() override
Override to make component read-only.
Definition: articulatedPartStateComponent.h:161
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
bool myUpdateFromLegionNetwork
If true, updates articulated part state from changes received on the LEGION network.
Definition: articulatedPartStateComponent.h:238