AGX Dynamics 2.41.3.0
Loading...
Searching...
No Matches
agxData::EntityStorage Class Reference

Data storage for a collection of entity instances of a specified EntityModel. More...

#include <EntityStorage.h>

+ Inheritance diagram for agxData::EntityStorage:

Public Types

typedef agxData::LocalVector< std::pair< size_t, size_t > > InstanceSwapLocalVector
 
typedef agx::VectorPOD< std::pair< size_t, size_t > > InstanceSwapVector
 
- Public Types inherited from agx::Component
typedef Event2< Component *, Object * > ObjectEvent
 Event when adding removing child objects.
 
typedef Callback1< Object * > TraverseCallback
 
- Public Types inherited from agx::Object
typedef agx::observer_ptr< const EventEventConstObserver
 
typedef agx::ref_ptr< const EventEventConstRef
 
typedef agx::observer_ptr< EventEventObserver
 
typedef agx::Vector< EventObserverEventObserverVector
 
typedef agx::VectorPOD< Event * > EventPtrVector
 
typedef agx::ref_ptr< EventEventRef
 
typedef agx::Vector< EventRefEventRefVector
 

Public Member Functions

 EntityStorage (agxData::EntityModel *entity, const agx::Name &name, size_t initialCapacity=32)
 
 EntityStorage (agxData::EntityModel *entity, size_t initialCapacity=32)
 
void addCustomAttribute (agxData::Attribute *attribute)
 Add a custom attribute buffer.
 
void addListener (EventListener *listener)
 
size_t capacity () const
 
void clear ()
 Clears the storage.
 
agxData::EntityStorageclone () const
 
void commitPermutation (const agxData::IndexArray &permutation)
 
virtual void configure (agx::TiXmlElement *eStorage) override
 
agxData::EntityPtr copyInstance (size_t id, agxData::EntityStorage *target)
 
agxData::EntityPtr copyInstance (size_t id, agxData::EntityStorage *target, size_t targetId)
 
agxData::EntityPtr createInstance ()
 Creates a new instance and initializes it with default values.
 
agxData::EntityRange createInstances (size_t numInstances)
 Create a range of entity instances.
 
agxData::EntityStoragecreateSharedStorage ()
 Swap buffers with another storage.
 
template<typename T >
agxData::Array< T > dereferenceMultipliedAttribute (const agxData::EntityPtr &entity, const agxData::ScalarAttributeT< T > *attribute)
 
template<typename T >
const agxData::Array< T > dereferenceMultipliedAttribute (const agxData::EntityPtr &entity, const agxData::ScalarAttributeT< T > *attribute) const
 
template<typename T >
Array< T > dereferenceMultipliedAttribute (const EntityPtr &entity, const ScalarAttributeT< T > *attribute)
 
template<typename T >
const Array< T > dereferenceMultipliedAttribute (const EntityPtr &entity, const ScalarAttributeT< T > *attribute) const
 
void destroyInstance (agxData::EntityPtr instance)
 
void destroyInstance (size_t id)
 
void destroyInstances (agxData::EntityRange range)
 
template<typename VectorT >
void destroyInstances (const VectorT &instances)
 
bool empty () const
 
template<typename T >
T & get (const agx::Name &attributeName, size_t index)
 Slow but convenient accessor.
 
agxData::BuffergetBuffer (const agx::Name &name)
 
agxData::BuffergetBuffer (const agxData::Attribute *attribute)
 
const agxData::BufferTablegetBuffers () const
 
agxData::EntityData * getData ()
 
template<typename T >
T * getData ()
 
template<typename T >
const T * getData () const
 
agxData::EntityModelgetEntityModel ()
 
const agxData::EntityModelgetEntityModel () const
 
agxData::BuffergetGlobalOrderBuffer ()
 If the storage is used as a global result, we provide a permutation buffer for parallel determinism.
 
const agxData::BuffergetGlobalOrderBuffer () const
 If the storage is used as a global result, we provide a permutation buffer for parallel determinism.
 
agxData::BuffergetIdToIndexBuffer ()
 
const agxData::BuffergetIdToIndexBuffer () const
 
agxData::IndexArraygetIdToIndexTable ()
 
const agxData::IndexArraygetIdToIndexTable () const
 
agxData::BuffergetInstanceBuffer ()
 
const agxData::BuffergetInstanceBuffer () const
 
agxData::Array< EntityPtrgetInstances ()
 
