AGX Dynamics 2.41.3.0
Loading...
Searching...
No Matches
agxSDK::MergeSplitHandler Class Reference

Base class for a merge split algorithm handling a set of merged bodies. More...

#include <MergeSplitHandler.h>

+ Inheritance diagram for agxSDK::MergeSplitHandler:

Public Types

typedef agx::Vector< agx::MergedBodyRefMergedBodyRefContainer
 
typedef agx::Vector< agxSDK::MergeSplitAlgorithmRefMergeSplitAlgorithmContainer
 

Public Member Functions

agx::Bool add (agxSDK::MergeSplitAlgorithm *mergeSplitAlgorithm)
 Add new merge-split algorithm.
 
agx::MergedBodyRef createMergedBody () const
 Creates a new, empty, merged body object associated to this merge split handler.
 
template<typename T >
T * getAlgorithm () const
 
MergeSplitAlgorithmContainer getAlgorithms () const
 
agx::Bool getEnable () const
 
agx::Bool getEnableGlobalMerge () const
 
agx::Bool getEnableGlobalMergeSplit () const
 
agx::Bool getEnableGlobalSplit () const
 
agx::Bool getEnableMergePair (agx::UInt32 group1, agx::UInt32 group2)
 
agx::Bool getEnableMergePair (agx::UInt32 group1, const agx::Name &group2)
 
agx::Bool getEnableMergePair (const agx::Name &group1, agx::UInt32 group2)
 
agx::Bool getEnableMergePair (const agx::Name &group1, const agx::Name &group2)
 
agx::Bool getEnableSerialization () const
 
agx::Bool getEnableSplitOnSeparation () const
 
agxSDK::ConstraintMergeSplitThresholdsgetGlobalConstraintThresholds () const
 Global thresholds for constraints.
 
agxSDK::GeometryContactMergeSplitThresholdsgetGlobalContactThresholds () const
 Global thresholds for contacts.
 
agxSDK::WireMergeSplitThresholdsgetGlobalWireThresholds () const
 Global thresholds for wires.
 
const MergedBodyRefContainergetMergedBodies () const
 
const agxSDK::SimulationgetSimulation () const
 
agx::Bool mayMerge (const agx::RigidBody *rb1, const agx::RigidBody *rb2) const
 
agx::Bool mayMerge (const agx::RigidBody *rb1, const agxSDK::MergeSplitProperties *p1, const agx::RigidBody *rb2, const agxSDK::MergeSplitProperties *p2) const
 
agx::Bool mayMerge (const agxCollide::Geometry *geometry1, const agxCollide::Geometry *geometry2) const
 
agx::Bool mayMergeProperties (const agxSDK::MergeSplitProperties *properties) const
 
agx::Bool maySplit (const agx::RigidBody *rb) const
 
agx::Bool maySplit (const agx::RigidBody *rb, const agxSDK::MergeSplitProperties *properties) const
 
agx::Bool maySplitProperties (const agxSDK::MergeSplitProperties *properties) const
 
agx::Bool merge (agx::MergedBody::EdgeInteraction *edgeInteraction)
 Merge bodies given an edge interaction.
 
void registerMergedBody (agx::MergedBody *mergedBody)
 Register merged body to this merge-split handler.
 
agx::Bool remove (agxSDK::MergeSplitAlgorithm *mergeSplitAlgorithm)
 Remove split algorithm.
 
void setEnable (agx::Bool enable)
 Enable/disable merge split.
 
void setEnableGlobalMerge (agx::Bool enable)
 Enable/disable global merge for all objects not having their MergeSplitProperties set.
 
void setEnableGlobalMergeSplit (agx::Bool enable)
 Enable/disable global merge and split for all objects not having their MergeSplitProperties set.
 
void setEnableGlobalSplit (agx::Bool enable)
 Enable/disable global split for all objects not having their MergeSplitProperties set.
 
