AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxModel::IDeformableAlgorithm Class Reference

Interface for features of deformable objects, e.g., geometry, constraints, contact model etc. More...

#include <DeformableAlgorithm.h>

+ Inheritance diagram for agxModel::IDeformableAlgorithm:

Classes

struct  GroupId
 Group id, name or index, one is valid. More...
 

Public Types

enum class  Purpose : agx::UInt16 {
  UNKNOWN = 0 , SURFACE_GEOMETRY_CONSUMER = 1 << 0 , SURFACE_GEOMETRY_PRODUCER = 1 << 4 , VERTEX_CONSUMER = SURFACE_GEOMETRY_PRODUCER ,
  VERTEX_PRODUCER = 1 << 8
}
 The purpose of the algorithm defines in which order the algorithms callbacks are executed. More...
 

Public Member Functions

DeformableObject & getDeformable ()
 
const DeformableObject & getDeformable () const
 
DTetrahedronMesh & getMesh ()
 
const DTetrahedronMesh & getMesh () const
 
const agx::Name & getName () const
 
agx::UInt16 getPriority () const
 
Purpose getPurpose () const
 
virtual void initialize ()
 Initialize to a valid state, before added to the simulation.
 
virtual void onAddNotification (agxSDK::Simulation &simulation)
 When initialized and now being added to the given simulation.
 
virtual void onGroupAdd (const GroupId &group)
 Called when a new group has been added.
 
virtual void onGroupRemove (const GroupId &group)
 Called when an existing group has been removed.
 
virtual void onLastStep ()
 On last step event.
 
virtual void onMaterialNew ()
 Called when a new material has been assigned.
 
virtual void onPostStep ()
 On post step event, before user event.
 
virtual void onPreCollideStep ()
 On pre-collide step event, after user event, before collision detection.
 
virtual void onPreStep ()
 On pre step event, after user event, before solver.
 
virtual void onRemoveNotification (agxSDK::Simulation &simulation)
 Remove all objects previously added from the given simulation.
 
virtual void onSetEnableCollisions (agxCollide::Geometry *geometry, bool enable)
 Called when collision state changed for given geometry.
 
- 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.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Static Public Member Functions

static void sort (IDeformableAlgorithmRefVector &algorithms)
 Sort the set of algorithms given priority.
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Additional Inherited Members

- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 
- 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
 

Detailed Description

Interface for features of deformable objects, e.g., geometry, constraints, contact model etc.

Definition at line 47 of file DeformableAlgorithm.h.

Member Enumeration Documentation

◆ Purpose

The purpose of the algorithm defines in which order the algorithms callbacks are executed.

The value is the "priority" where higher values are executed earlier.

Enumerator
UNKNOWN 
SURFACE_GEOMETRY_CONSUMER 

Depends on the surface geometry of the deformable.

Typically contact models.

SURFACE_GEOMETRY_PRODUCER 

Depends on the vertex positions of the deformabe.

Typically trimesh surface models.

VERTEX_CONSUMER 

Depends on the vertex positions of the deformabe.

VERTEX_PRODUCER 

"Updates" the vertex positions of the deformable.

Typically the constraint models.

Definition at line 78 of file DeformableAlgorithm.h.

Member Function Documentation

◆ getDeformable() [1/2]

DeformableObject & agxModel::IDeformableAlgorithm::getDeformable ( )
inline
Returns
the deformable object this algorithm is part of

Definition at line 253 of file DeformableAlgorithm.h.

◆ getDeformable() [2/2]

const DeformableObject & agxModel::IDeformableAlgorithm::getDeformable ( ) const
inline
Returns
the deformable object this algorithm is part of

Definition at line 258 of file DeformableAlgorithm.h.

◆ getMesh() [1/2]

DTetrahedronMesh & agxModel::IDeformableAlgorithm::getMesh ( )
Returns
the mesh of deformable object this algorithm is part of

◆ getMesh() [2/2]

const DTetrahedronMesh & agxModel::IDeformableAlgorithm::getMesh ( ) const
Returns
the mesh of deformable object this algorithm is part of