template<typename T >
agxData::Array< T > getInstances ()
 
template<typename T >
Array< T > getInstances ()
 
const agxData::Array< EntityPtrgetInstances () const
 
template<typename T >
const agxData::Array< T > getInstances () const
 
template<typename T >
const Array< T > getInstances () const
 
size_t getNumBytes () const
 
agxData::BuffergetOrCreateGlobalOrderBuffer ()
 Create the global order buffer if not already allocated.
 
agxData::BytegetPermutationBuffer (agxData::Attribute *attribute)
 
agxData::BytegetPermutationBuffer (size_t index)
 
bool hasListener (EventListener *listener)
 
size_t idToIndex (size_t id) const
 Convert between instance id and data index.
 
size_t indexToId (size_t index) const
 Convert between instance id and data index.
 
void keyFrameResize (size_t size, size_t capacity)
 
void preDestroy (agxData::EntityPtr instance)
 
void preparePermutation ()
 
size_t presize (size_t size, size_t initialSize=0)
 
void print () const
 
void print (std::ostream &stream) const
 Reorder a subrange.
 
void printInstanceTable () const
 
void removeListener (EventListener *listener)
 
void reorder (const agxData::IndexArray &permutation)
 Reorder the storage using a specified permutation.
 
void reorderAttributes (agx::IndexRange32 range, const agxData::IndexArray &permutation)
 
void reserve (size_t size)
 Reserve capacity in the storage.
 
void reset ()
 Clear the storage, and reset index-id tables.
 
void resize (size_t size, bool initializeElements=true)
 
void restorePermutation (agxStream::InputArchive &archive, bool skip=false)
 
void setEnableEvents (bool flag)
 
void setUseInstanceTable (bool flag)
 Set to false to disable instance pointer handling.
 
size_t size () const
 
void storePermutation (agxStream::OutputArchive &archive) const
 
void swapInstances (const InstanceSwapLocalVector &swaps)
 
void swapInstances (const InstanceSwapVector &swaps)
 
agxData::EntityPtr transferInstance (size_t id, agxData::EntityStorage *target)
 
void unregisterBuffer (agxData::Buffer *buffer)
 
bool useInstanceTable () const
 
void verifyConsistency ()
 
- Public Member Functions inherited from agx::Component
 Component (const agx::Name &name=agx::Name(), agx::Model *model=agx::Component::ClassModel(), agx::Device *device=nullptr)
 
virtual void addObject (agx::Object *object, bool assignContext=true)
 Add an object to the component.
 
virtual String autoComplete (const String &partialName, StringVector &matchingNames) const
 
virtual void buildNavigationTree (agxJson::Value &eNode) const override
 
void configure (Model *model)
 
virtual void configure (TiXmlElement *eComponent) override
 
agx::DevicegetDevice ()
 
template<typename T >
T * getDevice ()
 
const agx::DevicegetDevice () const
 
template<typename T >
const T * getDevice () const
 
size_t getNumObjects (const agx::Name &name) const
 
agx::ObjectgetObject (const agx::Name &name, agx::Model *model, size_t index=0)
 
const agx::ObjectgetObject (const agx::Name &name, agx::Model *model, size_t index=0) const
 
agx::ObjectgetObject (const agx::Name &name, size_t index=0)
 
template<typename T >
T * getObject (const agx::Name &name, size_t index=0)
 
const agx::ObjectgetObject (const agx::Name &name, size_t index=0) const
 
template<typename T >
const T * getObject (const agx::Name &name, size_t index=0) const
 
const agx::ObjectRefVectorgetObjects () const
 
template<typename T >
void getObjects (agx::ObjectPtrVector &result, bool recursive=false) const
 
void getObjects (agx::ObjectPtrVector &result, const agx::Model *model, bool recursive=false) const
 
virtual ObjectgetResourceImpl (const Path &path, agx::Model *model) override
 
virtual void printSubtree () const override
 
void printSubtree (std::ostream &stream, int depth=0) const
 
virtual void rebind () override
 
void removeAllObjects ()
 Remove all components.
 
virtual void removeObject (agx::Object *object)
 Remove an object from the component.
 
void removeObject (const agx::Name &name, size_t index=0)
 Remove an object with a specified name (and optional index) from the component.
 
virtual void snapshot (TiXmlNode *eParent, const String &directory) const override
 
void traverse (ComponentVisitor *)
 
