32 class GeometryContactMergeSplitThresholds;
33 class ConstraintMergeSplitThresholds;
34 class WireMergeSplitThresholds;
192 void storeLightData(
agxStream::StorageStream& str ) const;
193 void restoreLightData(
agxStream::StorageStream& str );
196 T* getMergeSplitThresholds( const
agx::
UInt index ) const;
205 MERGE_ENABLED = 1 << 0,
206 SPLIT_ENABLED = 1 << 1,
207 SERIALIZATION_ENABLED = 1 << 2
211 typedef agx::BitState< EState, agx::Int32 >
State;
216 T* getOrCreateMergeSplitThresholds(
const agx::UInt index );
223 ThresholdsContainer m_thresholds;
234 return m_state.Is( MERGE_ENABLED );
239 return m_state.Is( SPLIT_ENABLED );
264 inline T* MergeSplitProperties::getMergeSplitThresholds(
const agx::UInt index )
const
266 agxAssert( index >= m_thresholds.
size() || m_thresholds[ index ] ==
nullptr || m_thresholds[ index ]->is<T>() );
268 return index < m_thresholds.
size() ? (T*)m_thresholds[ index ].get() :
nullptr;
272 T* MergeSplitProperties::getOrCreateMergeSplitThresholds(
const agx::UInt index )
274 if ( index < m_thresholds.
size() && m_thresholds[ index ] !=
nullptr ) {
275 agxAssert( m_thresholds[ index ]->is<T>() );
276 return (T*)m_thresholds[ index ].get();
279 return setMergeSplitThresholds<T>( index,
new T() );
285 if ( index >= m_thresholds.
size() )
286 m_thresholds.
resize( index + 1 );
288 return (T*)( m_thresholds[ index ] = thresholds ).get();
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXPHYSICS_EXPORT
Specific thresholds used to split and merge objects given constraints.
A collection of merge ignore groups, some named and some not.
agx::Bool getEnableMerge() const
void setEnableSerialization(agx::Bool flag)
Enable/disable native serialization of this object.
void setEnableMerge(agx::Bool enable)
Enable/disable merge for this object.
void setContactThresholds(agxSDK::GeometryContactMergeSplitThresholds *contactThresholds)
Assign contact thresholds.
static agx::UInt findCallbackIndex(agxSDK::MergeSplitAlgorithm::Callback callback)
Maps given callback to an index (0, 1, 2, ...).
agxSDK::GeometryContactMergeSplitThresholds * getContactThresholds() const
const agx::NameVector & getGroupNames() const
agx::Bool getEnableSerialization() const
void removeGroup(const agx::Name &group)
Remove the given merge ignore group from this MergeSplitProperty.
agxSDK::WireMergeSplitThresholds * getOrCreateWireThresholds()
MergeSplitProperties()
Default constructor, sets default values to all thresholds and merge + split disabled.
void setConstraintThresholds(agxSDK::ConstraintMergeSplitThresholds *constraintThresholds)
Assign constraint thresholds.
agxSDK::WireMergeSplitThresholds * getWireThresholds() const
void addGroup(agx::UInt32 group)
Add all rigid bodies with this MergeSplitProperty to the given merge ignore group.
agxSDK::GeometryContactMergeSplitThresholds * getOrCreateContactThresholds()
agxSDK::ConstraintMergeSplitThresholds * getConstraintThresholds() const
const agx::UInt32Vector & getGroupIds() const
agx::Bool getEnableMergeSplit() const
void setWireThresholds(agxSDK::WireMergeSplitThresholds *wireThresholds)
Assign wire thresholds.
agxSDK::ConstraintMergeSplitThresholds * getOrCreateConstraintThresholds()
void removeGroup(agx::UInt32 group)
Remove the given merge ignore group from this MergeSplitProperty.
void addGroup(const agx::Name &group)
Add all rigid bodies with this MergeSplitProperty to the given merge ignore group.
void setEnableSplit(agx::Bool enable)
Enable/disable split for this object.
agx::Bool getEnableSplit() const
void setEnableMergeSplit(agx::Bool enable)
Enable/disable both merge and split for the object.
Specific thresholds used to split and merge objects given wires.
Interface class for a cloneable reference counted object.
Representation of a name string.
void resize(size_t size)
Resize the vector, which then enables direct addressing using the bracket '[]' operator.
Smart pointer for handling referenced counted objects.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::ref_ptr< ICloneable > ICloneableRef
agx::UInt32 pow2Exponent(T value)
Finds and returns n given value = 2^n.