◆ getName()

const agx::Name & agxModel::IDeformableAlgorithm::getName ( ) const
Returns
the name of the algorithm

◆ getPriority()

agx::UInt16 agxModel::IDeformableAlgorithm::getPriority ( ) const
Returns
the events priority of this algorithm

◆ getPurpose()

Purpose agxModel::IDeformableAlgorithm::getPurpose ( ) const
Returns
the purpose if this algorithm

◆ initialize()

virtual void agxModel::IDeformableAlgorithm::initialize ( )
virtual

Initialize to a valid state, before added to the simulation.

This method is guaranteed to only be called once by the deformable object.

Reimplemented in agxModel::DeformableConstraintT< T >, agxModel::DeformableConstraintT< ElementaryTetrahedronConstraint6C >, and agxModel::DeformableGeometryTrimesh.

◆ onAddNotification()

virtual void agxModel::IDeformableAlgorithm::onAddNotification ( agxSDK::Simulation &  simulation)
virtual

◆ onGroupAdd()

virtual void agxModel::IDeformableAlgorithm::onGroupAdd ( const GroupId &  group)
virtual

Called when a new group has been added.

Parameters
group- collision group added

Reimplemented in agxModel::DeformableGeometryTrimesh, and agxModel::IDeformableGeometry.

◆ onGroupRemove()

virtual void agxModel::IDeformableAlgorithm::onGroupRemove ( const GroupId &  group)
virtual

Called when an existing group has been removed.

Parameters
group- collision group removed

Reimplemented in agxModel::DeformableGeometryTrimesh, and agxModel::IDeformableGeometry.

◆ onLastStep()

virtual void agxModel::IDeformableAlgorithm::onLastStep ( )
virtual

On last step event.

◆ onMaterialNew()

virtual void agxModel::IDeformableAlgorithm::onMaterialNew ( )
virtual

Called when a new material has been assigned.

Reimplemented in agxModel::IDeformableConstraint, agxModel::DeformableGeometryTrimesh, and agxModel::IDeformableGeometry.

◆ onPostStep()

virtual void agxModel::IDeformableAlgorithm::onPostStep ( )
virtual

On post step event, before user event.

Reimplemented in agxModel::IDeformableConstraint, and agxModel::DeformableGeometryTrimesh.

◆ onPreCollideStep()

virtual void agxModel::IDeformableAlgorithm::onPreCollideStep ( )
virtual

On pre-collide step event, after user event, before collision detection.

Reimplemented in agxModel::IDeformableConstraint, and agxModel::DeformableGeometryTrimesh.

◆ onPreStep()

virtual void agxModel::IDeformableAlgorithm::onPreStep ( )
virtual

On pre step event, after user event, before solver.

Reimplemented in agxModel::DeformableContactModelClosestVertex.

◆ onRemoveNotification()

virtual void agxModel::IDeformableAlgorithm::onRemoveNotification ( agxSDK::Simulation &  simulation)
virtual

Remove all objects previously added from the given simulation.

The state "initialized" must still be valid after this call, it might be added to the simulation again.

Parameters
simulation- simulation being removed from

Reimplemented in agxModel::IDeformableConstraint, agxModel::DeformableConstraintT< T >, agxModel::DeformableConstraintT< ElementaryTetrahedronConstraint6C >, agxModel::DeformableContactModelClosestVertex, and agxModel::DeformableGeometryTrimesh.

◆ onSetEnableCollisions()

virtual void agxModel::IDeformableAlgorithm::onSetEnableCollisions ( agxCollide::Geometry *  geometry,
bool  enable 
)
virtual

Called when collision state changed for given geometry.

Parameters
geometry- geometry to enable/disable collisions with
enable- true to enable, false to disable

◆ sort()

static void agxModel::IDeformableAlgorithm::sort ( IDeformableAlgorithmRefVector &  algorithms)
static

Sort the set of algorithms given priority.

Higher priority first.

Parameters
algorithms- vector of algorithms

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