void traverse (const TraverseCallback &callback)
 
- Public Member Functions inherited from agx::Object
 Object (const Name &name=Name(), Model *model=Object::ClassModel())
 
void addListener (EventListener *listener)
 
virtual void buildNavigationTree (agxJson::Value &eNode) const
 
virtual void configure (TiXmlElement *)
 
agx::String fullName () const
 
agx::String fullPath () const
 
agx::String fullPath (const agx::Object *root) const
 
template<typename T >
T * getAutoScopedResource (const agx::Path &path)
 
template<typename T >
const T * getAutoScopedResource (const agx::Path &path) const
 
agx::ObjectgetAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::ObjectgetAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr) const
 
agx::ObjectgetContext ()
 
template<typename T >
T * getContext ()
 
const agx::ObjectgetContext () const
 
template<typename T >
const T * getContext () const
 
agx::UInt32 getId () const
 
const agx::NamegetImplementationName () const
 
agx::ModelgetModel ()
 
const agx::ModelgetModel () const
 
const agx::NamegetName () const
 
agx::ObjectgetNextSibling ()
 
const agx::ObjectgetNextSibling () const
 
agx::Path getPath () const
 
agx::Path getPath (const agx::Object *root) const
 
template<typename T >
T * getResource (const agx::Path &path)
 
template<typename T >
const T * getResource (const agx::Path &path) const
 
agx::ObjectgetResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::ObjectgetResource (const agx::Path &path, agx::Model *model=nullptr) const
 
virtual agx::ObjectgetResourceImpl (const agx::Path &path, agx::Model *model)
 
agx::ObjectgetRootContext ()
 
const agx::ObjectgetRootContext () const
 
bool hasListener (EventListener *listener)
 
bool hasParent (const agx::Object *node) const
 
bool isUnique () const
 
virtual void printSubtree () const
 
virtual void rebind ()
 
void removeListener (EventListener *listener)
 
virtual void save (TiXmlElement *) const
 
virtual void setContext (agx::Object *context)
 
void setId (UInt32 id)
 
void setModel (agx::Model *model)
 Set the object model (handled automatically).
 
void setName (const agx::Name &name)
 Set the name of the object.
 
virtual void snapshot (TiXmlNode *, const String &) const
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referencedoperator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxData::AttributeContainer
 AttributeContainer ()
 
 ~AttributeContainer ()
 
void * getAttribute (const Attribute *attribute)
 
const void * getAttribute (const Attribute *attribute) const
 
template<typename T >
T & getAttribute (const ScalarAttributeT< T > *attribute)
 
template<typename T >
const T & getAttribute (const ScalarAttributeT< T > *attribute) const
 
bool hasAttribute (const Attribute *attribute) const
 

Static Public Member Functions

static agx::ModelClassModel ()
 
static void copy (agxData::EntityStorage *target, const agxData::EntityStorage *source)
 
static void extractPermutation (agx::IndexVector &result, agxStream::InputArchive &archive)
 
static agxData::EntityStorageload (agx::TiXmlElement *eStorage, agx::Device *device)
 
- Static Public Member Functions inherited from agx::Component
static Component_load (TiXmlElement *eComponent, Device *device)
 
static agx::ModelClassModel ()
 
static Componentload (const Path &path, const Name &implementation, Device *device, const Path &_namespace=Path())
 
static Componentload (const String &path, const Path &_namespace=Path())
 
static Componentload (const String &path, Device *device, const Path &_namespace=Path())
 
static Componentload (TiXmlElement *eComponent, Device *device)
 
- Static Public Member Functions inherited from agx::Object
static agx::ModelClassModel ()
 
static agx::String generateName (const agx::String &bindPath)
 
static const HashSet< Object * > & getActiveObjects ()
 
static bool getEnableRebind ()
 Should rebinding be allowed? Right now a global setting.
 
