|
AGX Dynamics 2.41.3.0
|
Entity instance provides access to a single instance in an EntityStorage. More...
#include <EntityInstance.h>
Public Member Functions | |
| EntityInstance () | |
| Constructors. | |
| EntityInstance (agxData::EntityData *data, agx::Index index) | |
| EntityInstance (agxData::EntityStorage *storage, agx::Index index) | |
| EntityInstance (const agxData::EntityInstance &other) | |
| EntityInstance (const agxData::EntityPtr &other) | |
| ~EntityInstance ()=default | |
| Destructor. | |
| agx::Index | calculateId () const |
| agxData::EntityData * | getData () |
| const agxData::EntityData * | getData () const |
| agx::Index | getIndex () const |
| agxData::EntityModel * | getModel () |
| Alias for getData()->getStorage()->getModel() | |
| const agxData::EntityModel * | getModel () const |
| agxData::EntityStorage * | getStorage () |
| Alias for getData()->getStorage() | |
| const agxData::EntityStorage * | getStorage () const |
| agx::UInt32 | hash () const |
| void | init (agxData::EntityData *data, agx::Index index) |
| Initialize an instance. | |
| bool | isInstanceOf (agxData::EntityModel *model) const |
| bool | isValid () const |
| operator bool () const | |
| bool | operator! () const |
| Boolean operators, implemented using isValid. | |
| bool | operator!= (const EntityInstance &rhs) const |
| bool | operator< (const EntityInstance &rhs) const |
| bool | operator== (const EntityInstance &rhs) const |
| bool | operator> (const EntityInstance &rhs) const |
| void | verifyIndex () const |
| Check for broken ptr, by verifying that the index is active in the storage. | |
Static Public Member Functions | |
| static void | TransformToAscii (void *targetBuffer, const void *sourceBuffer, size_t numElements) |
Entity instance provides access to a single instance in an EntityStorage.
Behaves like a struct, but stored using SOA buffers. The EntityInstance is temporal, it stores a direct index to its position in the storage. As the storage is modified and instances are added/removed, existing EntityInstance variables may be invalidated. For this reason EntityInstance should only be used in local scopes where the instance is known to be valid. For other cases, use EntityPtr instead, which use indirect addressing, and is valid even when the storage is permuted. The downside is that data access is a bit more costly.
Definition at line 43 of file EntityInstance.h.
| agxData::EntityInstance::EntityInstance | ( | ) |
Constructors.
Definition at line 134 of file EntityInstance.h.
| agxData::EntityInstance::EntityInstance | ( | agxData::EntityStorage * | storage, |
| agx::Index | index | ||
| ) |
Definition at line 804 of file EntityStorage.h.
| agxData::EntityInstance::EntityInstance | ( | agxData::EntityData * | data, |
| agx::Index | index | ||
| ) |
Definition at line 137 of file EntityInstance.h.
| agxData::EntityInstance::EntityInstance | ( | const agxData::EntityInstance & | other | ) |
Definition at line 141 of file EntityInstance.h.
| agxData::EntityInstance::EntityInstance | ( | const agxData::EntityPtr & | other | ) |
Definition at line 807 of file EntityStorage.h.
References agxAssert, agxData::EntityPtr::calculateIndex(), and agxData::EntityPtr::getData().
|
default |
Destructor.
| agx::Index agxData::EntityInstance::calculateId | ( | ) | const |
Definition at line 815 of file EntityStorage.h.
References agxAssert, getStorage(), and agxData::EntityStorage::indexToId().
| agxData::EntityData * agxData::EntityInstance::getData | ( | ) |
Definition at line 149 of file EntityInstance.h.
| const agxData::EntityData * agxData::EntityInstance::getData | ( | ) | const |
Definition at line 150 of file EntityInstance.h.
| agx::Index agxData::EntityInstance::getIndex | ( | ) | const |
Definition at line 147 of file EntityInstance.h.
Referenced by agxData::EntityPtr::EntityPtr(), operator!=(), operator<(), operator==(), operator>(), and verifyIndex().
| agxData::EntityModel * agxData::EntityInstance::getModel | ( | ) |
Alias for getData()->getStorage()->getModel()
Definition at line 825 of file EntityStorage.h.
References agxData::EntityStorage::getEntityModel(), and getStorage().
Referenced by getModel(), and isInstanceOf().
| const agxData::EntityModel * agxData::EntityInstance::getModel | ( | ) | const |
Definition at line 826 of file EntityStorage.h.
References getModel().
| agxData::EntityStorage * agxData::EntityInstance::getStorage | ( | ) |
Alias for getData()->getStorage()
Definition at line 822 of file EntityStorage.h.
Referenced by calculateId(), getModel(), getStorage(), operator!=(), operator==(), and verifyIndex().
| const agxData::EntityStorage * agxData::EntityInstance::getStorage | ( | ) | const |
Definition at line 823 of file EntityStorage.h.
References getStorage().
| agx::UInt32 agxData::EntityInstance::hash | ( | ) | const |
Definition at line 152 of file EntityInstance.h.
References agx::hash().
| void agxData::EntityInstance::init | ( | agxData::EntityData * | data, |
| agx::Index | index | ||
| ) |
Initialize an instance.
| data | The data set |
| index | The instance index |
Definition at line 145 of file EntityInstance.h.
| bool agxData::EntityInstance::isInstanceOf | ( | agxData::EntityModel * | model | ) | const |
Definition at line 829 of file EntityStorage.h.
References getModel(), and agx::Model::is().
| bool agxData::EntityInstance::isValid | ( | ) | const |
Definition at line 157 of file EntityInstance.h.
Referenced by operator!().
| agxData::EntityInstance::operator bool | ( | ) | const |
Definition at line 159 of file EntityInstance.h.
| bool agxData::EntityInstance::operator! | ( | ) | const |
Boolean operators, implemented using isValid.
Definition at line 158 of file EntityInstance.h.
References isValid().
| bool agxData::EntityInstance::operator!= | ( | const EntityInstance & | rhs | ) | const |
Definition at line 176 of file EntityInstance.h.
References getIndex(), and getStorage().
| bool agxData::EntityInstance::operator< | ( | const EntityInstance & | rhs | ) | const |
Definition at line 161 of file EntityInstance.h.
References getIndex().
| bool agxData::EntityInstance::operator== | ( | const EntityInstance & | rhs | ) | const |
Definition at line 171 of file EntityInstance.h.
References getIndex(), and getStorage().
| bool agxData::EntityInstance::operator> | ( | const EntityInstance & | rhs | ) | const |
Definition at line 166 of file EntityInstance.h.
References getIndex().
|
static |
| void agxData::EntityInstance::verifyIndex | ( | ) | const |
Check for broken ptr, by verifying that the index is active in the storage.
Only used in debug mode.
Definition at line 836 of file EntityStorage.h.
References agxAssertN, agx::Path::c_str(), getIndex(), agx::Object::getPath(), getStorage(), and agxData::EntityStorage::size().