AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agxSDK::MergeSplitProperties Class Referenceabstract

#include <MergeSplitProperties.h>

+ Inheritance diagram for agxSDK::MergeSplitProperties:

Public Member Functions

 MergeSplitProperties ()
 Default constructor, sets default values to all thresholds and merge + split disabled. More...
 
void addGroup (const agx::Name &group)
 Add all rigid bodies with this MergeSplitProperty to the given merge ignore group. More...
 
void addGroup (agx::UInt32 group)
 Add all rigid bodies with this MergeSplitProperty to the given merge ignore group. 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
 
virtual agx::ICloneableRef clone (agx::ICloneable *child=nullptr)=0
 Creates a clone of this object. More...
 
agxSDK::ConstraintMergeSplitThresholds * getConstraintThresholds () const
 
agxSDK::GeometryContactMergeSplitThresholds * getContactThresholds () const
 
agx::Bool getEnableMerge () const
 
agx::Bool getEnableMergeSplit () const
 
agx::Bool getEnableSerialization () const
 
agx::Bool getEnableSplit () const
 
const agx::UInt32Vector & getGroupIds () const
 
const agx::NameVector & getGroupNames () const
 
agxSDK::ConstraintMergeSplitThresholds * getOrCreateConstraintThresholds ()
 
agxSDK::GeometryContactMergeSplitThresholds * getOrCreateContactThresholds ()
 
agxSDK::WireMergeSplitThresholds * getOrCreateWireThresholds ()
 
int getReferenceCount () const
 
agxSDK::WireMergeSplitThresholds * getWireThresholds () const
 
template<typename T >
bool is () const
 Subclass test. 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 removeGroup (const agx::Name &group)
 Remove the given merge ignore group from this MergeSplitProperty. More...
 
void removeGroup (agx::UInt32 group)
 Remove the given merge ignore group from this MergeSplitProperty. More...
 
void setConstraintThresholds (agxSDK::ConstraintMergeSplitThresholds *constraintThresholds)
 Assign constraint thresholds. More...
 
void setContactThresholds (agxSDK::GeometryContactMergeSplitThresholds *contactThresholds)
 Assign contact thresholds. More...
 
void setEnableMerge (agx::Bool enable)
 Enable/disable merge for this object. More...
 
void setEnableMergeSplit (agx::Bool enable)
 Enable/disable both merge and split for the object. More...
 
void setEnableSerialization (agx::Bool flag)
 Enable/disable native serialization of this object. More...
 
void setEnableSplit (agx::Bool enable)
 Enable/disable split for this object. More...
 
void setWireThresholds (agxSDK::WireMergeSplitThresholds *wireThresholds)
 Assign wire thresholds. 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...
 

Static Public Member Functions

static agx::UInt findCallbackIndex (agxSDK::MergeSplitAlgorithm::Callback callback)
 Maps given callback to an index (0, 1, 2, ...). More...
 
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

virtual ~MergeSplitProperties ()
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

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

Definition at line 38 of file MergeSplitProperties.h.

Constructor & Destructor Documentation

agxSDK::MergeSplitProperties::MergeSplitProperties ( )

Default constructor, sets default values to all thresholds and merge + split disabled.

virtual agxSDK::MergeSplitProperties::~MergeSplitProperties ( )
protectedvirtual

Member Function Documentation

void agxSDK::MergeSplitProperties::addGroup ( const agx::Name &  group)

Add all rigid bodies with this MergeSplitProperty to the given merge ignore group.

Merge can be disabled group-wise using MergeSplitHandler::setEnableMergePair.

The group name will be converted to a numeric group ID larger than MergeIgnoreFilter::MAX_UNAMED_GROUP_ID

Parameters
groupThe group name this MergeSplitProperty should be added to.
void agxSDK::MergeSplitProperties::addGroup ( agx::UInt32  group)

Add all rigid bodies with this MergeSplitProperty to the given merge ignore group.

Merge can be disabled group-wise using MergeSplitHandler::setEnableMergePair.

Group IDs larger than MergeIgnoreFilter::MAX_UNAMED_GROUP_ID are reserved for named merge ignore groups.

Parameters
groupThe group ID this MergeSplitProperty should be added to.
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
virtual agx::ICloneableRef agx::ICloneable::clone ( agx::ICloneable *  child = nullptr)
pure virtualinherited

Creates a clone of this object.

If not null, child is the pointer to the clone to be returned, but has been instantiated in a child class implementation.

Parameters
child- pointer to clone, if already created
Returns
a clone of this object

Implemented in agxSDK::GeometryContactMergeSplitThresholds, agxSDK::ConstraintMergeSplitThresholds, and agxSDK::WireMergeSplitThresholds.

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
agx::UInt agxSDK::MergeSplitProperties::findCallbackIndex ( agxSDK::MergeSplitAlgorithm::Callback  callback)
inlinestatic

Maps given callback to an index (0, 1, 2, ...).

Definition at line 257 of file MergeSplitProperties.h.

References agxAssert, agxSDK::MergeSplitAlgorithm::NONE, and agx::pow2Exponent().

