AGX Dynamics 2.38.0.0
|
Interface factory for custom contact point constraint implementations. More...
#include <ElementaryContactPoint.h>
Public Member Functions | |
size_t | begin () |
Begin using 'get' given local index. | |
virtual ElementaryContactPoint * | createInstance ()=0 |
Create a new instance when the requested index exceeds the size of the cache. | |
void | end () |
Flag that the constraint won't call 'get' anymore. | |
ElementaryContactPoint * | get (size_t localIndex) |
Returns an instance at the given index in the cache, e.g., this method can be used as (in a constraint implementation): factory->begin(); m_ec.push_back( factory->get( m_ec.size() ) ); m_ec.push_back( factory->get( m_ec.size() ) ); factory->end();. | |
const ElementaryContactPointRefVector & | getCache () const |
void | reset () |
Reset the cache counter. | |
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. | |
Referenced & | operator= (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. | |
Protected Member Functions | |
ElementaryContactPointFactory () | |
virtual | ~ElementaryContactPointFactory () |
void | increaseCache (size_t size) |
Increases the cache with the given size. | |
Protected Member Functions inherited from agx::Referenced | |
virtual | ~Referenced () |
Destructor. | |
void | allocateObserverVector () const |
void | deleteUsingDeleteHandler () const |
Additional Inherited Members | |
Static Public Member Functions inherited from agx::Referenced | |
template<typename T > | |
static bool | ValidateCast (const Referenced *object) |
Static Protected Member Functions inherited from agx::Referenced | |
static DeleteHandler * | getDeleteHandler () |
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 |
Interface factory for custom contact point constraint implementations.
The createInstance method is only called when the requested index exceeds the cache, i.e., it's assumed the elementary constraints can be reused between solves (yet 'configure' is called every step).
Definition at line 220 of file ElementaryContactPoint.h.
|
protected |
|
protectedvirtual |
size_t agx::ElementaryContactPointFactory::begin | ( | ) |
Begin using 'get' given local index.
The current usage, i.e., start index in the cache, is returned.
|
pure virtual |
Create a new instance when the requested index exceeds the size of the cache.
This method can be called multiple times and may not be related to the returned elementary contact point to be passed to a constraint and solved.
void agx::ElementaryContactPointFactory::end | ( | ) |
Flag that the constraint won't call 'get' anymore.
ElementaryContactPoint * agx::ElementaryContactPointFactory::get | ( | size_t | localIndex | ) |
Returns an instance at the given index in the cache, e.g., this method can be used as (in a constraint implementation): factory->begin(); m_ec.push_back( factory->get( m_ec.size() ) ); m_ec.push_back( factory->get( m_ec.size() ) ); factory->end();.
The cache is increased with the given index.
localIndex | - local index in the cache |
const ElementaryContactPointRefVector & agx::ElementaryContactPointFactory::getCache | ( | ) | const |
|
protected |
Increases the cache with the given size.
size | - size to increase the cache with |
void agx::ElementaryContactPointFactory::reset | ( | ) |
Reset the cache counter.