AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxWire::LinkObjectStabilizingAlgorithm Class Referenceabstract

(Optional) Link algorithm that tries to stabilize the link when the link is in contact with an object. More...

#include <LinkAlgorithms.h>

+ Inheritance diagram for agxWire::LinkObjectStabilizingAlgorithm:

Public Types

typedef agx::ref_ptr< GeometryPropertyBoolFilter > GeometryPropertyBoolFilterRef
 
typedef agx::ref_ptr< RigidBodyPropertyBoolFilter > RigidBodyPropertyBoolFilterRef
 

Public Member Functions

 LinkObjectStabilizingAlgorithm (agxWire::LinkObjectStabilizingAlgorithm::LinkExecuteFilter *filter, agx::Real tensionThreshold=agx::Real(1E4))
 Construct given filter to filter out which objects should have this feature.
 
 GeometryPropertyBoolFilter (const agx::String &propertyName, const agxWire::Link *link)
 Construct matching filter given property-bool name and the link.
 
const agxWire::Link * getLink () const
 
agx::Real getTensionThreshold () const
 
 LinkExecuteFilter (const agxWire::Link *link)
 Construct given link this algorithm belongs to.
 
 RigidBodyPropertyBoolFilter (const agx::String &propertyName, const agxWire::Link *link)
 Construct matching filter given property-bool name and the link.
 
void setTensionThreshold (agx::Real tensionThreshold)
 Assign new tension threshold defining the moment the stabilizing constraints should be applied.
 
- 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.
 

Protected Types

typedef agx::Vector< agx::LockJointRef > ConstraintContainer
 

Protected Member Functions

 LinkObjectStabilizingAlgorithm ()
 Protected default constructor, used during restore.
 
virtual ~GeometryPropertyBoolFilter ()
 Reference counted object, protected destructor.
 
virtual ~LinkObjectStabilizingAlgorithm ()
 Reference counted object, protected destructor.
 
virtual ~RigidBodyPropertyBoolFilter ()
 Reference counted object, protected destructor.
 
 GeometryPropertyBoolFilter ()
 Protected default constructor, used during restore.
 
virtual bool match (const agxCollide::Geometry *geometry1, const agxCollide::Geometry *geometry2) const override
 Base match method which determines which geometry belongs to the link and who's not.
 
virtual bool matchOther (const agxCollide::Geometry *otherGeometry) const =0
 Called when this base filter has determined which geometry that's not part of the link - the otherGeometry.
 
virtual bool matchOther (const agxCollide::Geometry *otherGeometry) const override
 Match function.
 
virtual bool matchOther (const agxCollide::Geometry *otherGeometry) const override
 Match function.
 
template<typename T >
agx::Bool matchT (const T *obj) const
 Match function for either agxCollide::Geometry or agx::RigidBody.
 
virtual void onLinkEnable (agx::Bool enable, agxWire::Link *link, agxSDK::SimulationProxy *simulationProxy) override
 Adding contact listener if link switched from disabled do enabled, otherwise removing the contact listener.
 
virtual void post (agxWire::Link *link, agxSDK::SimulationProxy *simulationProxy) override
 Removing the stabilizing constraints.
 
virtual void pre (agxWire::Link *link, agxSDK::SimulationProxy *simulationProxy) override
 Checks stability and adding stabilizing constraints if needed.
 
 RigidBodyPropertyBoolFilter ()
 Protected default constructor, used during restore.
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Protected Attributes

ConstraintContainer m_constraints
 
agxSDK::ContactEventListenerRef m_contactListener
 
agx::String m_propertyName
 
agx::Real m_tensionThreshold
 

Additional Inherited Members

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

Detailed Description

(Optional) Link algorithm that tries to stabilize the link when the link is in contact with an object.

Execute filter for the LinkObjectStabilizingAlgorithm which trying to match a 'property-bool' in the other rigid body which the link interacts with.

Execute filter for the LinkObjectStabilizingAlgorithm which trying to match a 'property-bool' in the other geometry which the link interacts with.

Base filter for selecting objects to the LinkObjectStabilizingAlgorithm.

If there's high enough tension in the wire, this algorithm will create extra constraints between the link and the contacting object.

It's not recommended to have this enabled for all objects so an execute filter has to be given to define which objects this feature is enabled for.

For user implemented filters there's three things you have to do:

  1. Implement the matchOther( const agxCollide::Geometry* ) which should return true if this filter gave a match to that geometry, otherwise false.
  2. Implement store for serialization.
  3. Implement restore for de-serialization.

Example: link->add( new LinkObjectStabilizingAlgorithm( new LinkObjectStabilizingAlgorithm::GeometryPropertyBoolFilter( "LinkStabilize", link ) ) );

We want the link to be 'extra' stable while in contact with this geometry: geometry->getPropertyContainer()->addPropertyBool( "LinkStabilize", true );

Example: link->add( new LinkObjectStabilizingAlgorithm( new LinkObjectStabilizingAlgorithm::RigidBodyPropertyBoolFilter( "LinkStabilize", link ) ) );

We want the link to be 'extra' stable while in contact with this body: rb->getPropertyContainer()->addPropertyBool( "LinkStabilize", true );

Definition at line 36 of file LinkAlgorithms.h.

Member Typedef Documentation

◆ ConstraintContainer

◆ GeometryPropertyBoolFilterRef

◆ RigidBodyPropertyBoolFilterRef

Constructor & Destructor Documentation

◆ LinkObjectStabilizingAlgorithm() [1/2]

agxWire::LinkObjectStabilizingAlgorithm::LinkObjectStabilizingAlgorithm ( agxWire::LinkObjectStabilizingAlgorithm::LinkExecuteFilter *  filter,
agx::Real  tensionThreshold = agx::Real(1E4) 
)

Construct given filter to filter out which objects should have this feature.

Parameters
filter- user implemented or pre-defined execute filter
tensionThreshold- tension threshold defining the moment the stabilizing constraints should be applied (default: 1.0E4)

◆ LinkObjectStabilizingAlgorithm() [2/2]

agxWire::LinkObjectStabilizingAlgorithm::LinkObjectStabilizingAlgorithm ( )
protected

Protected default constructor, used during restore.

◆ ~LinkObjectStabilizingAlgorithm()

virtual agxWire::LinkObjectStabilizingAlgorithm::~LinkObjectStabilizingAlgorithm ( )
protectedvirtual

Reference counted object, protected destructor.

◆ ~GeometryPropertyBoolFilter()

virtual agxWire::LinkObjectStabilizingAlgorithm::~GeometryPropertyBoolFilter ( )
protectedvirtual

Reference counted object, protected destructor.

◆ ~RigidBodyPropertyBoolFilter()

virtual agxWire::LinkObjectStabilizingAlgorithm::~RigidBodyPropertyBoolFilter ( )
protectedvirtual

Reference counted object, protected destructor.

Member Function Documentation

◆ GeometryPropertyBoolFilter() [1/2]

agxWire::LinkObjectStabilizingAlgorithm::GeometryPropertyBoolFilter ( )
protected

Protected default constructor, used during restore.

◆ GeometryPropertyBoolFilter() [2/2]

agxWire::LinkObjectStabilizingAlgorithm::GeometryPropertyBoolFilter ( const agx::String &  propertyName,
const agxWire::Link *  link 
)
inline

Construct matching filter given property-bool name and the link.

Parameters
propertyName- property-bool for geometry for positive match (geometry->getPropertyContainer()->addPropertyBool( propertyName, true ))
link- link this filter belongs to, in order to filter out which of the two geometries in a geometry contact is a link geometry

Definition at line 197 of file LinkAlgorithms.h.

◆ getLink()

const agxWire::Link * agxWire::LinkObjectStabilizingAlgorithm::getLink ( ) const
inline
Returns
the link this execute filter is defined for

Definition at line 129 of file LinkAlgorithms.h.

◆ getTensionThreshold()

agx::Real agxWire::LinkObjectStabilizingAlgorithm::getTensionThreshold ( ) const
Returns
the current tension threshold

◆ LinkExecuteFilter()

agxWire::LinkObjectStabilizingAlgorithm::LinkExecuteFilter ( const agxWire::Link *  link)
inline

Construct given link this algorithm belongs to.

It needs the link because it's the only way to know if this filter has been invalidated.

Parameters
link- link this execute filter is defined for

Definition at line 123 of file LinkAlgorithms.h.

◆ match()

virtual bool agxWire::LinkObjectStabilizingAlgorithm::match ( const agxCollide::Geometry *  geometry1,
const agxCollide::Geometry *  geometry2 
) const
inlineoverrideprotectedvirtual

