|
AGXDynamics
2.31.1.0
|
Book keeping of a body which can be merged with other bodies. More...
#include <MergeSplitBodyStorage.h>
Inheritance diagram for agx::MergeSplitBodyStorage:Public Types | |
| typedef agx::Vector < agx::observer_ptr < agxCollide::Geometry > > | GeometryObserverVector |
Public Member Functions | |
| MergeSplitBodyStorage () | |
| Default constructor. More... | |
| MergeSplitBodyStorage (agx::RigidBody *body) | |
| Constructor which associates a body to this body storage. More... | |
| template<typename T > | |
| T * | as () |
| Subclass casting. More... | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. More... | |
| template<typename T > | |
| const T * | asSafe () const |
| MergeSplitBodyStorage * | getChild (size_t nth) |
| const MergeSplitBodyStorage * | getChild (size_t nth) const |
| const char * | getClassName () const override |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| const agxCollide::GeometryRefVector & | getGeometries () const |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. More... | |
| size_t | getNumChildren () const |
| MergeSplitBodyStorage * | getParent () |
| const MergeSplitBodyStorage * | getParent () const |
| int | getReferenceCount () const |
| agx::RigidBody * | getRigidBody () |
| const agx::RigidBody * | getRigidBody () const |
| agxStream::StorageAgent * | getStorageAgent () const override |
| AffineMatrix4x4 | getTransformRelativeParent () const |
| agx::Uuid | getUuid () const |
| bool | hasChild (MergeSplitBodyStorage *child) const |
| bool | hasChildren () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| bool | isFinished () const |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
| virtual void | restore (agxStream::InputArchive &in) override |
| void | setEnableSerialization (bool flag) |
| Set to false to disable serialization of this object. More... | |
| void | setFinished () |
| Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More... | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. More... | |
| virtual void | store (agxStream::OutputArchive &out) const override |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
| bool | validate () const |
Static Public Member Functions | |
| static void | addMassProperties (MergeSplitBodyStorage *targetStorage, const MergeSplitBodyStorage *sourceStorage, Real sign) |
| static agxStream::Serializable * | create () |
| static agxStream::Serializable * | create (agxStream::InputArchive &) |
| static const char * | getConstructClassId () |
| static void | removeMassProperties (MergeSplitBodyStorage *targetStorage, const MergeSplitBodyStorage *sourceStorage, Real sign) |
| static void | setEnableUuidGeneration (bool flag) |
| Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More... | |
| static void | setRebuildThreshold (size_t numChildren, size_t numUpdates) |
| Set the threshold when the inertiatensor of a parent should be completely rebuilt. More... | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Protected Member Functions | |
| virtual | ~MergeSplitBodyStorage () |
| void | addChild (MergeSplitBodyStorage *child) |
| Add a storage as a child to this storage. More... | |
| void | addGeometry (agxCollide::Geometry *geom) |
| void | allocateObserverVector () const |
| void | calculateRelativeTransform (const MergeSplitBodyStorage *parentStorage) |
| Calculate and store the transform relative the parent body. More... | |
| void | clear () |
| Reset this storage so its not associated to any body. More... | |
| void | deleteUsingDeleteHandler () const |
| void | followGeometry () |
| Make the body follow the first geometry in the list of geometries. More... | |
| void | generateUuid () |
| agx::Frame * | getFrame () |
| const agx::Frame * | getFrame () const |
| agx::RigidBody::MotionControl | getMotionControl () const |
| size_t | getNumUpdates () |
| void | incrementNumUpdates () |
| bool | isMerged () const |
| bool | removeChild (MergeSplitBodyStorage *child) |
| Remove a storage so its no longer a child of this storage. More... | |
| void | resetNumUpdates () |
| void | restore (bool beingErased=false) |
| Restore the associated body in that it will get back all its original geometries, motioncontrol etc. More... | |
| void | restoreMassProperties () |
| void | setMotionControl (agx::RigidBody::MotionControl m) |
| void | setParent (MergeSplitBodyStorage *parent) |
| Set the pointer to the parent body of this body. More... | |
| void | setRigidBody (agx::RigidBody *body) |
| Associate this storage with the specified body. More... | |
Static Protected Member Functions | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More... | |
Protected Attributes | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Book keeping of a body which can be merged with other bodies.
Keep track of its children, parent bodies, original geometries belonging to this body etc.
Definition at line 35 of file MergeSplitBodyStorage.h.
| typedef agx::Vector<agx::observer_ptr<agxCollide::Geometry> > agx::MergeSplitBodyStorage::GeometryObserverVector |
Definition at line 40 of file MergeSplitBodyStorage.h.
| agx::MergeSplitBodyStorage::MergeSplitBodyStorage | ( | ) |
Default constructor.
| agx::MergeSplitBodyStorage::MergeSplitBodyStorage | ( | agx::RigidBody * | body | ) |
Constructor which associates a body to this body storage.
|
protectedvirtual |
|
protected |
Add a storage as a child to this storage.
|
protected |
|
static |
|
protectedinherited |
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().
|
inherited |
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
|
protected |
Calculate and store the transform relative the parent body.
|
protected |
Reset this storage so its not associated to any body.
|
inlinestatic |
Definition at line 53 of file MergeSplitBodyStorage.h.
|
inlinestatic |
Definition at line 53 of file MergeSplitBodyStorage.h.
|
protectedinherited |
|
protected |
Make the body follow the first geometry in the list of geometries.
|
protectedinherited |
| MergeSplitBodyStorage* agx::MergeSplitBodyStorage::getChild | ( | size_t | nth | ) |
| const MergeSplitBodyStorage* agx::MergeSplitBodyStorage::getChild | ( | size_t | nth | ) | const |
|
inlineoverridevirtual |
Reimplemented from agxStream::Serializable.
Definition at line 53 of file MergeSplitBodyStorage.h.
|
inlinestatic |
Definition at line 53 of file MergeSplitBodyStorage.h.
|
staticprotectedinherited |
|
inherited |
Definition at line 273 of file Serializable.h.
|
inherited |
|
inlineprotected |
Definition at line 222 of file MergeSplitBodyStorage.h.
|
inlineprotected |
Definition at line 227 of file MergeSplitBodyStorage.h.
| const agxCollide::GeometryRefVector& agx::MergeSplitBodyStorage::getGeometries | ( | ) | const |
|
inherited |
This index is given at creation of this object.
It is guaranteed to be unique for the lifetime of this library instance. As long as the application is running. This value is not serialized or restored. A new object will always get a new index no matter how it is created.
Definition at line 247 of file Serializable.h.
|
inlineprotected |
Definition at line 232 of file MergeSplitBodyStorage.h.
|
inline |
Definition at line 217 of file MergeSplitBodyStorage.h.
References agx::SetVector< DataT, HashT >::size().
|
inlineprotected |
Definition at line 207 of file MergeSplitBodyStorage.h.
|
inline |
Definition at line 212 of file MergeSplitBodyStorage.h.
|
inline |
Definition at line 213 of file MergeSplitBodyStorage.h.
|
inherited |
|
inline |
Definition at line 209 of file MergeSplitBodyStorage.h.
|
inline |
Definition at line 210 of file MergeSplitBodyStorage.h.
|
inlineoverridevirtual |
Implements agxStream::Serializable.
Definition at line 53 of file MergeSplitBodyStorage.h.
|
inline |
Definition at line 215 of file MergeSplitBodyStorage.h.
|
inherited |
Definition at line 268 of file Serializable.h.
| bool agx::MergeSplitBodyStorage::hasChild | ( | MergeSplitBodyStorage * | child | ) | const |
|
inline |
Definition at line 237 of file MergeSplitBodyStorage.h.
References agx::SetVector< DataT, HashT >::size().
|
inlineprotected |
Definition at line 203 of file MergeSplitBodyStorage.h.
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::Buffer::getElement(), and agx::Object::getResource().
|
inherited |
Definition at line 252 of file Serializable.h.
|
inlineprotected |
Definition at line 201 of file MergeSplitBodyStorage.h.
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
This method should be used with care, always balanced with the same number of calls to unreference.
Referenced by agxData::Val< UInt >::Val().
|
protected |
Remove a storage so its no longer a child of this storage.
|
static |
|
inlineprotected |
Definition at line 205 of file MergeSplitBodyStorage.h.
|
overridevirtual |
|
protected |
Restore the associated body in that it will get back all its original geometries, motioncontrol etc.
|
protected |
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
|
inherited |
Set to false to disable serialization of this object.
It will just be ignored during serialization (writing). It is still possible to restore TO this object.
|
staticinherited |
Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
|
inherited |
Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
|
protected |
|
protected |
Set the pointer to the parent body of this body.
|
static |
Set the threshold when the inertiatensor of a parent should be completely rebuilt.
| numChildren | - If a parent has less children than numChildren, rebuild the whole tensor |
| numUpdates | - If a parent has been incrementally recalculated more than numUpdates, rebuild the whole tensor |
|
protected |
Associate this storage with the specified body.
Stores information about motioncontrol, associated geometries etc.
Explicitly set a Uuid on a serializable object.
Use this method with great care, as it can result in non-unique identifiers in the system!
|
overridevirtual |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
This method should be used with care, always balanced with the same number of calls to reference.
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
| bool agx::MergeSplitBodyStorage::validate | ( | ) | const |
|
staticinherited |
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.