AGX Dynamics 2.38.0.0
Loading...
Searching...
No Matches
agx::ElementaryContactPointFactory Class Referenceabstract

Interface factory for custom contact point constraint implementations. More...

#include <ElementaryContactPoint.h>

+ Inheritance diagram for agx::ElementaryContactPointFactory:

Public Member Functions

size_t begin ()
 Begin using 'get' given local index.
 
virtual ElementaryContactPointcreateInstance ()=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.
 
ElementaryContactPointget (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 ElementaryContactPointRefVectorgetCache () 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.
 
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.
 

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 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

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.

Constructor & Destructor Documentation

◆ ElementaryContactPointFactory()

agx::ElementaryContactPointFactory::ElementaryContactPointFactory ( )
protected

◆ ~ElementaryContactPointFactory()

virtual agx::ElementaryContactPointFactory::~ElementaryContactPointFactory ( )
protectedvirtual

Member Function Documentation

◆ begin()

size_t agx::ElementaryContactPointFactory::begin ( )

Begin using 'get' given local index.

The current usage, i.e., start index in the cache, is returned.

Returns
start index in the cache

◆ createInstance()

virtual ElementaryContactPoint * agx::ElementaryContactPointFactory::createInstance ( )
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.

Returns
new instance, invalid if nullptr

◆ end()

void agx::ElementaryContactPointFactory::end ( )

Flag that the constraint won't call 'get' anymore.

◆ get()

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.

Parameters
localIndex- local index in the cache
Returns
elementary contact point instance at the given index in the cache

◆ getCache()

const ElementaryContactPointRefVector & agx::ElementaryContactPointFactory::getCache ( ) const
Returns
the current cache

◆ increaseCache()

void agx::ElementaryContactPointFactory::increaseCache ( size_t  size)
protected

Increases the cache with the given size.

Parameters
size- size to increase the cache with

◆ reset()

void agx::ElementaryContactPointFactory::reset ( )

Reset the cache counter.


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