void setEnableMergePair (agx::UInt32 group1, agx::UInt32 group2, agx::Bool enable)
 If enable is false, from now on reject merges between bodies in the two groups even when the MergeSplitProperties of the two bodies would allow the merge to happen.
 
void setEnableMergePair (agx::UInt32 group1, const agx::Name &group2, agx::Bool enable)
 If enable is false, from now on reject merges between bodies in the two groups even when the MergeSplitProperties of the two bodies would allow the merge to happen.
 
void setEnableMergePair (const agx::Name &group1, agx::UInt32 group2, agx::Bool enable)
 If enable is false, from now on reject merges between bodies in the two groups even when the MergeSplitProperties of the two bodies would allow the merge to happen.
 
void setEnableMergePair (const agx::Name &group1, const agx::Name &group2, agx::Bool enable)
 If enable is false, from now on reject merges between bodies in the two groups even when the MergeSplitProperties of the two bodies would allow the merge to happen.
 
void setEnableSerialization (agx::Bool enable)
 Enable/disable serialization of this object.
 
void setEnableSplitOnSeparation (agx::Bool enable)
 Enable/disable split on separation events from Space.
 
void traverse (agx::MergedBody::EdgeInteractionVisitor visitor) const
 Traverse all edges currently active in all merged bodies handled by this handler.
 
bool writeConnectivityGraph (const char *filename) const
 Write the MergedBody graph as a .dot file to disk.
 
- 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.
 

Static Public Member Functions

static agxSDK::MergeSplitPropertiesgetOrCreateProperties (agx::Constraint *constraint)
 Creates (or returns already present) merge-split parameters given a constraint.
 
static agxSDK::MergeSplitPropertiesgetOrCreateProperties (agx::ConstraintImplementation *constraint)
 Creates (or returns already present) merge-split parameters given a constraint implementation.
 
static agxSDK::MergeSplitPropertiesgetOrCreateProperties (agx::RigidBody *rb)
 Creates (or returns already present) merge-split parameters given a rigid body.
 
static agxSDK::MergeSplitPropertiesgetOrCreateProperties (agxCollide::Geometry *geometry)
 Creates (or returns already present) merge-split parameters given a geometry.
 
static agxSDK::MergeSplitPropertiesgetOrCreateProperties (agxWire::Wire *wire)
 Creates (or returns already present) merge-split parameters given a wire.
 
static agxSDK::MergeSplitPropertiesgetProperties (agx::Constraint *constraint)
 Merge-split properties for the constraint, if created - otherwise null.
 
static agxSDK::MergeSplitPropertiesgetProperties (agx::ConstraintImplementation *constraint)
 Merge-split properties for the constraint, if created - otherwise null.
 
static agxSDK::MergeSplitPropertiesgetProperties (agx::RigidBody *rb)
 
static agxSDK::MergeSplitPropertiesgetProperties (agxCollide::Geometry *geometry)
 Merge-split properties for the geometry or inherited by the rigid body this geometry belongs to.
 
static agxSDK::MergeSplitPropertiesgetProperties (agxWire::Wire *wire)
 
static const agxSDK::MergeSplitPropertiesgetProperties (const agx::Constraint *constraint)
 Merge-split properties for the constraint, if created - otherwise null.
 
static const agxSDK::MergeSplitPropertiesgetProperties (const agx::ConstraintImplementation *constraint)
 Merge-split properties for the constraint, if created - otherwise null.
 
static const agxSDK::MergeSplitPropertiesgetProperties (const agx::RigidBody *rb)
 
static const agxSDK::MergeSplitPropertiesgetProperties (const agxCollide::Geometry *geometry)
 Merge-split properties for the geometry or inherited by the rigid body this geometry belongs to.
 
static const agxSDK::MergeSplitPropertiesgetProperties (const agxWire::Wire *wire)
 
static agx::Bool isMergedByHandler (const agx::RigidBody *rb)
 Determine if a body is merged explicitly (added to an agx::MergedBody by the user) or merged by an agxSDK::MergeSplitHandler.
 
static agx::Bool split (agx::RigidBody *rb)
 Split a rigid body that has been merged by a merge split handler.
 
static void transferProperties (const agx::RigidBody *source, agx::RigidBody *destination)
 Transfers merge-split properties from source rigid body to another rigid body instance.
 
static void transferProperties (const agxCollide::Geometry *source, agxCollide::Geometry *destination)
 Transfers merge-split properties from source geometry to another geometry instance.
 
static void transferProperties (const agxWire::Wire *wire, agx::Constraint *constraint)
 Transfers merge-split properties from the wire to the constraint.
 
static void transferProperties (const agxWire::Wire *wire, agx::RigidBody *rb)
 Transfers merge-split properties from the wire to the rigid body.
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

virtual ~MergeSplitHandler ()
 Reference counted object, protected destructor.
 
virtual void mergeSplitBegin ()
 Call before merge-split callbacks are being processed.
 
virtual void mergeSplitEnd ()
 Call after merge-split callbacks have been processed.
 
virtual void postStep ()
 Post-solver callback from simulation.
 
virtual void preCollide ()
 Pre-collide callback from simulation.
 
virtual void preStep ()
 Pre-solver callback from simulation.
 
virtual void reset (agx::Bool resetState=true)
 Reset call during simulation cleanup.
 
virtual void restore (agxStream::InputArchive &in)
 Restore call from the simulation.
 
virtual void separations (const agxCollide::SeparationPairVector &separations)
 Separation ballback from simulation.
 
virtual void store (agxStream::OutputArchive &out) const
 Store call from the simulation.
 
- 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

Base class for a merge split algorithm handling a set of merged bodies.

Definition at line 34 of file MergeSplitHandler.h.

Member Typedef Documentation

◆ MergedBodyRefContainer

◆ MergeSplitAlgorithmContainer

Constructor & Destructor Documentation

◆ ~MergeSplitHandler()

virtual agxSDK::MergeSplitHandler::~MergeSplitHandler ( )
protectedvirtual

Reference counted object, protected destructor.

Member Function Documentation

◆ add()

agx::Bool agxSDK::MergeSplitHandler::add ( agxSDK::MergeSplitAlgorithm mergeSplitAlgorithm)

Add new merge-split algorithm.

Parameters
mergeSplitAlgorithm- new merge-split algorithm
Returns
true if added, false if already present or invalid

◆ createMergedBody()

agx::MergedBodyRef agxSDK::MergeSplitHandler::createMergedBody ( ) const

Creates a new, empty, merged body object associated to this merge split handler.

I.e., bodies added to this merged body may be split, merged etc by the algorithms in this handler.

◆ getAlgorithm()

template<typename T >
T * agxSDK::MergeSplitHandler::getAlgorithm
Returns
the algorithm of given type

Definition at line 915 of file MergeSplitHandler.h.

◆ getAlgorithms()

MergeSplitAlgorithmContainer agxSDK::MergeSplitHandler::getAlgorithms ( ) const
Returns
the merge split algorithms

◆ getEnable()

agx::Bool agxSDK::MergeSplitHandler::getEnable ( ) const
Returns
true if merge split is enable

◆ getEnableGlobalMerge()

agx::Bool agxSDK::MergeSplitHandler::getEnableGlobalMerge ( ) const
Returns
true if merge is enabled globally for objects not having MergeSplitProperties

◆ getEnableGlobalMergeSplit()

agx::Bool agxSDK::MergeSplitHandler::getEnableGlobalMergeSplit ( ) const
Returns
true if merge-split is enabled globally for objects not having MergeSplitProperties

◆ getEnableGlobalSplit()

agx::Bool agxSDK::MergeSplitHandler::getEnableGlobalSplit ( ) const
Returns
true if split is enabled globally for objects not having MergeSplitProperties

◆ getEnableMergePair() [1/4]