Referenced by getConstraintThresholds(), getContactThresholds(), and getWireThresholds().

ConstraintMergeSplitThresholds * agxSDK::MergeSplitProperties::getConstraintThresholds ( ) const
inline
Returns
explicitly assigned constraint thresholds, nullptr if not assigned (default MergeSplitHandler::getConstraintThresholds() will be used)

Definition at line 247 of file MergeSplitProperties.h.

References agxSDK::MergeSplitAlgorithm::CONSTRAINTS, and findCallbackIndex().

GeometryContactMergeSplitThresholds * agxSDK::MergeSplitProperties::getContactThresholds ( ) const
inline
Returns
explicitly assigned contact thresholds, nullptr if not assigned (default MergeSplitHandler::getContactThresholds() will be used)

Definition at line 242 of file MergeSplitProperties.h.

References agxSDK::MergeSplitAlgorithm::CONTACTS, and findCallbackIndex().

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
agx::Bool agxSDK::MergeSplitProperties::getEnableMerge ( ) const
Returns
true if the object may merge

Definition at line 232 of file MergeSplitProperties.h.

Referenced by getEnableMergeSplit(), and agxSDK::MergeSplitHandler::mayMergeProperties().

agx::Bool agxSDK::MergeSplitProperties::getEnableMergeSplit ( ) const
Returns
true when both merge and split are enabled

Definition at line 227 of file MergeSplitProperties.h.

References getEnableMerge(), and getEnableSplit().

agx::Bool agxSDK::MergeSplitProperties::getEnableSerialization ( ) const
Returns
true if native serialization is enabled - otherwise false
agx::Bool agxSDK::MergeSplitProperties::getEnableSplit ( ) const
Returns
true if the object may split

Definition at line 237 of file MergeSplitProperties.h.

Referenced by getEnableMergeSplit(), and agxSDK::MergeSplitHandler::maySplitProperties().

const agx::UInt32Vector& agxSDK::MergeSplitProperties::getGroupIds ( ) const
Returns
Return group IDs for all merge ignore groups, including named.
const agx::NameVector& agxSDK::MergeSplitProperties::getGroupNames ( ) const
Returns
All group names added to this MergeSplitProperty.
agxSDK::ConstraintMergeSplitThresholds* agxSDK::MergeSplitProperties::getOrCreateConstraintThresholds ( )
Returns
explicitly assigned/create constraint thresholds, and in case of no assigned instance, a new (with default values) will be created
agxSDK::GeometryContactMergeSplitThresholds* agxSDK::MergeSplitProperties::getOrCreateContactThresholds ( )
Returns
explicitly assigned/create contact thresholds, and in case of no assigned instance, a new (with default values) will be created
agxSDK::WireMergeSplitThresholds* agxSDK::MergeSplitProperties::getOrCreateWireThresholds ( )
Returns
explicitly assigned/create wire thresholds, and in case of no assigned instance, a new (with default values) will be created
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
WireMergeSplitThresholds * agxSDK::MergeSplitProperties::getWireThresholds ( ) const
inline
Returns
explicitly assigned wire thresholds, nullptr if not assigned (default MergeSplitHandler::getWireThresholds() will be used)

Definition at line 252 of file MergeSplitProperties.h.

References findCallbackIndex(), and agxSDK::MergeSplitAlgorithm::WIRES.

template<typename T >
bool agx::Referenced::is ( ) const
inherited
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::MergeSplitProperties::removeGroup ( const agx::Name &  group)

Remove the given merge ignore group from this MergeSplitProperty.

Parameters
group- The name of the group to remove.
void agxSDK::MergeSplitProperties::removeGroup ( agx::UInt32  group)

Remove the given merge ignore group from this MergeSplitProperty.

Parameters
group- The ID of the group to remove.
void agxSDK::MergeSplitProperties::setConstraintThresholds ( agxSDK::ConstraintMergeSplitThresholds *  constraintThresholds)

Assign constraint thresholds.

If nullptr, the default MergeSplitHandler constraint thresholds will be used.

void agxSDK::MergeSplitProperties::setContactThresholds ( agxSDK::GeometryContactMergeSplitThresholds *  contactThresholds)

Assign contact thresholds.

If nullptr, the default MergeSplitHandler contact thresholds will be used.

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::MergeSplitProperties::setEnableMerge ( agx::Bool  enable)

Enable/disable merge for this object.

Parameters
enable- true to enable, false to disable
void agxSDK::MergeSplitProperties::setEnableMergeSplit ( agx::Bool  enable)

Enable/disable both merge and split for the object.

Parameters
enable- true to enable, false to disable
void agxSDK::MergeSplitProperties::setEnableSerialization ( agx::Bool  flag)

Enable/disable native serialization of this object.

Enabled by default.

void agxSDK::MergeSplitProperties::setEnableSplit ( agx::Bool  enable)

Enable/disable split for this object.

Parameters
enable- true to enable, false to disable
void agxSDK::MergeSplitProperties::setWireThresholds ( agxSDK::WireMergeSplitThresholds *  wireThresholds)

Assign wire thresholds.

If nullptr, the default MergeSplitHandler wire thresholds will be used.

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

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: