AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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::MergedBodyRef > 
MergedBodyRefContainer
 
typedef agx::Vector
< agxSDK::MergeSplitAlgorithmRef > 
MergeSplitAlgorithmContainer
 

Public Member Functions

agx::Bool add (agxSDK::MergeSplitAlgorithm *mergeSplitAlgorithm)
 Add new merge-split algorithm. More...
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
agx::MergedBodyRef createMergedBody () const
 Creates a new, empty, merged body object associated to this merge split handler. More...
 
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 (const agx::Name &group1, const agx::Name &group2)
 
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 getEnableSerialization () const
 
agx::Bool getEnableSplitOnSeparation () const
 
agxSDK::ConstraintMergeSplitThresholds * getGlobalConstraintThresholds () const
 Global thresholds for constraints. More...
 
agxSDK::GeometryContactMergeSplitThresholds * getGlobalContactThresholds () const
 Global thresholds for contacts. More...
 
agxSDK::WireMergeSplitThresholds * getGlobalWireThresholds () const
 Global thresholds for wires. More...
 
const MergedBodyRefContainer & getMergedBodies () const
 
int getReferenceCount () const
 
const agxSDK::Simulation * getSimulation () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
agx::Bool mayMerge (const agx::RigidBody *rb1, const agx::RigidBody *rb2) const
 
agx::Bool mayMerge (const agxCollide::Geometry *geometry1, const agxCollide::Geometry *geometry2) const
 
agx::Bool mayMerge (const agx::RigidBody *rb1, const agxSDK::MergeSplitProperties *p1, const agx::RigidBody *rb2, const agxSDK::MergeSplitProperties *p2) 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. More...
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void registerMergedBody (agx::MergedBody *mergedBody)
 Register merged body to this merge-split handler. More...
 
agx::Bool remove (agxSDK::MergeSplitAlgorithm *mergeSplitAlgorithm)
 Remove split algorithm. More...
 
void setEnable (agx::Bool enable)
 Enable/disable merge split. More...
 
void setEnableGlobalMerge (agx::Bool enable)
 Enable/disable global merge for all objects not having their MergeSplitProperties set. More...
 
void setEnableGlobalMergeSplit (agx::Bool enable)
 Enable/disable global merge and split for all objects not having their MergeSplitProperties set. More...
 
void setEnableGlobalSplit (agx::Bool enable)
 Enable/disable global split for all objects not having their MergeSplitProperties set. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void setEnableSerialization (agx::Bool enable)
 Enable/disable serialization of this object. More...
 
void setEnableSplitOnSeparation (agx::Bool enable)
 Enable/disable split on separation events from Space. More...
 
void traverse (agx::MergedBody::EdgeInteractionVisitor visitor) const
 Traverse all edges currently active in all merged bodies handled by this handler. More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
bool writeConnectivityGraph (const char *filename) const
 Write the MergedBody graph as a .dot file to disk. More...
 

Static Public Member Functions

static
agxSDK::MergeSplitProperties * 
getOrCreateProperties (agx::RigidBody *rb)
 Creates (or returns already present) merge-split parameters given a rigid body. More...
 
static
agxSDK::MergeSplitProperties * 
getOrCreateProperties (agxCollide::Geometry *geometry)
 Creates (or returns already present) merge-split parameters given a geometry. More...
 
static
agxSDK::MergeSplitProperties * 
getOrCreateProperties (agx::Constraint *constraint)
 Creates (or returns already present) merge-split parameters given a constraint. More...
 
static
agxSDK::MergeSplitProperties * 
getOrCreateProperties (agx::ConstraintImplementation *constraint)
 Creates (or returns already present) merge-split parameters given a constraint implementation. More...
 
static
agxSDK::MergeSplitProperties * 
getOrCreateProperties (agxWire::Wire *wire)
 Creates (or returns already present) merge-split parameters given a wire. More...
 
static const
agxSDK::MergeSplitProperties * 
getProperties (const agx::RigidBody *rb)
 
static
agxSDK::MergeSplitProperties * 
getProperties (agx::RigidBody *rb)
 
static const
agxSDK::MergeSplitProperties * 
getProperties (const agxCollide::Geometry *geometry)
 Merge-split properties for the geometry or inherited by the rigid body this geometry belongs to. More...
 
static
agxSDK::MergeSplitProperties * 
getProperties (agxCollide::Geometry *geometry)
 Merge-split properties for the geometry or inherited by the rigid body this geometry belongs to. More...
 
static
agxSDK::MergeSplitProperties * 
getProperties (agx::Constraint *constraint)
 Merge-split properties for the constraint, if created - otherwise null. More...
 
static const
agxSDK::MergeSplitProperties * 
getProperties (const agx::Constraint *constraint)
 Merge-split properties for the constraint, if created - otherwise null. More...
 
static
agxSDK::MergeSplitProperties * 
getProperties (agx::ConstraintImplementation *constraint)
 Merge-split properties for the constraint, if created - otherwise null. More...
 
static const
agxSDK::MergeSplitProperties * 
getProperties (const agx::ConstraintImplementation *constraint)
 Merge-split properties for the constraint, if created - otherwise null. More...
 
static
agxSDK::MergeSplitProperties * 
getProperties (agxWire::Wire *wire)
 