agx::Bool agxSDK::MergeSplitHandler::getEnableMergePair ( agx::UInt32  group1,
agx::UInt32  group2 
)
Returns
False if merging between the two groups has been disabled.

◆ getEnableMergePair() [2/4]

agx::Bool agxSDK::MergeSplitHandler::getEnableMergePair ( agx::UInt32  group1,
const agx::Name group2 
)
Returns
False if merging between the two groups has been disabled.

◆ getEnableMergePair() [3/4]

agx::Bool agxSDK::MergeSplitHandler::getEnableMergePair ( const agx::Name group1,
agx::UInt32  group2 
)
Returns
False if merging between the two groups has been disabled.

◆ getEnableMergePair() [4/4]

agx::Bool agxSDK::MergeSplitHandler::getEnableMergePair ( const agx::Name group1,
const agx::Name group2 
)
Returns
False if merging between the two groups has been disabled.

◆ getEnableSerialization()

agx::Bool agxSDK::MergeSplitHandler::getEnableSerialization ( ) const
Returns
true if serialization of this object is enabled - otherwise false

◆ getEnableSplitOnSeparation()

agx::Bool agxSDK::MergeSplitHandler::getEnableSplitOnSeparation ( ) const
Returns
true if split on separation is enabled.

◆ getGlobalConstraintThresholds()

agxSDK::ConstraintMergeSplitThresholds * agxSDK::MergeSplitHandler::getGlobalConstraintThresholds ( ) const

Global thresholds for constraints.

These thresholds are used for all constraints that hasn't got explicitly assigned ConstraintMergeSplitThresholds instances.

Returns
the global constraint thresholds

◆ getGlobalContactThresholds()

agxSDK::GeometryContactMergeSplitThresholds * agxSDK::MergeSplitHandler::getGlobalContactThresholds ( ) const

Global thresholds for contacts.

These thresholds are used for all geometries/bodies that hasn't got explicitly assigned GeometryContactMergeSplitThresholds instances.

Returns
the global contact thresholds

◆ getGlobalWireThresholds()

agxSDK::WireMergeSplitThresholds * agxSDK::MergeSplitHandler::getGlobalWireThresholds ( ) const

Global thresholds for wires.

These thresholds are used for all wires that hasn't got explicitly assigned WireMergeSplitThresholds instances.

Returns
the global wire thresholds

◆ getMergedBodies()

const MergedBodyRefContainer & agxSDK::MergeSplitHandler::getMergedBodies ( ) const
Returns
the merged bodies created and handled by this handler

◆ getOrCreateProperties() [1/5]

static agxSDK::MergeSplitProperties * agxSDK::MergeSplitHandler::getOrCreateProperties ( agx::Constraint constraint)
static

Creates (or returns already present) merge-split parameters given a constraint.

This method will return null if the constraint is null.

Parameters
constraint- constraint to get merge-split parameters for.
Returns
merge-split parameters for the constraint.

◆ getOrCreateProperties() [2/5]

static agxSDK::MergeSplitProperties * agxSDK::MergeSplitHandler::getOrCreateProperties ( agx::ConstraintImplementation constraint)
static

Creates (or returns already present) merge-split parameters given a constraint implementation.

Currently only the 'merge' property is used. This method will return null if the constraint is null.

Parameters
constraint- constraint implementation to get merge-split parameters for.
Returns
merge-split parameters for the constraint implementation.

◆ getOrCreateProperties() [3/5]

static agxSDK::MergeSplitProperties * agxSDK::MergeSplitHandler::getOrCreateProperties ( agx::RigidBody rb)
static

Creates (or returns already present) merge-split parameters given a rigid body.

This method will return null if the rigid body is null.

Parameters
rb- rigid body to get merge-split parameters for
Returns
merge-split parameters for the rigid body

◆ getOrCreateProperties() [4/5]

static agxSDK::MergeSplitProperties * agxSDK::MergeSplitHandler::getOrCreateProperties ( agxCollide::Geometry geometry)
static

Creates (or returns already present) merge-split parameters given a geometry.

If this geometry currently doesn't have any merge-split properties but has a rigid body with merge-split properties as parent - the merge-split properties of the rigid body will be cloned. This method will return null if the geometry is null.

Parameters
geometry- geometry to get merge-split parameters for
Returns
merge-split parameters for the geometry

◆ getOrCreateProperties() [5/5]

static agxSDK::MergeSplitProperties * agxSDK::MergeSplitHandler::getOrCreateProperties ( agxWire::Wire wire)
static

Creates (or returns already present) merge-split parameters given a wire.

This method will return null if the wire is null.

Parameters
wire- wire to get merge-split parameters for
Returns
merge-split parameters for the wire

◆ getProperties() [1/10]

MergeSplitProperties * agxSDK::MergeSplitHandler::getProperties ( agx::Constraint constraint)
inlinestatic

Merge-split properties for the constraint, if created - otherwise null.

Parameters
constraint- constraint with parameters.
Returns
the merge-split parameters for constraint if present, otherwise null.

Definition at line 828 of file MergeSplitHandler.h.

References getProperties(), and agx::Constraint::getRep().

◆ getProperties() [2/10]

MergeSplitProperties * agxSDK::MergeSplitHandler::getProperties ( agx::ConstraintImplementation constraint)
static

Merge-split properties for the constraint, if created - otherwise null.

Parameters
constraint- ConstraintImplementation with parameters.
Returns
the merge-split parameters for constraint if present, otherwise null.

Definition at line 838 of file MergeSplitHandler.h.

◆ getProperties() [3/10]

MergeSplitProperties * agxSDK::MergeSplitHandler::getProperties ( agx::RigidBody rb)
static
Parameters
rb- rigid body with parameters
Returns
the merge-split parameters for rb if present, otherwise null

Definition at line 803 of file MergeSplitHandler.h.

◆ getProperties() [4/10]

MergeSplitProperties * agxSDK::MergeSplitHandler::getProperties ( agxCollide::Geometry geometry)
static

Merge-split properties for the geometry or inherited by the rigid body this geometry belongs to.

To create merge-split properties for this geometry, use getOrCreateProperties( geometry ).

Parameters
geometry- geometry with parameters
Returns
the merge-split parameters for geometry or parent rigid body if present, otherwise null

Definition at line 817 of file MergeSplitHandler.h.

References getProperties(), and agxCollide::Geometry::getRigidBody().

◆ getProperties() [5/10]

static agxSDK::MergeSplitProperties * agxSDK::MergeSplitHandler::getProperties ( agxWire::Wire wire)
static
Parameters
wire- wire with parameters
Returns
the merge-split parameters for wire if present, otherwise null

◆ getProperties() [6/10]

const MergeSplitProperties * agxSDK::MergeSplitHandler::getProperties ( const agx::Constraint constraint)
inlinestatic

Merge-split properties for the constraint, if created - otherwise null.

Parameters
constraint- ConstraintImplementation with parameters.
Returns
the merge-split parameters for constraint if present, otherwise null.

Definition at line 833 of file MergeSplitHandler.h.

References getProperties(), and agx::Constraint::getRep().

◆ getProperties() [7/10]

const MergeSplitProperties * agxSDK::MergeSplitHandler::getProperties ( const agx::ConstraintImplementation constraint)
static

Merge-split properties for the constraint, if created - otherwise null.

Parameters
constraint- ConstraintImplementation with parameters.
Returns
the merge-split parameters for constraint if present, otherwise null.

Definition at line 844 of file MergeSplitHandler.h.

◆ getProperties() [8/10]

const MergeSplitProperties * agxSDK::MergeSplitHandler::getProperties ( const agx::RigidBody rb)
static
Parameters
rb- rigid body with parameters
Returns
the merge-split parameters for rb if present, otherwise null

Definition at line 797 of file MergeSplitHandler.h.

Referenced by getProperties().

◆ getProperties() [9/10]

const MergeSplitProperties * agxSDK::MergeSplitHandler::getProperties ( const agxCollide::Geometry geometry)
static

Merge-split properties for the geometry or inherited by the rigid body this geometry belongs to.

To create merge-split properties for this geometry, use getOrCreateProperties( geometry ).

Parameters
geometry- geometry with parameters
Returns
the merge-split parameters for geometry or parent rigid body if present, otherwise null

Definition at line 809 of file MergeSplitHandler.h.

References getProperties(), and agxCollide::Geometry::getRigidBody().

◆ getProperties() [10/10]

static const agxSDK::MergeSplitProperties * agxSDK::MergeSplitHandler::getProperties ( const agxWire::Wire wire)
static
Parameters
wire- wire with parameters
Returns
the merge-split parameters for wire if present, otherwise null

◆ getSimulation()

const agxSDK::Simulation * agxSDK::MergeSplitHandler::getSimulation ( ) const
Returns
the simulation

◆ isMergedByHandler()

static agx::Bool agxSDK::MergeSplitHandler::isMergedByHandler ( const agx::RigidBody rb)
static

Determine if a body is merged explicitly (added to an agx::MergedBody by the user) or merged by an agxSDK::MergeSplitHandler.

Returns
true if the body is merged and is merged by an agxSDK::MergeSplitHandler - otherwise false

◆ mayMerge() [1/3]

agx::Bool agxSDK::MergeSplitHandler::mayMerge ( const agx::RigidBody rb1,
const agx::RigidBody rb2 
) const
Returns
true if merge is enabled between two objects with merge-split properties

◆ mayMerge() [2/3]

agx::Bool agxSDK::MergeSplitHandler::mayMerge ( const agx::RigidBody rb1,
const agxSDK::MergeSplitProperties p1,
const agx::RigidBody rb2,
const agxSDK::MergeSplitProperties p2 
) const
Returns
true if the bodies may merge given associated properties (the properties could belong to a geometry in the body)

◆ mayMerge() [3/3]

agx::Bool agxSDK::MergeSplitHandler::mayMerge ( const agxCollide::Geometry geometry1,
const agxCollide::Geometry geometry2 
) const
Returns
true if merge is enabled between the two geometries

◆ mayMergeProperties()

agx::Bool agxSDK::MergeSplitHandler::mayMergeProperties ( const agxSDK::MergeSplitProperties properties) const
inline
Returns
true if merge is enabled in the given properties or globally enabled

Definition at line 946 of file MergeSplitHandler.h.

References agxSDK::MergeSplitProperties::getEnableMerge().

◆ maySplit() [1/2]

agx::Bool agxSDK::MergeSplitHandler::maySplit ( const agx::RigidBody rb) const
Returns
true if split is possible for the body

Referenced by agxSDK::MergeSplitUtils::collectConnectingEdges().

◆ maySplit() [2/2]

agx::Bool agxSDK::MergeSplitHandler::maySplit ( const agx::RigidBody rb,
const agxSDK::MergeSplitProperties properties 
) const
Returns
true if split is enabled in the given properties or globally enabled

◆ maySplitProperties()

agx::Bool agxSDK::MergeSplitHandler::maySplitProperties ( const agxSDK::MergeSplitProperties properties) const
inline
Returns
true if split is enabled in the given properties or globally enabled

Definition at line 953 of file MergeSplitHandler.h.

References agxSDK::MergeSplitProperties::getEnableSplit().

◆ merge()

agx::Bool agxSDK::MergeSplitHandler::merge ( agx::MergedBody::EdgeInteraction edgeInteraction)

Merge bodies given an edge interaction.

Parameters
edgeInteraction- edge interaction between the bodies
Returns
true if the result is that the bodies are merged

◆ mergeSplitBegin()

virtual void agxSDK::MergeSplitHandler::mergeSplitBegin ( )
protectedvirtual

