AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
agxSDK::LinkedStructure Class Reference

Basic implementation of any structure where bodies are linked/constrained together in a well defined consecutive order. More...

#include <LinkedStructure.h>

+ Inheritance diagram for agxSDK::LinkedStructure:

Classes

struct  IdData
 Group id 'union' of int id and name id. More...
 

Public Member Functions

virtual agx::Bool addComponent (agxSDK::LinkedStructureComponent *component)
 Add new component to this linked structure.
 
virtual void addGroup (agx::UInt32 id)
 Add group id to all segments in this linked structure.
 
virtual void addGroup (const agx::Name &name)
 Add group name to all segments in this linked structure.
 
virtual void addNotification (agxSDK::Simulation *)
 Called when this assembly is added to a simulation (given that it not already is in the simulation).
 
void addNotification (agxSDK::Simulation *simulation) final override
 Called when this linked structure is added to the simulation.
 
virtual void addNotification (Assembly *)
 Called when this assembly is added to another assembly.
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxSDK::LinkedStructure)
 
virtual agx::Real findCurrentLength (agx::Real restLengthFromStart) const
 Calculates the current length of a given rest length.
 
virtual agxCollide::GroupIdCollection findGroupIdCollection () const
 
virtual agx::Vec3 findPoint (agx::Real restLengthFromStart) const
 Finds center point on this structure given rest length from the start.
 
virtual agx::Vec3 findPoint (const agx::Vec3 &worldPoint) const
 Given any world point, find a center point on this structure that is closest to the given worldPoint.
 
virtual agx::Real findRestLength (agx::Real currentLengthFromStart) const
 Calculates the rest length of a given current length from start.
 
virtual agx::Real findRestLengthTo (const agx::Vec3 &worldPoint) const
 Given any world point, find a center point on this structure that is closest to the given worldPoint and return the rest length from start.
 
virtual agx::Real findRestLengthTo (const agxSDK::LinkedSegment *segment) const
 Finds rest length to the start of the given segment.
 
virtual agx::Vec3 getAngularVelocityDamping () const
 
template<typename T >
T * getComponent () const
 
agxSDK::LinkedStructureComponentgetComponent (const agx::Name &name) const
 
virtual agx::Real getCurrentLength () const
 Calculates and returns the total length of this linked structure, at current state.
 
virtual agx::UInt32 getDisabledCollisionGroupId () const
 
virtual agx::Bool getEnableCollisions (const agx::RigidBody *rb) const
 
virtual agx::Bool getEnableCollisions (const agxCollide::Geometry *geometry) const
 
virtual agx::Vec3 getLinearVelocityDamping () const
 
virtual agx::Real getMass () const
 Calculates and returns the total mass of this linked structure.
 
virtual agx::MaterialgetMaterial () const
 
virtual agx::Real getRestLength () const
 Calculates and returns the total length of this linked structure, at rest.
 
virtual agx::Real getRestVolume () const
 Calculates and returns the total volume of this linked structure, at rest.
 
template<>
LinkedSegmentgetSegment (const agx::RigidBody *rb) const
 
agx::UInt getSegmentIndex (const agx::RigidBody *rb) const
 
const agxSDK::LinkedSegmentContainergetSegmentsContainer () const
 
virtual agx::UInt32 getUniqueId () const
 
virtual agx::Bool hasGroup (agx::UInt32 id) const
 
virtual agx::Bool hasGroup (const agx::Name &name) const
 
virtual agx::Bool rebind ()
 Make the current relative positions of all nodes the rest state.
 
virtual agx::Bool removeComponent (agxSDK::LinkedStructureComponent *component)
 Remove an added component from this linked structure.
 
virtual void removeGroup (agx::UInt32 id)
 Remove group id from all segments in this linked structure.
 
virtual void removeGroup (const agx::Name &name)
 Remove group name from all segments in this linked structure.
 
virtual void removeNotification (agxSDK::Simulation *)
 Called when this assembly is removed from a simulation.
 
void removeNotification (agxSDK::Simulation *simulation) final override
 Called when this linked structure is added to the simulation.
 
virtual void removeNotification (Assembly *)
 Called when this assembly is removed from another assembly.
 
agxSDK::LinkedSegmentRange< agxSDK::LinkedSegmentsegments ()
 
virtual void setAngularVelocityDamping (const agx::Vec3 &angularVelocityDamping)
 Assigns angular velocity damping to all segments in this linked structure.
 
virtual void setEnableCollisions (agx::RigidBody *rb, agx::Bool enable)
 Enable/disable collisions between the rigid body and all segments of this linked structure.
 
virtual void setEnableCollisions (agxCollide::Geometry *geometry, agx::Bool enable)
 Enable/disable collisions between the geometry and all segments of this linked structure.
 
virtual void setLinearVelocityDamping (const agx::Vec3 &linearVelocityDamping)
 Assigns linear velocity damping to all segments in this linked structure.
 
virtual void setMaterial (agx::Material *material)
 Assign material to all segments in this linked structure.
 