Base match method which determines which geometry belongs to the link and who's not.

Definition at line 161 of file LinkAlgorithms.h.

◆ matchOther() [1/3]

virtual bool agxWire::LinkObjectStabilizingAlgorithm::matchOther ( const agxCollide::Geometry *  otherGeometry) const
protectedpure virtual

Called when this base filter has determined which geometry that's not part of the link - the otherGeometry.

Parameters
otherGeometry- the geometry the link is currently overlapping
Returns
true if it's a match, otherwise false

◆ matchOther() [2/3]

virtual bool agxWire::LinkObjectStabilizingAlgorithm::matchOther ( const agxCollide::Geometry *  otherGeometry) const
inlineoverrideprotectedvirtual

Match function.

Returns
true if match, otherwise false

Definition at line 221 of file LinkAlgorithms.h.

◆ matchOther() [3/3]

virtual bool agxWire::LinkObjectStabilizingAlgorithm::matchOther ( const agxCollide::Geometry *  otherGeometry) const
inlineoverrideprotectedvirtual

Match function.

Returns
true if match, otherwise false

Definition at line 286 of file LinkAlgorithms.h.

◆ matchT()

template<typename T >
agx::Bool agxWire::LinkObjectStabilizingAlgorithm::matchT ( const T *  obj) const
inlineprotected

Match function for either agxCollide::Geometry or agx::RigidBody.

Returns
true if match, otherwise false

Definition at line 231 of file LinkAlgorithms.h.

◆ onLinkEnable()

virtual void agxWire::LinkObjectStabilizingAlgorithm::onLinkEnable ( agx::Bool  enable,
agxWire::Link *  link,
agxSDK::SimulationProxy *  simulationProxy 
)
overrideprotectedvirtual

Adding contact listener if link switched from disabled do enabled, otherwise removing the contact listener.

◆ post()

virtual void agxWire::LinkObjectStabilizingAlgorithm::post ( agxWire::Link *  link,
agxSDK::SimulationProxy *  simulationProxy 
)
overrideprotectedvirtual

Removing the stabilizing constraints.

◆ pre()

virtual void agxWire::LinkObjectStabilizingAlgorithm::pre ( agxWire::Link *  link,
agxSDK::SimulationProxy *  simulationProxy 
)
overrideprotectedvirtual

Checks stability and adding stabilizing constraints if needed.

◆ RigidBodyPropertyBoolFilter() [1/2]

agxWire::LinkObjectStabilizingAlgorithm::RigidBodyPropertyBoolFilter ( )
protected

Protected default constructor, used during restore.

◆ RigidBodyPropertyBoolFilter() [2/2]

agxWire::LinkObjectStabilizingAlgorithm::RigidBodyPropertyBoolFilter ( const agx::String &  propertyName,
const agxWire::Link *  link 
)
inline

Construct matching filter given property-bool name and the link.

Parameters
propertyName- property-bool for rigid body for positive match (rb->getPropertyContainer()->addPropertyBool( propertyName, true ))
link- link this filter belongs to, in order to filter out which of the two geometries in a geometry contact is a link geometry

Definition at line 262 of file LinkAlgorithms.h.

◆ setTensionThreshold()

void agxWire::LinkObjectStabilizingAlgorithm::setTensionThreshold ( agx::Real  tensionThreshold)

Assign new tension threshold defining the moment the stabilizing constraints should be applied.

Parameters
tensionThreshold- new tension threshold (default: 1.0E4)

Member Data Documentation

◆ m_constraints

ConstraintContainer agxWire::LinkObjectStabilizingAlgorithm::m_constraints
protected

Definition at line 103 of file LinkAlgorithms.h.

◆ m_contactListener

agxSDK::ContactEventListenerRef agxWire::LinkObjectStabilizingAlgorithm::m_contactListener
protected

Definition at line 102 of file LinkAlgorithms.h.

◆ m_propertyName

agx::String agxWire::LinkObjectStabilizingAlgorithm::m_propertyName
protected

Definition at line 241 of file LinkAlgorithms.h.

◆ m_tensionThreshold

agx::Real agxWire::LinkObjectStabilizingAlgorithm::m_tensionThreshold
protected

Definition at line 104 of file LinkAlgorithms.h.


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