static const
agxSDK::MergeSplitProperties * 
getProperties (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. More...
 
static agx::Bool split (agx::RigidBody *rb)
 Split a rigid body that has been merged by a merge split handler. More...
 
static void transferProperties (const agxCollide::Geometry *source, agxCollide::Geometry *destination)
 Transfers merge-split properties from source geometry to another geometry instance. More...
 
static void transferProperties (const agx::RigidBody *source, agx::RigidBody *destination)
 Transfers merge-split properties from source rigid body to another rigid body instance. More...
 
static void transferProperties (const agxWire::Wire *wire, agx::RigidBody *rb)
 Transfers merge-split properties from the wire to the rigid body. More...
 
static void transferProperties (const agxWire::Wire *wire, agx::Constraint *constraint)
 Transfers merge-split properties from the wire to the constraint. More...
 
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

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

Static Protected Member Functions

static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Protected Attributes

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

Constructor & Destructor Documentation

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

Reference counted object, protected destructor.

Member Function Documentation

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
void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().

template<typename T >
const T* agx::Referenced::as ( ) const
inherited
template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
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.

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
template<typename T >
T * agxSDK::MergeSplitHandler::getAlgorithm ( ) const
Returns
the algorithm of given type

Definition at line 915 of file MergeSplitHandler.h.

MergeSplitAlgorithmContainer agxSDK::MergeSplitHandler::getAlgorithms ( ) const
Returns
the merge split algorithms
static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
agx::Bool agxSDK::MergeSplitHandler::getEnable ( ) const
Returns
true if merge split is enable
agx::Bool agxSDK::MergeSplitHandler::getEnableGlobalMerge ( ) const
Returns
true if merge is enabled globally for objects not having MergeSplitProperties
agx::Bool agxSDK::MergeSplitHandler::getEnableGlobalMergeSplit ( ) const
Returns
true if merge-split is enabled globally for objects not having MergeSplitProperties
agx::Bool agxSDK::MergeSplitHandler::getEnableGlobalSplit ( ) const
Returns
true if split is enabled globally for objects not having MergeSplitProperties
agx::Bool agxSDK::MergeSplitHandler::getEnableMergePair ( const agx::Name &  group1,
const agx::Name &  group2 
)
Returns
False if merging between the two groups has been disabled.
agx::Bool agxSDK::MergeSplitHandler::getEnableMergePair ( agx::UInt32  group1,
agx::UInt32  group2 
)
Returns
False if merging between the two groups has been disabled.
agx::Bool agxSDK::MergeSplitHandler::getEnableMergePair ( agx::UInt32  group1,
const agx::Name &  group2 
)
Returns
False if merging between the two groups has been disabled.
agx::Bool agxSDK::MergeSplitHandler::getEnableMergePair ( const agx::Name &  group1,
agx::UInt32  group2 
)
Returns
False if merging between the two groups has been disabled.
agx::Bool agxSDK::MergeSplitHandler::getEnableSerialization ( ) const
Returns
true if serialization of this object is enabled - otherwise false
agx::Bool agxSDK::MergeSplitHandler::getEnableSplitOnSeparation ( ) const
Returns
true if split on separation is enabled.
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
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
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
const MergedBodyRefContainer& agxSDK::MergeSplitHandler::getMergedBodies ( ) const
Returns
the merged bodies created and handled by this handler
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
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
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.
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.
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
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().

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.

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().

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().

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().

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().

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.

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.

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
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
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
const agxSDK::Simulation* agxSDK::MergeSplitHandler::getSimulation ( ) const
Returns
the simulation
template<typename T >
bool agx::Referenced::is ( ) const
inherited
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
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
agx::Bool agxSDK::MergeSplitHandler::mayMerge ( const agxCollide::Geometry *  geometry1,
const agxCollide::Geometry *  geometry2 
) const
Returns
true if merge is enabled between the two geometries
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)
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().

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

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

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
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().

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
virtual void agxSDK::MergeSplitHandler::mergeSplitBegin ( )
protectedvirtual

Call before merge-split callbacks are being processed.

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

Call after merge-split callbacks have been processed.

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

Post-solver callback from simulation.

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

Pre-collide callback from simulation.

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

Pre-solver callback from simulation.

void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.

This method should be used with care, always balanced with the same number of calls to unreference.

Referenced by agxData::Val< UInt >::Val().

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
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
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
virtual void agxSDK::MergeSplitHandler::restore ( agxStream::InputArchive &  in)
protectedvirtual

Restore call from the simulation.

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

Separation ballback from simulation.

Parameters
separations
static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

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

Enable/disable merge split.

Parameters
enable- true to enable merge split
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
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
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
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.
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.
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.
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.
void agxSDK::MergeSplitHandler::setEnableSerialization ( agx::Bool  enable)

Enable/disable serialization of this object.

Default: enabled.

Parameters
enable- true to enable, false to disable serialization
void agxSDK::MergeSplitHandler::setEnableSplitOnSeparation ( agx::Bool  enable)

Enable/disable split on separation events from Space.

Parameters
enable- true to enable, false to disable.
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
virtual void agxSDK::MergeSplitHandler::store ( agxStream::OutputArchive &  out) const
protectedvirtual

Store call from the simulation.

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
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
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
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
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
void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

This method should be used with care, always balanced with the same number of calls to reference.

void agx::Referenced::unreference_nodelete ( ) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited
bool agxSDK::MergeSplitHandler::writeConnectivityGraph ( const char *  filename) const

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

Member Data Documentation

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.


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