- Public Member Functions inherited from agxSDK::Assembly
 Assembly ()
 Default constructor.
 
bool add (agx::Constraint *constraint)
 Add a constraint to the assembly.
 
bool add (agx::ContactMaterial *contactMaterial)
 Add a contact material to this assembly.
 
bool add (agx::Emitter *emitter)
 Add an emitter to this assembly.
 
bool add (agx::Interaction *interaction)
 Add an interaction to this assembly.
 
bool add (agx::MergedBody *mergedBody)
 Add a MergedBody to this assembly.
 
bool add (agx::ObserverFrame *observerFrame)
 Add an ObserverFrame to this assembly.
 
bool add (agx::RigidBody *body)
 Add a rigid body to the assembly.
 
bool add (agxCollide::Geometry *geometry)
 Add a geometry to the assembly.
 
bool add (agxSDK::EventListener *listener)
 Add a listener to the assembly.
 
bool add (agxSDK::TerrainInstance *terrainInstance)
 Add a TerrainInstance to this assembly.
 
bool add (agxSDK::TerrainToolInstance *toolInstance)
 Add a TerrainToolInstance to this assembly.
 
bool add (agxStream::Serializable *object)
 Add an object of type serialized.
 
bool add (Assembly *assembly)
 Add another assembly as child to this assembly.
 
virtual void addNotification (agxSDK::Simulation *)
 Called when this assembly is added to a simulation (given that it not already is in the simulation).
 
virtual void addNotification (Assembly *)
 Called when this assembly is added to another assembly.
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxSDK::Assembly)
 
size_t collect (agx::ConstraintRefVector &result, bool recursive=true)
 
size_t collect (agx::EmitterRefVector &result, bool recursive=true)
 
size_t collect (agx::InteractionRefVector &result, bool recursive=true)
 
size_t collect (agx::MergedBodyRefVector &result, bool recursive=true)
 
size_t collect (agx::ObserverFrameRefVector &result, bool recursive=true)
 
size_t collect (agx::ParticleSystemRefVector &result, bool recursive=true)
 
size_t collect (agx::RigidBodyRefVector &result, bool recursive=true)
 
size_t collect (agxCollide::GeometryRefVector &result, bool recursive=true)
 
size_t collect (agxSDK::AssemblyRefVector &result, bool recursive=true)
 
size_t collect (agxSDK::EventListenerRefVector &result, bool recursive=true)
 
size_t collect (agxSDK::TerrainInstanceRefVector &result, bool recursive=true)
 
size_t collect (agxSDK::TerrainToolInstanceRefVector &result, bool recursive=true)
 
bool empty () const
 
const AssemblyRefSetVectorgetAssemblies () const
 
agxSDK::AssemblygetAssembly (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named Assembly.
 
const agxSDK::AssemblygetAssembly (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named Assembly.
 
agxSDK::AssemblygetAssembly (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an Assembly matching the given uuid.
 
const agxSDK::AssemblygetAssembly (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an Assembly matching the given uuid.
 
agx::ConstraintgetConstraint (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named Constraint.
 
template<typename T >
T * getConstraint (const agx::Name &name, bool recursive=true)
 Find and return named Constraint of a template type, for example Hinge:
 
const agx::ConstraintgetConstraint (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named Constraint.
 
template<typename T >
const T * getConstraint (const agx::Name &name, bool recursive=true) const
 Find and return named Constraint of a template type, for example Hinge:
 
agx::ConstraintgetConstraint (const agx::Uuid &uuid, bool recursive=true)
 Find and return a pointer to a Constraint with the given uuid.
 
const agx::ConstraintgetConstraint (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return a pointer to a Constraint with the given uuid.
 
agx::Constraint1DOFgetConstraint1DOF (const agx::Name &name, bool recursive=true)
 
agx::Constraint2DOFgetConstraint2DOF (const agx::Name &name, bool recursive=true)
 
const agx::ConstraintRefSetVectorgetConstraints () const
 
const agx::EmitterRefSetVectorgetEmitters () const
 
const EventListenerRefSetVectorgetEventListeners () const
 
virtual agx::FramegetFrame ()
 Return a reference to the frame containing transformation and velocity information for this assembly.
 
virtual const agx::FramegetFrame () const
 
const agxCollide::GeometryRefSetVectorgetGeometries () const
 
agxCollide::GeometrygetGeometry (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named collision Geometry.
 
const agxCollide::GeometrygetGeometry (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named collision Geometry.
 
agxCollide::GeometrygetGeometry (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return a Geometry matching the given uuid.
 
const agxCollide::GeometrygetGeometry (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return a Geometry matching the given uuid.
 
const agx::InteractionRefSetVectorgetInteractions () const
 
agx::Vec3 getLocalPosition () const
 
agx::Quat getLocalRotation () const
 
const agx::AffineMatrix4x4getLocalTransform () const
 
const agx::MergedBodyRefSetVectorgetMergedBodies () const
 
agx::MergedBodygetMergedBody (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an MergedBody matching the given uuid.
 
const agx::MergedBodygetMergedBody (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an MergedBody matching the given uuid.
 
agx::Name getName () const
 
agx::ObserverFramegetObserverFrame (const agx::Name &name, bool recursive=true)
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFramegetObserverFrame (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
agx::ObserverFramegetObserverFrame (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFramegetObserverFrame (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFrameRefSetVectorgetObserverFrames () const
 
AssemblygetParent ()
 
const AssemblygetParent () const
 
agx::FramegetParentFrame ()
 
const agx::FramegetParentFrame () const
 
const agx::ParticleSystemRefSetVectorgetParticleSystems () const
 
const agx::RigidBodyRefSetVectorgetRigidBodies () const
 
agx::RigidBodygetRigidBody (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named RigidBody.
 
const agx::RigidBodygetRigidBody (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named RigidBody.
 
agx::RigidBodygetRigidBody (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return a pointer to a RigidBody with the given uuid.
 
const agx::RigidBodygetRigidBody (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return a pointer to a RigidBody with the given uuid.
 
agxSDK::SimulationgetSimulation ()
 
const agxSDK::SimulationgetSimulation () const
 
agxSDK::TerrainInstancegetTerrainInstance (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an TerrainInstance matching the given uuid.
 
const agxSDK::TerrainInstancegetTerrainInstance (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an TerrainInstance matching the given uuid.
 
const agxSDK::TerrainInstanceRefSetVectorgetTerrainInstances () const
 
agxSDK::TerrainToolInstancegetTerrainToolInstance (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an TerrainToolInstance matching the given uuid.
 
const agxSDK::TerrainToolInstancegetTerrainToolInstance (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an TerrainToolInstance matching the given uuid.
 
const agxSDK::TerrainToolInstanceRefSetVectorgetTerrainToolInstances () const
 
Type getType () const
 
bool remove (agx::Constraint *constraint)
 Remove a constraint from this assembly (does not recurse down in tree).
 
bool remove (agx::ContactMaterial *contactMaterial)
 Remove a contact material from this assembly.
 
bool remove (agx::Emitter *emitter)
 Remove an emitter from this assembly.
 
bool remove (agx::Interaction *interaction)
 Remove an interaction from this assembly.
 
bool remove (agx::MergedBody *mergedBody)
 Remove a MergedBody from this assembly.
 
bool remove (agx::ObserverFrame *observerFrame, bool resetParentFrame=true)
 Remove an ObserverFrame from this assembly.
 
bool remove (agx::RigidBody *body, bool removeAssociatedGeometries=false, bool resetParentFrame=true)
 Remove a rigid body from this assembly (does not recurse down in tree).
 
bool remove (agxCollide::Geometry *geometry, bool resetParentFrame=true)
 Remove a geometry from this assembly (does not recurse down in tree).
 
bool remove (agxSDK::TerrainInstance *terrainInstance)
 Remove a TerrainInstance from this assembly.
 
bool remove (agxSDK::TerrainToolInstance *toolInstance)
 Remove a TerrainToolInstance from this assembly.
 
bool remove (Assembly *assembly, bool resetParentFrame=true)
 Remove a child assembly from a parent.
 
bool remove (EventListener *listener)
 Remove an EventListener from the assembly.
 
virtual void removeNotification (agxSDK::Simulation *)
 Called when this assembly is removed from a simulation.
 
virtual void removeNotification (Assembly *)
 Called when this assembly is removed from another assembly.
 
bool reset (bool resetParentFrame=true)
 If this assembly is not added to a simulation it will clear all added bodies etc.
 
virtual void setAngularVelocity (const agx::Vec3 &velocity)
 Set the angular velocity (in world frame) recursively for all rigid bodies stored in assembly.
 
void setLocalPosition (agx::Real x, agx::Real y, agx::Real z)
 Set the position of the assembly relative to its frame's parent frame.
 
void setLocalPosition (const agx::Vec3 &p)
 Set the position of the assembly relative to its frame's parent frame.
 
void setLocalRotation (const agx::EulerAngles &e)
 Set the rotation of the assembly relative to its frame's parent frame.
 
void setLocalRotation (const agx::Quat &q)
 Set the rotation of the assembly relative to its frame's parent frame.
 
void setLocalTransform (const agx::AffineMatrix4x4 &matrix)
 Assign the local transformation matrix for this assembly, ignoring any eventual parent transformation.
 
void setName (const agx::Name &name)
 Set the name of this Assembly.
 
bool setParentFrame (agx::Frame *frame)
 Set the parent frame of this assembly's frame.
 
void setPosition (agx::Real x, agx::Real y, agx::Real z)
 Set the position of the frame in world coordinates.
 
void setPosition (const agx::Vec3 &p)
 Set the position of the frame in world coordinates.
 
void setRotation (const agx::EulerAngles &e)
 Set the rotation of the assembly relative to world frame.
 
void setRotation (const agx::OrthoMatrix3x3 &m)
 Set the rotation of the assembly relative to world frame.
 
void setRotation (const agx::Quat &q)
 Set the rotation of the assembly relative to world frame.
 
void setTransform (const agx::AffineMatrix4x4 &matrix)
 Set the transform of the assembly.
 
virtual void setVelocity (const agx::Vec3 &velocity)
 Set the linear velocity (in world frame) recursively for all rigid bodies stored in assembly.
 
bool transfer (agxSDK::Assembly *target)
 Transfer all the content from this assembly to the target, including name and transformation.
 
virtual void traverse (AssemblyVisitor *visitor)
 Traverse the assembly tree recursively using a visitor.
 
virtual void traverse (const AssemblyVisitor *visitor) const
 
- 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.
 
- 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.
 

Static Public Member Functions

static agxStream::Serializablecreate (agxStream::InputArchive &)
 
static LinkedStructureget (agx::RigidBody *body)
 
static LinkedStructureget (agxCollide::Geometry *geometry)
 
static const LinkedStructureget (const agx::RigidBody *body)
 
static const LinkedStructureget (const agxCollide::Geometry *geometry)
 
- Static Public Member Functions inherited from agxSDK::Assembly
static AssemblyasAssembly (agxStream::Serializable *obj)
 
static agxStream::Serializablecreate (agxStream::InputArchive &)
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- 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.
 

Protected Member Functions

 LinkedStructure ()
 Hidden default constructor.
 
virtual ~LinkedStructure ()
 Reference counted object - protected destructor.
 
void add (LinkedSegment *segment)
 Add segment to this linked structure.
 
std::tuple< agx::Vec3, LinkedSegment * > findPointAndSegment (const agx::Vec3 &worldPoint) const
 
template<typename T >
T * findSegment (const agx::Vec3 &worldPoint) const
 
LinkedStructureObjectDatagetData (const agx::RigidBody *rb) const
 
agx::UInt getNumSegments () const
 
template<typename T >
T * getSegment (agx::Real restLengthFromStart) const
 
LinkedSegmentgetSegment (agx::UInt index) const
 
template<typename ObjT >
LinkedSegmentgetSegment (const ObjT *rb) const
 
template<typename T >
LinkedSegmentIterator< T > getSegmentIterator (agx::UInt index, agx::Bool boundaryless=false) const
 
template<typename T , typename ObjT >
LinkedSegmentIterator< T > getSegmentIterator (const ObjT *rb, agx::Bool boundaryless=false) const
 
template<typename T >
LinkedSegmentRange< T > getSegments () const
 Constructs a segment range over all segments.
 
template<typename T >
LinkedSegmentRange< T > getSegments (agx::UInt beginIndex, agx::UInt endIndex) const
 Range given begin and end segment index.
 
virtual void onAddNotification (agxSDK::Simulation *simulation)
 Called when addNotification is executed when this linked structure is added to the simulation.
 
virtual void onGroupAdd (const IdData &group)
 Called when a new group has been added.
 
virtual void onGroupRemove (const IdData &group)
 Called when an existing group has been removed.
 
virtual void onLastStep ()
 Called on simulation last step event - after user lastStep.
 
virtual void onMaterialNew ()
 Called when a new material has been assigned.
 
virtual void onPostIntegrate ()
 Called on simulation post integrate event - when transforms has been updated given current velocities.
 
virtual void onPostStep ()
 Called on simulation post step event - after user postStep.
 
virtual void onPreCollideStep ()
 Called on simulation pre-collide step event - after user preCollide.
 
virtual void onPreStep ()
 Called on simulation pre step event - after user preStep.
 
virtual void onRemoveNotification (agxSDK::Simulation *simulation)
 Called when removeNotification is executed when this linked structure is removed from the simulation.
 
virtual void onSetEnableCollisions (agxCollide::Geometry *geometry, agx::Bool enable)
 Called when collision state changed for given geometry.
 
- Protected Member Functions inherited from agxSDK::Assembly
 Assembly (Type type)
 
virtual ~Assembly ()
 Destructor.
 
bool addParticleSystem (agx::ParticleSystem *particleSystem)
 Add a particle system to this assembly.
 
void addToSimulation (Simulation *simulation)
 
void removeFromSimulation (Simulation *simulation)
 
bool removeParticleSystem (agx::ParticleSystem *particleSystem)
 Remove a particle system from this assembly.
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Static Protected Member Functions

template<typename T >
static T * getT (agx::RigidBody *rb)
 
template<typename T >
static const T * getT (const agx::RigidBody *rb)
 
- 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.
 

Additional Inherited Members

- Public Types inherited from agxSDK::Assembly
enum  Type { ASSEMBLY , COLLECTION }
 Specifies the type an assembly is. More...
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Basic implementation of any structure where bodies are linked/constrained together in a well defined consecutive order.

E.g., cables, beams, tracks etc.

Definition at line 40 of file LinkedStructure.h.

Constructor & Destructor Documentation

◆ LinkedStructure()

agxSDK::LinkedStructure::LinkedStructure ( )
protected

Hidden default constructor.

◆ ~LinkedStructure()

virtual agxSDK::LinkedStructure::~LinkedStructure ( )
protectedvirtual

Reference counted object - protected destructor.

Member Function Documentation

◆ add()

void agxSDK::LinkedStructure::add ( LinkedSegment segment)
protected

Add segment to this linked structure.

The segment will inherit our material, unique id and all externally added groups.

Note
Assumed segment to be a valid pointer and not already added.
Parameters
segmentsegment to add

◆ addComponent()

virtual agx::Bool agxSDK::LinkedStructure::addComponent ( agxSDK::LinkedStructureComponent component)
virtual

Add new component to this linked structure.

Note
This component must be unique to this object, i.e., it cannot be added to several instances of LinkedStructure.
Parameters
component- component to add
Returns
true if the component is added, false if null or already added to this or some other linked structure

◆ addGroup() [1/2]

virtual void agxSDK::LinkedStructure::addGroup ( agx::UInt32  id)
virtual

Add group id to all segments in this linked structure.

Parameters
id- id to add

◆ addGroup() [2/2]

virtual void agxSDK::LinkedStructure::addGroup ( const agx::Name name)
virtual

Add group name to all segments in this linked structure.

Parameters
name- name to add

◆ addNotification() [1/3]

virtual void agxSDK::Assembly::addNotification ( agxSDK::Simulation )
inlinevirtual

Called when this assembly is added to a simulation (given that it not already is in the simulation).

Reimplemented from agxSDK::Assembly.

Definition at line 773 of file Assembly.h.

◆ addNotification() [2/3]

void agxSDK::LinkedStructure::addNotification ( agxSDK::Simulation simulation)
finaloverridevirtual

Called when this linked structure is added to the simulation.

This callback is reserved for LinkedStructure but onAddNotification will be called in a similar way.

Reimplemented from agxSDK::Assembly.

◆ addNotification() [3/3]

virtual void agxSDK::Assembly::addNotification ( Assembly )
inlinevirtual

Called when this assembly is added to another assembly.

Reimplemented from agxSDK::Assembly.

Definition at line 783 of file Assembly.h.

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE()

agxSDK::LinkedStructure::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( agxSDK::LinkedStructure  )

◆ create()

static agxStream::Serializable * agxSDK::LinkedStructure::create ( agxStream::InputArchive )
inlinestatic

Definition at line 299 of file LinkedStructure.h.

◆ findCurrentLength()

virtual agx::Real agxSDK::LinkedStructure::findCurrentLength ( agx::Real  restLengthFromStart) const
virtual

Calculates the current length of a given rest length.

E.g., if this structure is stretched, the current length will be larger than the rest length and corresponds to the actual distance from the start. restLengthFromStart - rest length to convert to current length

Returns
the corresponding current length

◆ findGroupIdCollection()

virtual agxCollide::GroupIdCollection agxSDK::LinkedStructure::findGroupIdCollection ( ) const
virtual
Returns
collection of group names and id's that has been added to this linked structure

◆ findPoint() [1/2]

virtual agx::Vec3 agxSDK::LinkedStructure::findPoint ( agx::Real  restLengthFromStart) const
virtual

Finds center point on this structure given rest length from the start.

If this structure isn't initialized, agx::Vec3(0, 0, 0) is returned.

Parameters
restLengthFromStart- rest length from the start
Returns
center point on this structure, restLengthFromStart

◆ findPoint() [2/2]

virtual agx::Vec3 agxSDK::LinkedStructure::findPoint ( const agx::Vec3 worldPoint) const
virtual

Given any world point, find a center point on this structure that is closest to the given worldPoint.

Parameters
worldPoint- any point in world
Returns
closest center point on this structure to worldPoint

◆ findPointAndSegment()

std::tuple< agx::Vec3, LinkedSegment * > agxSDK::LinkedStructure::findPointAndSegment ( const agx::Vec3 worldPoint) const
protected
Returns
the position and the segment whose begin position is closest to the given world point

◆ findRestLength()

virtual agx::Real agxSDK::LinkedStructure::findRestLength ( agx::Real  currentLengthFromStart) const
virtual

Calculates the rest length of a given current length from start.

Parameters
currentLengthFromStart- current length to convert to rest length
Returns
the corresponding rest length

◆ findRestLengthTo() [1/2]

virtual agx::Real agxSDK::LinkedStructure::findRestLengthTo ( const agx::Vec3 worldPoint) const
virtual

Given any world point, find a center point on this structure that is closest to the given worldPoint and return the rest length from start.

Parameters
worldPoint- any point in world
Returns
rest length from the start

◆ findRestLengthTo() [2/2]

virtual agx::Real agxSDK::LinkedStructure::findRestLengthTo ( const agxSDK::LinkedSegment segment) const
virtual

Finds rest length to the start of the given segment.

Parameters
segment- segment in this structure
Returns
rest length to the start of the given segment, total rest length if not part of this structure

◆ findSegment()

template<typename T >
T * agxSDK::LinkedStructure::findSegment ( const agx::Vec3 worldPoint) const
protected
Returns
find the segment that is closest to the given worldPoint, nullptr if no segments has been added

Definition at line 636 of file LinkedStructure.h.

◆ get() [1/4]

static LinkedStructure * agxSDK::LinkedStructure::get ( agx::RigidBody body)
static
Returns
The LinkedStructure the given body is part of, or nullptr if there is no such LinkedStructure.

◆ get() [2/4]

static LinkedStructure * agxSDK::LinkedStructure::get ( agxCollide::Geometry geometry)
static
Returns
The LinkedStructure the given geometry is part of, or nullptr if there is no such LinkedStructure.

◆ get() [3/4]

static const LinkedStructure * agxSDK::LinkedStructure::get ( const agx::RigidBody body)
static
Returns
The LinkedStructure the given body is part of, or nullptr if there is no such LinkedStructure.

◆ get() [4/4]

static const LinkedStructure * agxSDK::LinkedStructure::get ( const agxCollide::Geometry geometry)
static
Returns
The LinkedStructure the given geometry is part of, or nullptr if there is no such LinkedStructure.

◆ getAngularVelocityDamping()

virtual agx::Vec3 agxSDK::LinkedStructure::getAngularVelocityDamping ( ) const
virtual
Returns
the given angular velocity damping previously assigned to this linked structure (default: (0, 0, 0))

◆ getComponent() [1/2]

template<typename T >
T * agxSDK::LinkedStructure::getComponent
Returns
first component of given type

Definition at line 574 of file LinkedStructure.h.

◆ getComponent() [2/2]

agxSDK::LinkedStructureComponent * agxSDK::LinkedStructure::getComponent ( const agx::Name name) const
Returns
first component of given name

◆ getCurrentLength()

virtual agx::Real agxSDK::LinkedStructure::getCurrentLength ( ) const
virtual

Calculates and returns the total length of this linked structure, at current state.

Returns
current length of this linked structure

Reimplemented in agxCable::Cable.

◆ getData()

LinkedStructureObjectData * agxSDK::LinkedStructure::getData ( const agx::RigidBody rb) const
inlineprotected
Returns
internal data for rigid body if it exists and is the body is mapped to this linked structure

Definition at line 674 of file LinkedStructure.h.

◆ getDisabledCollisionGroupId()

virtual agx::UInt32 agxSDK::LinkedStructure::getDisabledCollisionGroupId ( ) const
virtual
Returns
the collision id of this linked structure

◆ getEnableCollisions() [1/2]

virtual agx::Bool agxSDK::LinkedStructure::getEnableCollisions ( const agx::RigidBody rb) const
virtual
Returns
true if collisions are enabled - otherwise false

◆ getEnableCollisions() [2/2]

virtual agx::Bool agxSDK::LinkedStructure::getEnableCollisions ( const agxCollide::Geometry geometry) const
virtual
Returns
true if collisions are enabled - otherwise false

◆ getLinearVelocityDamping()

virtual agx::Vec3 agxSDK::LinkedStructure::getLinearVelocityDamping ( ) const
virtual
Returns
the given linear velocity damping previously assigned to this linked structure (default: (0, 0, 0))

◆ getMass()

virtual agx::Real agxSDK::LinkedStructure::getMass ( ) const
virtual

Calculates and returns the total mass of this linked structure.

I.e., the total sum of all segments masses.

Returns
total mass of this linked structure

◆ getMaterial()

virtual agx::Material * agxSDK::LinkedStructure::getMaterial ( ) const
virtual
Returns
the material used for by the segments in this linked structure

◆ getNumSegments()

agx::UInt agxSDK::LinkedStructure::getNumSegments ( ) const
inlineprotected
Returns
the number of segments in this linked structure

Definition at line 590 of file LinkedStructure.h.

References agx::Container::size().

Referenced by agxVehicle::Track::getNumNodes().

◆ getRestLength()

virtual agx::Real agxSDK::LinkedStructure::getRestLength ( ) const
virtual

Calculates and returns the total length of this linked structure, at rest.

Returns
rest length of this linked structure

Reimplemented in agxCable::Cable, and agxModel::Beam.

◆ getRestVolume()

virtual agx::Real agxSDK::LinkedStructure::getRestVolume ( ) const
virtual

Calculates and returns the total volume of this linked structure, at rest.

Returns
total volume of this linked structure

◆ getSegment() [1/4]

template<typename T >
T * agxSDK::LinkedStructure::getSegment ( agx::Real  restLengthFromStart) const
protected
Returns
segment given rest length from start, nullptr if no segments has been added

Definition at line 616 of file LinkedStructure.h.

◆ getSegment() [2/4]

LinkedSegment * agxSDK::LinkedStructure::getSegment ( agx::UInt  index) const
inlineprotected
Returns
segment given index

Definition at line 609 of file LinkedStructure.h.

References agxAssert.

Referenced by agxVehicle::Track::getNode().

◆ getSegment() [3/4]

template<>
LinkedSegment * agxSDK::LinkedStructure::getSegment ( const agx::RigidBody rb) const
inline

Definition at line 643 of file LinkedStructure.h.

References agx::InvalidIndex.

◆ getSegment() [4/4]

template<typename ObjT >
LinkedSegment * agxSDK::LinkedStructure::getSegment ( const ObjT *  rb) const
protected
Returns
segment given rigid body

◆ getSegmentIndex()

agx::UInt agxSDK::LinkedStructure::getSegmentIndex ( const agx::RigidBody rb) const
inline
Returns
segment index if rigid body is a segment in this linked structure - otherwise agx::InvalidIndex

Definition at line 651 of file LinkedStructure.h.

References agx::InvalidIndex.

◆ getSegmentIterator() [1/2]

template<typename T >
LinkedSegmentIterator< T > agxSDK::LinkedStructure::getSegmentIterator ( agx::UInt  index,
agx::Bool  boundaryless = false 
) const
protected
Returns
segment iterator given index and iterator state

Definition at line 660 of file LinkedStructure.h.

◆ getSegmentIterator() [2/2]

template<typename T , typename ObjT >
LinkedSegmentIterator< T > agxSDK::LinkedStructure::getSegmentIterator ( const ObjT *  rb,
agx::Bool  boundaryless = false 
) const
protected
Returns
segment iterator given rigid body and iterator state

Definition at line 666 of file LinkedStructure.h.

◆ getSegments() [1/2]

template<typename T >
LinkedSegmentRange< T > agxSDK::LinkedStructure::getSegments
protected

Constructs a segment range over all segments.

Returns
segment range over all segments

Definition at line 596 of file LinkedStructure.h.

◆ getSegments() [2/2]

template<typename T >
LinkedSegmentRange< T > agxSDK::LinkedStructure::getSegments ( agx::UInt  beginIndex,
agx::UInt  endIndex 
) const
protected

Range given begin and end segment index.

If end index is before begin, begin will become boundaryless. E.g., size = 10, begin = 8, end = 3, the resulting range will be 8, 9, 0, 1, 2 (3 is end).

Returns
segment range given range

Definition at line 603 of file LinkedStructure.h.

◆ getSegmentsContainer()

const LinkedSegmentContainer & agxSDK::LinkedStructure::getSegmentsContainer ( ) const
inline
Returns
segments container

Definition at line 585 of file LinkedStructure.h.

Referenced by agxVehicle::Track::getIterator().

◆ getT() [1/2]

template<typename T >
T * agxSDK::LinkedStructure::getT ( agx::RigidBody rb)
staticprotected
Returns
this as T if rb is a segment in this linked structure - otherwise null

Definition at line 561 of file LinkedStructure.h.

◆ getT() [2/2]

template<typename T >
const T * agxSDK::LinkedStructure::getT ( const agx::RigidBody rb)
staticprotected
Returns
this as T if rb is a segment in this linked structure - otherwise null

Definition at line 568 of file LinkedStructure.h.

◆ getUniqueId()

virtual agx::UInt32 agxSDK::LinkedStructure::getUniqueId ( ) const
virtual
Returns
the unique id of this linked structure

◆ hasGroup() [1/2]

virtual agx::Bool agxSDK::LinkedStructure::hasGroup ( agx::UInt32  id) const
virtual
Returns
true if the id has been added to this linked structure - otherwise false

◆ hasGroup() [2/2]

virtual agx::Bool agxSDK::LinkedStructure::hasGroup ( const agx::Name name) const
virtual
Returns
true if the name has been added to this linked structure - otherwise false

◆ onAddNotification()

virtual void agxSDK::LinkedStructure::onAddNotification ( agxSDK::Simulation simulation)
protectedvirtual

Called when addNotification is executed when this linked structure is added to the simulation.

Reimplemented in agxCable::Cable, and agxVehicle::Track.

◆ onGroupAdd()

virtual void agxSDK::LinkedStructure::onGroupAdd ( const IdData group)
protectedvirtual

Called when a new group has been added.

Reimplemented in agxVehicle::Track.

◆ onGroupRemove()

virtual void agxSDK::LinkedStructure::onGroupRemove ( const IdData group)
protectedvirtual

Called when an existing group has been removed.

Reimplemented in agxVehicle::Track.

◆ onLastStep()

virtual void agxSDK::LinkedStructure::onLastStep ( )
protectedvirtual

Called on simulation last step event - after user lastStep.

Reimplemented in agxVehicle::Track.

◆ onMaterialNew()

virtual void agxSDK::LinkedStructure::onMaterialNew ( )
protectedvirtual

Called when a new material has been assigned.

Reimplemented in agxVehicle::Track.

◆ onPostIntegrate()

virtual void agxSDK::LinkedStructure::onPostIntegrate ( )
protectedvirtual

Called on simulation post integrate event - when transforms has been updated given current velocities.

This event may occur before onPostStep (default), or after onPreCollide.

Reimplemented in agxVehicle::Track.

◆ onPostStep()

virtual void agxSDK::LinkedStructure::onPostStep ( )
protectedvirtual

Called on simulation post step event - after user postStep.

Reimplemented in agxCable::Cable, and agxVehicle::Track.

◆ onPreCollideStep()

virtual void agxSDK::LinkedStructure::onPreCollideStep ( )
protectedvirtual

Called on simulation pre-collide step event - after user preCollide.

Reimplemented in agxVehicle::Track.

◆ onPreStep()

virtual void agxSDK::LinkedStructure::onPreStep ( )
protectedvirtual

Called on simulation pre step event - after user preStep.

Reimplemented in agxCable::Cable, and agxVehicle::Track.

◆ onRemoveNotification()

virtual void agxSDK::LinkedStructure::onRemoveNotification ( agxSDK::Simulation simulation)
protectedvirtual

Called when removeNotification is executed when this linked structure is removed from the simulation.

Reimplemented in agxVehicle::Track.

◆ onSetEnableCollisions()

virtual void agxSDK::LinkedStructure::onSetEnableCollisions ( agxCollide::Geometry geometry,
agx::Bool  enable 
)
protectedvirtual

Called when collision state changed for given geometry.

Reimplemented in agxVehicle::Track.

◆ rebind()

virtual agx::Bool agxSDK::LinkedStructure::rebind ( )
virtual

Make the current relative positions of all nodes the rest state.

That is, when this call returns no constraint in this linked structure will be violated.

Returns
true if successful - false if not initialized

◆ removeComponent()

virtual agx::Bool agxSDK::LinkedStructure::removeComponent ( agxSDK::LinkedStructureComponent component)
virtual

Remove an added component from this linked structure.

Parameters
component- component to remove
Returns
true if removed, otherwise false (null or not present in this linked structure)

◆ removeGroup() [1/2]

virtual void agxSDK::LinkedStructure::removeGroup ( agx::UInt32  id)
virtual

Remove group id from all segments in this linked structure.

Parameters
id- id to remove

◆ removeGroup() [2/2]

virtual void agxSDK::LinkedStructure::removeGroup ( const agx::Name name)
virtual

Remove group name from all segments in this linked structure.

Parameters
name- name to remove

◆ removeNotification() [1/3]

virtual void agxSDK::Assembly::removeNotification ( agxSDK::Simulation )
inlinevirtual

Called when this assembly is removed from a simulation.

Reimplemented from agxSDK::Assembly.

Definition at line 778 of file Assembly.h.

◆ removeNotification() [2/3]

void agxSDK::LinkedStructure::removeNotification ( agxSDK::Simulation simulation)
finaloverridevirtual

Called when this linked structure is added to the simulation.

This callback is reserved for LinkedStructure but onRemoveNotification will be called in a similar way.

Reimplemented from agxSDK::Assembly.

◆ removeNotification() [3/3]

virtual void agxSDK::Assembly::removeNotification ( Assembly )
inlinevirtual

Called when this assembly is removed from another assembly.

Reimplemented from agxSDK::Assembly.

Definition at line 788 of file Assembly.h.

◆ segments()

agxSDK::LinkedSegmentRange< agxSDK::LinkedSegment > agxSDK::LinkedStructure::segments ( )
Returns
A segment range over all segments in this LinkedStructure.

◆ setAngularVelocityDamping()

virtual void agxSDK::LinkedStructure::setAngularVelocityDamping ( const agx::Vec3 angularVelocityDamping)
virtual

Assigns angular velocity damping to all segments in this linked structure.

Note
This value will be assigned to all segments in this linked structure. I.e., new segments will be assigned this value but it doesn't prevent having different damping values along this linked structure.
Parameters
angularVelocityDamping- angular velocity damping (default: (0, 0, 0))

◆ setEnableCollisions() [1/2]

virtual void agxSDK::LinkedStructure::setEnableCollisions ( agx::RigidBody rb,
agx::Bool  enable 
)
virtual

Enable/disable collisions between the rigid body and all segments of this linked structure.

Parameters
rb- rigid body to enable/disable collisions with
enable- true to enable, false to disable

◆ setEnableCollisions() [2/2]

virtual void agxSDK::LinkedStructure::setEnableCollisions ( agxCollide::Geometry geometry,
agx::Bool  enable 
)
virtual

Enable/disable collisions between the geometry and all segments of this linked structure.

Parameters
geometry- geometry to enable/disable collisions with
enable- true to enable, false to disable

◆ setLinearVelocityDamping()

virtual void agxSDK::LinkedStructure::setLinearVelocityDamping ( const agx::Vec3 linearVelocityDamping)
virtual

Assigns linear velocity damping to all segments in this linked structure.

Note
This value will be assigned to all segments in this linked structure. I.e., new segments will be assigned this value but it doesn't prevent having different damping values along this linked structure.
Parameters
linearVelocityDamping- linear velocity damping (default: (0, 0, 0))

◆ setMaterial()

virtual void agxSDK::LinkedStructure::setMaterial ( agx::Material material)
virtual

Assign material to all segments in this linked structure.

Parameters
material- material for the segments

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