Call before merge-split callbacks are being processed.

◆ mergeSplitEnd()

virtual void agxSDK::MergeSplitHandler::mergeSplitEnd ( )
protectedvirtual

Call after merge-split callbacks have been processed.

◆ postStep()

virtual void agxSDK::MergeSplitHandler::postStep ( )
protectedvirtual

Post-solver callback from simulation.

◆ preCollide()

virtual void agxSDK::MergeSplitHandler::preCollide ( )
protectedvirtual

Pre-collide callback from simulation.

◆ preStep()

virtual void agxSDK::MergeSplitHandler::preStep ( )
protectedvirtual

Pre-solver callback from simulation.

◆ registerMergedBody()

void agxSDK::MergeSplitHandler::registerMergedBody ( agx::MergedBody mergedBody)

Register merged body to this merge-split handler.

After this call, mergedBody may be split and merged with others. Even removed from the simulation.

Parameters
mergedBody- merged body to hand over the control of to this handler

◆ remove()

agx::Bool agxSDK::MergeSplitHandler::remove ( agxSDK::MergeSplitAlgorithm mergeSplitAlgorithm)

Remove split algorithm.

Parameters
mergeSplitAlgorithm- merge-split algorithm to remove
Returns
true if removed, false if not present or invalid

◆ reset()

virtual void agxSDK::MergeSplitHandler::reset ( agx::Bool  resetState = true)
protectedvirtual

Reset call during simulation cleanup.

Parameters
resetState- if true the internal state will also be set to default

◆ restore()

virtual void agxSDK::MergeSplitHandler::restore ( agxStream::InputArchive in)
protectedvirtual

Restore call from the simulation.

◆ separations()

virtual void agxSDK::MergeSplitHandler::separations ( const agxCollide::SeparationPairVector separations)
protectedvirtual

Separation ballback from simulation.

Parameters
separations

◆ setEnable()

void agxSDK::MergeSplitHandler::setEnable ( agx::Bool  enable)

Enable/disable merge split.

Parameters
enable- true to enable merge split

◆ setEnableGlobalMerge()

void agxSDK::MergeSplitHandler::setEnableGlobalMerge ( agx::Bool  enable)

Enable/disable global merge for all objects not having their MergeSplitProperties set.

Parameters
enable- true to enable, false to disable

◆ setEnableGlobalMergeSplit()

void agxSDK::MergeSplitHandler::setEnableGlobalMergeSplit ( agx::Bool  enable)

Enable/disable global merge and split for all objects not having their MergeSplitProperties set.

Parameters
enable- true to enable, false to disable

◆ setEnableGlobalSplit()

void agxSDK::MergeSplitHandler::setEnableGlobalSplit ( agx::Bool  enable)

Enable/disable global split for all objects not having their MergeSplitProperties set.

Parameters
enable- true to enable, false to disable

◆ setEnableMergePair() [1/4]

void agxSDK::MergeSplitHandler::setEnableMergePair ( agx::UInt32  group1,
agx::UInt32  group2,
agx::Bool  enable 
)

If enable is false, from now on reject merges between bodies in the two groups even when the MergeSplitProperties of the two bodies would allow the merge to happen.

Merge groups cannot be used to enable merge for bodies whose MergeSplitProperty does not allow the merge to happen. It is a reject filter only.

Parameters
group1- The first group.
group2- The second group.
enable- True if merges should be rejected. False to restore default behavior.

◆ setEnableMergePair() [2/4]

void agxSDK::MergeSplitHandler::setEnableMergePair ( agx::UInt32  group1,
const agx::Name group2,
agx::Bool  enable 
)

If enable is false, from now on reject merges between bodies in the two groups even when the MergeSplitProperties of the two bodies would allow the merge to happen.

Merge groups cannot be used to enable merge for bodies whose MergeSplitProperty does not allow the merge to happen. It is a reject filter only.

Parameters
group1- The first group.
group2- The second group.
enable- True if merges should be rejected. False to restore default behavior.

◆ setEnableMergePair() [3/4]

void agxSDK::MergeSplitHandler::setEnableMergePair ( const agx::Name group1,
agx::UInt32  group2,
agx::Bool  enable 
)

If enable is false, from now on reject merges between bodies in the two groups even when the MergeSplitProperties of the two bodies would allow the merge to happen.

Merge groups cannot be used to enable merge for bodies whose MergeSplitProperty does not allow the merge to happen. It is a reject filter only.

Parameters
group1- The first group.
group2- The second group.
enable- True if merges should be rejected. False to restore default behavior.

◆ setEnableMergePair() [4/4]

void agxSDK::MergeSplitHandler::setEnableMergePair ( const agx::Name group1,
const agx::Name group2,
agx::Bool  enable 
)

If enable is false, from now on reject merges between bodies in the two groups even when the MergeSplitProperties of the two bodies would allow the merge to happen.

Merge groups cannot be used to enable merge for bodies whose MergeSplitProperty does not allow the merge to happen. It is a reject filter only.

Parameters
group1- The first group.
group2- The second group.
enable- True if merges should be rejected. False to restore default behavior.

◆ setEnableSerialization()

void agxSDK::MergeSplitHandler::setEnableSerialization ( agx::Bool  enable)

Enable/disable serialization of this object.

Default: enabled.

Parameters
enable- true to enable, false to disable serialization

◆ setEnableSplitOnSeparation()

void agxSDK::MergeSplitHandler::setEnableSplitOnSeparation ( agx::Bool  enable)

Enable/disable split on separation events from Space.

Parameters
enable- true to enable, false to disable.

◆ split()

static agx::Bool agxSDK::MergeSplitHandler::split ( agx::RigidBody rb)
static

Split a rigid body that has been merged by a merge split handler.

Parameters
rb- body to split
Returns
true if the body were merged by a merge split handler and now is successfully removed, otherwise false

◆ store()

virtual void agxSDK::MergeSplitHandler::store ( agxStream::OutputArchive out) const
protectedvirtual

Store call from the simulation.

◆ transferProperties() [1/4]

static void agxSDK::MergeSplitHandler::transferProperties ( const agx::RigidBody source,
agx::RigidBody destination 
)
static

Transfers merge-split properties from source rigid body to another rigid body instance.

Then destination instance will share merge-split properties instance with source.

Parameters
source- source rigid body instance
destination- destination rigid body instance

◆ transferProperties() [2/4]

static void agxSDK::MergeSplitHandler::transferProperties ( const agxCollide::Geometry source,
agxCollide::Geometry destination 
)
static

Transfers merge-split properties from source geometry to another geometry instance.

Then destination instance will share merge-split properties instance with source.

Parameters
source- source geometry instance
destination- destination geometry instance

◆ transferProperties() [3/4]

static void agxSDK::MergeSplitHandler::transferProperties ( const agxWire::Wire wire,
agx::Constraint constraint 
)
static

Transfers merge-split properties from the wire to the constraint.

Parameters
wire- parent wire object
constraint- constraint in wire, to get the merge-split properties of the wire

◆ transferProperties() [4/4]

static void agxSDK::MergeSplitHandler::transferProperties ( const agxWire::Wire wire,
agx::RigidBody rb 
)
static

Transfers merge-split properties from the wire to the rigid body.

Parameters
wire- parent wire object
rb- body, part of wire, to get the merge-split properties of the wire

◆ traverse()

void agxSDK::MergeSplitHandler::traverse ( agx::MergedBody::EdgeInteractionVisitor  visitor) const

Traverse all edges currently active in all merged bodies handled by this handler.

Parameters
visitor- visitor function

◆ writeConnectivityGraph()

bool agxSDK::MergeSplitHandler::writeConnectivityGraph ( const char *  filename) const

Write the MergedBody graph as a .dot file to disk.


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