static Objectload (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
template<typename T >
static T * load (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
static Objectload (const String &path, Device *device, const String &type="", size_t instance=0)
 
template<typename T >
static T * load (const String &path, Device *device, const String &type="", size_t instance=0)
 
static void load (const String &path, Device *device, ObjectPtrVector &loadedObjects)
 
static Objectload (TiXmlElement *eObject, Device *device)
 
template<typename T >
static T * load (TiXmlElement *eObject, Device *device)
 
static TiXmlDocument openDocument (const String &path)
 
static void setEnableRebind (bool flag)
 Sets if rebinding of objects should be allowed (Right now a global setting).
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Public Attributes

agxData::ValueRefT< agx::UIntcapacityParameter
 
agxData::ValueRefT< agx::UIntsizeParameter
 
- Public Attributes inherited from agx::Component
ObjectEvent addObjectEvent
 
ObjectEvent removeObjectEvent
 

Static Public Attributes

static const agx::Name IdToIndexName
 
static const agx::Name IndexToIdName
 

Protected Member Functions

 EntityStorage (const agx::Name &name)
 
 EntityStorage (EntityModel *entity, const agx::Name &name, bool isFrameStorage, size_t capacity, size_t size)
 
virtual ~EntityStorage ()
 
void explicityRegisterBuffer (agxData::Buffer *buffer, agxData::Attribute *attribute)
 
virtual agx::ObjectgetResourceImpl (const agx::Path &path, agx::Model *model) override
 
- Protected Member Functions inherited from agx::Component
virtual ~Component ()
 
String expandAutoCompletionMatch (const String &query, const StringVector &matchingNames) const
 
void setDevice (Device *device)
 
- Protected Member Functions inherited from agx::Object
virtual ~Object ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Additional Inherited Members

- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandlergetDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Data storage for a collection of entity instances of a specified EntityModel.

Each attribute is stored in a separate buffer. The storage is always packed, when a entity instance is destroyed it is overwritten by the last instance in the storage. The use of a id lookup table allow entity instances to use indirect addressing and remain valid when the data is permuted/reallocated.

Definition at line 72 of file EntityStorage.h.

Member Typedef Documentation

◆ InstanceSwapLocalVector

Definition at line 167 of file EntityStorage.h.

◆ InstanceSwapVector

typedef agx::VectorPOD< std::pair<size_t, size_t> > agxData::EntityStorage::InstanceSwapVector

Definition at line 164 of file EntityStorage.h.

Constructor & Destructor Documentation

◆ EntityStorage() [1/4]

agxData::EntityStorage::EntityStorage ( agxData::EntityModel entity,
size_t  initialCapacity = 32 
)

◆ EntityStorage() [2/4]

agxData::EntityStorage::EntityStorage ( agxData::EntityModel entity,
const agx::Name name,
size_t  initialCapacity = 32 
)

◆ EntityStorage() [3/4]

agxData::EntityStorage::EntityStorage ( const agx::Name name)
protected

◆ EntityStorage() [4/4]

agxData::EntityStorage::EntityStorage ( EntityModel entity,
const agx::Name name,
bool  isFrameStorage,
size_t  capacity,
size_t  size 
)
protected

◆ ~EntityStorage()

virtual agxData::EntityStorage::~EntityStorage ( )
protectedvirtual

Member Function Documentation

◆ addCustomAttribute()

void agxData::EntityStorage::addCustomAttribute ( agxData::Attribute attribute)

Add a custom attribute buffer.

◆ addListener()

void agxData::EntityStorage::addListener ( EventListener *  listener)

◆ capacity()

size_t agxData::EntityStorage::capacity ( ) const
Returns
The capacity of the storage.

Definition at line 444 of file EntityStorage.h.

References agxAssert, capacityParameter, agx::ref_ptr< T >::get(), and m_capacity.

◆ ClassModel()

static agx::Model * agxData::EntityStorage::ClassModel ( )
static

◆ clear()

void agxData::EntityStorage::clear ( )

Clears the storage.

◆ clone()

agxData::EntityStorage * agxData::EntityStorage::clone ( ) const

◆ commitPermutation()

void agxData::EntityStorage::commitPermutation ( const agxData::IndexArray permutation)

◆ configure()

virtual void agxData::EntityStorage::configure ( agx::TiXmlElement *  eStorage)
overridevirtual

◆ copy()

static void agxData::EntityStorage::copy ( agxData::EntityStorage target,
const agxData::EntityStorage source 
)
static

◆ copyInstance() [1/2]

agxData::EntityPtr agxData::EntityStorage::copyInstance ( size_t  id,
agxData::EntityStorage target 
)

◆ copyInstance() [2/2]

agxData::EntityPtr agxData::EntityStorage::copyInstance ( size_t  id,
agxData::EntityStorage target,
size_t  targetId 
)

◆ createInstance()

agxData::EntityPtr agxData::EntityStorage::createInstance ( )

Creates a new instance and initializes it with default values.

Returns
The instance

◆ createInstances()

agxData::EntityRange agxData::EntityStorage::createInstances ( size_t  numInstances)

Create a range of entity instances.

Returns
The range (only valid until storage is modified, e.g. by deleting an instance).

◆ createSharedStorage()

agxData::EntityStorage * agxData::EntityStorage::createSharedStorage ( )

Swap buffers with another storage.

Create a shared storage with the same buffer instances.

◆ dereferenceMultipliedAttribute() [1/4]

template<typename T >
agxData::Array< T > agxData::EntityStorage::dereferenceMultipliedAttribute ( const agxData::EntityPtr entity,
const agxData::ScalarAttributeT< T > *  attribute 
)

◆ dereferenceMultipliedAttribute() [2/4]

template<typename T >
const agxData::Array< T > agxData::EntityStorage::dereferenceMultipliedAttribute ( const agxData::EntityPtr entity,
const agxData::ScalarAttributeT< T > *  attribute 
) const

◆ dereferenceMultipliedAttribute() [3/4]

template<typename T >
Array< T > agxData::EntityStorage::dereferenceMultipliedAttribute ( const EntityPtr entity,
const ScalarAttributeT< T > *  attribute 
)

◆ dereferenceMultipliedAttribute() [4/4]

template<typename T >
const Array< T > agxData::EntityStorage::dereferenceMultipliedAttribute ( const EntityPtr entity,
const ScalarAttributeT< T > *  attribute 
) const

Definition at line 716 of file EntityStorage.h.

References dereferenceMultipliedAttribute().

◆ destroyInstance() [1/2]

void agxData::EntityStorage::destroyInstance ( agxData::EntityPtr  instance)

Definition at line 511 of file EntityStorage.h.

References destroyInstance(), and agxData::EntityPtr::getId().

Referenced by destroyInstance().

◆ destroyInstance() [2/2]

void agxData::EntityStorage::destroyInstance ( size_t  id)

◆ destroyInstances() [1/2]

void agxData::EntityStorage::destroyInstances ( agxData::EntityRange  range)

◆ destroyInstances() [2/2]

template<typename VectorT >
void agxData::EntityStorage::destroyInstances ( const VectorT &  instances)

Definition at line 724 of file EntityStorage.h.

References destroyInstances().

Referenced by destroyInstances().

◆ empty()

bool agxData::EntityStorage::empty ( ) const
Returns
True if the storage is empty.

Definition at line 443 of file EntityStorage.h.

References m_size.

◆ explicityRegisterBuffer()

void agxData::EntityStorage::explicityRegisterBuffer ( agxData::Buffer buffer,
agxData::Attribute attribute 
)
protected

◆ extractPermutation()

static void agxData::EntityStorage::extractPermutation ( agx::IndexVector result,
agxStream::InputArchive archive 
)
static

◆ get()

template<typename T >
T & agxData::EntityStorage::get ( const agx::Name attributeName,
size_t  index 
)

Slow but convenient accessor.

Definition at line 486 of file EntityStorage.h.

References agxAbort, agxData::Buffer::getElement(), agx::Object::getName(), and agx::Container::size().

◆ getBuffer() [1/2]

agxData::Buffer * agxData::EntityStorage::getBuffer ( const agx::Name name)
Returns
the buffer for a specific attribute.

Referenced by dereferenceMultipliedAttribute().

◆ getBuffer() [2/2]

Buffer * agxData::EntityStorage::getBuffer ( const agxData::Attribute attribute)

Definition at line 467 of file EntityStorage.h.

References agxData::Attribute::getId().

◆ getBuffers()

const BufferTable & agxData::EntityStorage::getBuffers ( ) const
Returns
all registered proxy buffers.

Definition at line 448 of file EntityStorage.h.

◆ getData() [1/3]

EntityData * agxData::EntityStorage::getData ( )
Returns
The entity data accessor.

Definition at line 520 of file EntityStorage.h.

Referenced by agx::Physics::HierarchicalGrid::countNumContacts(), and agxData::EntityPtr::getData().

◆ getData() [2/3]

template<typename T >
T * agxData::EntityStorage::getData

Definition at line 523 of file EntityStorage.h.

◆ getData() [3/3]

template<typename T >
const T * agxData::EntityStorage::getData

Definition at line 526 of file EntityStorage.h.

◆ getEntityModel() [1/2]

EntityModel * agxData::EntityStorage::getEntityModel ( )
Returns
The abstract entity for which the storage holds data.

Definition at line 446 of file EntityStorage.h.

Referenced by agxData::EntityInstance::getModel(), agxData::EntityPtr::getModel(), and agxData::EntityPtr::isInstanceOf().

◆ getEntityModel() [2/2]

const EntityModel * agxData::EntityStorage::getEntityModel ( ) const

Definition at line 447 of file EntityStorage.h.

◆ getGlobalOrderBuffer() [1/2]

Buffer * agxData::EntityStorage::getGlobalOrderBuffer ( )

If the storage is used as a global result, we provide a permutation buffer for parallel determinism.

Definition at line 451 of file EntityStorage.h.

◆ getGlobalOrderBuffer() [2/2]

const Buffer * agxData::EntityStorage::getGlobalOrderBuffer ( ) const

If the storage is used as a global result, we provide a permutation buffer for parallel determinism.

Definition at line 452 of file EntityStorage.h.

◆ getIdToIndexBuffer() [1/2]

Buffer * agxData::EntityStorage::getIdToIndexBuffer ( )
Returns
The idToIndex buffer

Definition at line 528 of file EntityStorage.h.

◆ getIdToIndexBuffer() [2/2]

const Buffer * agxData::EntityStorage::getIdToIndexBuffer ( ) const
Returns
The idToIndex buffer

Definition at line 529 of file EntityStorage.h.

◆ getIdToIndexTable() [1/2]

IndexArray & agxData::EntityStorage::getIdToIndexTable ( )

Definition at line 450 of file EntityStorage.h.

◆ getIdToIndexTable() [2/2]

const IndexArray & agxData::EntityStorage::getIdToIndexTable ( ) const

Definition at line 449 of file EntityStorage.h.

◆ getInstanceBuffer() [1/2]

Buffer * agxData::EntityStorage::getInstanceBuffer ( )
Returns
The instance buffer

Definition at line 531 of file EntityStorage.h.

◆ getInstanceBuffer() [2/2]

const Buffer * agxData::EntityStorage::getInstanceBuffer ( ) const
Returns
The instance buffer

Definition at line 532 of file EntityStorage.h.

◆ getInstances() [1/6]

Array< EntityPtr > agxData::EntityStorage::getInstances ( )

Definition at line 454 of file EntityStorage.h.

◆ getInstances() [2/6]

template<typename T >
agxData::Array< T > agxData::EntityStorage::getInstances ( )

◆ getInstances() [3/6]

template<typename T >
Array< T > agxData::EntityStorage::getInstances ( )

Definition at line 458 of file EntityStorage.h.

References agxAssert, agx::Referenced::is(), and agxData::Array< T >::raw().

◆ getInstances() [4/6]

const Array< EntityPtr > agxData::EntityStorage::getInstances ( ) const
Returns
An array of all active instances (only valid until storage is modified, e.g. by deleting an instance).

Definition at line 455 of file EntityStorage.h.

Referenced by agx::Physics::GranularBodySystem::getParticles().

◆ getInstances() [5/6]

template<typename T >
const agxData::Array< T > agxData::EntityStorage::getInstances ( ) const

◆ getInstances() [6/6]

template<typename T >
const Array< T > agxData::EntityStorage::getInstances ( ) const

Definition at line 465 of file EntityStorage.h.

◆ getNumBytes()

size_t agxData::EntityStorage::getNumBytes ( ) const
Returns
The number of allocated bytes.

◆ getOrCreateGlobalOrderBuffer()

agxData::Buffer * agxData::EntityStorage::getOrCreateGlobalOrderBuffer ( )

Create the global order buffer if not already allocated.

◆ getPermutationBuffer() [1/2]

Byte * agxData::EntityStorage::getPermutationBuffer ( agxData::Attribute attribute)

Definition at line 730 of file EntityStorage.h.

References agxData::Attribute::getId(), and getPermutationBuffer().

Referenced by getPermutationBuffer().

◆ getPermutationBuffer() [2/2]

Byte * agxData::EntityStorage::getPermutationBuffer ( size_t  index)

Definition at line 735 of file EntityStorage.h.

◆ getResourceImpl()

virtual agx::Object * agxData::EntityStorage::getResourceImpl ( const agx::Path path,
agx::Model model 
)
overrideprotectedvirtual

Reimplemented from agx::Component.

◆ hasListener()

bool agxData::EntityStorage::hasListener ( EventListener *  listener)

◆ idToIndex()

size_t agxData::EntityStorage::idToIndex ( size_t  id) const

Convert between instance id and data index.

Definition at line 500 of file EntityStorage.h.

Referenced by agxData::EntityPtr::calculateIndex().

◆ indexToId()

size_t agxData::EntityStorage::indexToId ( size_t  index) const

◆ keyFrameResize()

void agxData::EntityStorage::keyFrameResize ( size_t  size,
size_t  capacity 
)

◆ load()

static agxData::EntityStorage * agxData::EntityStorage::load ( agx::TiXmlElement *  eStorage,
agx::Device device 
)
static

◆ preDestroy()

void agxData::EntityStorage::preDestroy ( agxData::EntityPtr  instance)

◆ preparePermutation()

void agxData::EntityStorage::preparePermutation ( )

◆ presize()

size_t agxData::EntityStorage::presize ( size_t  size,
size_t  initialSize = 0 
)

◆ print() [1/2]

void agxData::EntityStorage::print ( ) const

◆ print() [2/2]

void agxData::EntityStorage::print ( std::ostream &  stream) const

Reorder a subrange.

◆ printInstanceTable()

void agxData::EntityStorage::printInstanceTable ( ) const

◆ removeListener()

void agxData::EntityStorage::removeListener ( EventListener *  listener)

◆ reorder()

void agxData::EntityStorage::reorder ( const agxData::IndexArray permutation)

Reorder the storage using a specified permutation.

◆ reorderAttributes()

void agxData::EntityStorage::reorderAttributes ( agx::IndexRange32  range,
const agxData::IndexArray permutation 
)

◆ reserve()

void agxData::EntityStorage::reserve ( size_t  size)

Reserve capacity in the storage.

◆ reset()

void agxData::EntityStorage::reset ( )

Clear the storage, and reset index-id tables.

◆ resize()

void agxData::EntityStorage::resize ( size_t  size,
bool  initializeElements = true 
)

◆ restorePermutation()

void agxData::EntityStorage::restorePermutation ( agxStream::InputArchive archive,
bool  skip = false 
)

◆ setEnableEvents()

void agxData::EntityStorage::setEnableEvents ( bool  flag)

◆ setUseInstanceTable()

void agxData::EntityStorage::setUseInstanceTable ( bool  flag)

Set to false to disable instance pointer handling.

Saves memory for instance buffer and idToIndex table, but invalidates any usage of EntityPtr references to this storage.

◆ size()

size_t agxData::EntityStorage::size ( ) const
Returns
The active size of the storage.

Definition at line 442 of file EntityStorage.h.

References m_size.

Referenced by agxData::EntityInstance::verifyIndex().

◆ storePermutation()

void agxData::EntityStorage::storePermutation ( agxStream::OutputArchive archive) const

◆ swapInstances() [1/2]

void agxData::EntityStorage::swapInstances ( const InstanceSwapLocalVector swaps)

◆ swapInstances() [2/2]

void agxData::EntityStorage::swapInstances ( const InstanceSwapVector swaps)

◆ transferInstance()

agxData::EntityPtr agxData::EntityStorage::transferInstance ( size_t  id,
agxData::EntityStorage target 
)

◆ unregisterBuffer()

void agxData::EntityStorage::unregisterBuffer ( agxData::Buffer buffer)

◆ useInstanceTable()

bool agxData::EntityStorage::useInstanceTable ( ) const
Returns
true if instance pointers are active (default).

Definition at line 445 of file EntityStorage.h.

◆ verifyConsistency()

void agxData::EntityStorage::verifyConsistency ( )

Member Data Documentation

◆ capacityParameter

agxData::ValueRefT<agx::UInt> agxData::EntityStorage::capacityParameter

Definition at line 90 of file EntityStorage.h.

Referenced by capacity().

◆ IdToIndexName

const agx::Name agxData::EntityStorage::IdToIndexName
static

Definition at line 327 of file EntityStorage.h.

◆ IndexToIdName

const agx::Name agxData::EntityStorage::IndexToIdName
static

Definition at line 328 of file EntityStorage.h.

◆ sizeParameter

agxData::ValueRefT<agx::UInt> agxData::EntityStorage::sizeParameter

Definition at line 89 of file EntityStorage.h.


The documentation for this class was generated from the following file: