AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
agxCable::Cable Class Reference

A model of a cable using a lumped elements model. More...

#include <Cable.h>

+ Inheritance diagram for agxCable::Cable:

Public Member Functions

 Cable (agx::Real radius, agx::Real resolutionPerUnitLength)
 Create a new cable with the given radius and resolution.
 
 Cable (agx::Real radius, agxCable::HomogeneousSegmentsRoute *routingAlgorithm)
 Create a new cable using the given routing algorithm.
 
agx::Bool add (agxCable::RoutingNode *node)
 Add the given cable node to the end of the cable.
 
bool attach (agxCable::CableIterator segment, agx::RigidBody *body, const agx::AffineMatrix4x4 &relativeTransform)
 Attach the given segment to the given rigid body using a LockJoint.
 
bool attach (agxCable::CableIterator segment, agx::RigidBody *body, const agx::Vec3 &relativeTranslate)
 Attach the given segment to the given rigid body using a BallJoint that lets the cable rotate freely around the point.
 
agxCable::CableIterator begin ()
 
agxCable::CableIterator begin () const
 Returns an iterator that walks over the segments of the cable.
 
agxCable::CableIterator end ()
 
agxCable::CableIterator end () const
 Returns an iterator pointing one-past the last segment.
 
agxCable::CableIterator findLast () const
 Returns an iterator pointing to the last segment.
 
agxCable::CableProperties * getCableProperties () const
 Return the cable properties for this cable.
 
virtual agx::Real getCurrentLength () const override
 Get the current length of the cable, including any stretching.
 
agxCable::RouteInitializationReport getInitializationReport () const
 
agx::UInt getNumSegments () const
 Returns the number of segments in the cable.
 
agx::Real getRadius () const
 
agx::Real getResolution () const
 Returns the resolution of the cable, measured in segments per unit length.
 
virtual agx::Real getRestLength () const override
 Get the rest length of the cable.
 
agxCable::SegmentRange getSegments () const
 
bool loadLibraryProperties (const agx::String &name)
 Load named CableProperties from the Material Library for the current Cable.
 
void setCableProperties (agxCable::CableProperties *cableProperties)
 Set the cable properties object used by this cable.
 
agxCable::RouteInitializationReport tryInitialize ()
 Make a dry-run of the cable initialization.
 
agxCable::RouteInitializationReport tryInitialize (agx::Real maxError)
 Make a dry-run with a specified maximum allowed routing error.
 
- Public Member Functions inherited from agxSDK::LinkedStructure
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::LinkedStructureComponent * getComponent (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::Material * getMaterial () 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<>
LinkedSegment * getSegment (const agx::RigidBody *rb) const
 
agx::UInt getSegmentIndex (const agx::RigidBody *rb) const
 
const agxSDK::LinkedSegmentContainer & getSegmentsContainer () 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::LinkedSegment > segments ()
 
virtual void setAngularVelocityDamping (const agx::Vec3 &angularVelocityDamping)
 Assigns angular velocity damping to all segments in this linked structure.
 
virtual void setDisabledCollisionsId (const agx::Uuid &uuid)
 Set the collision id of 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.
 
virtual void setUniqueId (const agx::Uuid &uuid)
 Set the unique id of 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 AssemblyRefSetVector & getAssemblies () const
 
agxSDK::Assembly * getAssembly (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named Assembly.
 
const agxSDK::Assembly * getAssembly (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named Assembly.
 
agxSDK::Assembly * getAssembly (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an Assembly matching the given uuid.
 
const agxSDK::Assembly * getAssembly (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an Assembly matching the given uuid.
 
agx::Constraint * getConstraint (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::Constraint * getConstraint (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::Constraint * getConstraint (const agx::Uuid &uuid, bool recursive=true)
 Find and return a pointer to a Constraint with the given uuid.
 
const agx::Constraint * getConstraint (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return a pointer to a Constraint with the given uuid.
 
agx::Constraint1DOF * getConstraint1DOF (const agx::Name &name, bool recursive=true)
 
agx::Constraint2DOF * getConstraint2DOF (const agx::Name &name, bool recursive=true)
 
const agx::ConstraintRefSetVector & getConstraints () const
 
const agx::EmitterRefSetVector & getEmitters () const
 
const EventListenerRefSetVector & getEventListeners () const
 
virtual agx::Frame * getFrame ()
 Return a reference to the frame containing transformation and velocity information for this assembly.
 
virtual const agx::Frame * getFrame () const
 
const agxCollide::GeometryRefSetVector & getGeometries () const
 
agxCollide::Geometry * getGeometry (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named collision Geometry.
 
const agxCollide::Geometry * getGeometry (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named collision Geometry.
 
agxCollide::Geometry * getGeometry (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return a Geometry matching the given uuid.
 
const agxCollide::Geometry * getGeometry (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return a Geometry matching the given uuid.
 
const agx::InteractionRefSetVector & getInteractions () const
 
agx::Vec3 getLocalPosition () const
 
agx::Quat getLocalRotation () const
 
const agx::AffineMatrix4x4 & getLocalTransform () const
 
const agx::MergedBodyRefSetVector & getMergedBodies () const
 
agx::MergedBody * getMergedBody (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an MergedBody matching the given uuid.
 
const agx::MergedBody * getMergedBody (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an MergedBody matching the given uuid.
 
agx::Name getName () const
 
agx::ObserverFrame * getObserverFrame (const agx::Name &name, bool recursive=true)
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFrame * getObserverFrame (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
agx::ObserverFrame * getObserverFrame (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFrame * getObserverFrame (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFrameRefSetVector & getObserverFrames () const
 
Assembly * getParent ()
 
const Assembly * getParent () const
 
agx::Frame * getParentFrame ()
 
const agx::Frame * getParentFrame () const
 
const agx::ParticleSystemRefSetVector & getParticleSystems () const
 
const agx::RigidBodyRefSetVector & getRigidBodies () const
 
agx::RigidBody * getRigidBody (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named RigidBody.
 
const agx::RigidBody * getRigidBody (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named RigidBody.
 
agx::RigidBody * getRigidBody (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return a pointer to a RigidBody with the given uuid.
 
const agx::RigidBody * getRigidBody (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return a pointer to a RigidBody with the given uuid.
 
agxSDK::Simulation * getSimulation ()
 
const agxSDK::Simulation * getSimulation () const
 
agxSDK::TerrainInstance * getTerrainInstance (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an TerrainInstance matching the given uuid.
 
const agxSDK::TerrainInstance * getTerrainInstance (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an TerrainInstance matching the given uuid.
 
const agxSDK::TerrainInstanceRefSetVector & getTerrainInstances () const
 
agxSDK::TerrainToolInstance * getTerrainToolInstance (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an TerrainToolInstance matching the given uuid.
 
const agxSDK::TerrainToolInstance * getTerrainToolInstance (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an TerrainToolInstance matching the given uuid.
 
const agxSDK::TerrainToolInstanceRefSetVector & getTerrainToolInstances () 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.
 
Referenced & operator= (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 agxCable::Cable * asCable (agxSDK::Assembly *assembly)
 
static Cable * find (agxSDK::Simulation *simulation, const agx::Name &name)
 This method will do a linear search in Simulation and return a pointer to the specified Cable.
 
static Cable * find (agxSDK::Simulation *simulation, const agx::Uuid &uuid)
 This method will do a linear search in Simulation and return a pointer to the specified Cable.
 
static agxCable::CablePtrVector findAll (agxSDK::Simulation *simulation, const agx::Name &name)
 This method will do a linear search in Simulation and return a vector with pointers to all matching Cables.
 
static agxCable::CablePtrVector getAll (agxSDK::Simulation *simulation)
 Collect all Cables in the given simulation.
 
static agx::StringVector getAvailableLibraryProperties ()
 Returns a vector with all the named CableProperties that were found in the Material Library.
 
static agxCable::Cable * getCableForBody (agx::RigidBody *body)
 
static const agxCable::Cable * getCableForBody (const agx::RigidBody *body)
 
static agxCable::Cable * getCableForGeometry (agxCollide::Geometry *geometry)
 
static const agxCable::Cable * getCableForGeometry (const agxCollide::Geometry *geometry)
 
- Static Public Member Functions inherited from agxSDK::LinkedStructure
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static LinkedStructure * get (agx::RigidBody *body)
 
static LinkedStructure * get (agxCollide::Geometry *geometry)
 
static const LinkedStructure * get (const agx::RigidBody *body)
 
static const LinkedStructure * get (const agxCollide::Geometry *geometry)
 
- Static Public Member Functions inherited from agxSDK::Assembly
static Assembly * asAssembly (agxStream::Serializable *obj)
 
static agxStream::Serializable * create (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

 Cable ()
 Used for serialization only.
 
virtual ~Cable ()
 
agxCable::HomogeneousSegmentsRoute * getRoute () const
 
virtual void onAddNotification (agxSDK::Simulation *simulation) override
 Called when addNotification is executed when this linked structure is added to the simulation.
 
virtual void onPostStep () override
 Called on simulation post step event - after user postStep.
 
virtual void onPreStep () override
 Called on simulation pre step event - after user preStep.
 
- Protected Member Functions inherited from agxSDK::LinkedStructure
 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
 
LinkedStructureObjectData * getData (const agx::RigidBody *rb) const
 
agx::UInt getNumSegments () const
 
template<typename T >
T * getSegment (agx::Real restLengthFromStart) const
 
LinkedSegment * getSegment (agx::UInt index) const
 
template<typename ObjT >
LinkedSegment * getSegment (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 ()
 

Additional Inherited Members

- Public Types inherited from agxSDK::Assembly
enum  Type { ASSEMBLY , COLLECTION }
 Specifies the type an assembly is. More...
 
- Static Protected Member Functions inherited from agxSDK::LinkedStructure
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 DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

A model of a cable using a lumped elements model.

A number of RigidBodies, called segments, are created and constrained together to represent the cable.

Definition at line 43 of file Cable.h.

Constructor & Destructor Documentation

◆ Cable() [1/3]

agxCable::Cable::Cable ( agx::Real  radius,
agx::Real  resolutionPerUnitLength 
)

Create a new cable with the given radius and resolution.

The given resolution is used as a starting point, but particulars of the routing and initialization may cause the final resolution to differ from the given one. See tryInitialize.

At creation the cable will have zero length and no position in space. Route the cable by adding nodes to it.

Parameters
radius- The radius of the cable.
resolutionPerUnitLength- The number of lumped elements to create per unit length.

◆ Cable() [2/3]

agxCable::Cable::Cable ( agx::Real  radius,
agxCable::HomogeneousSegmentsRoute *  routingAlgorithm 
)

Create a new cable using the given routing algorithm.

The routing algorithm determines final segment placement when the cable is initialized.

The cable is routed using Cable::add(RoutingNode*) as usual. Different routing algorithm may impose various limitations on how how the cable may be routed.

Parameters
radius- The radius of the cable.
routingAlgorithm- The routing algorithm to use when creating cable segments from the routing nodes.

◆ Cable() [3/3]

agxCable::Cable::Cable ( )
protected

Used for serialization only.

◆ ~Cable()

virtual agxCable::Cable::~Cable ( )
protectedvirtual

Member Function Documentation

◆ add()

agx::Bool agxCable::Cable::add ( agxCable::RoutingNode *  node)

Add the given cable node to the end of the cable.

The cable is extended from the most recently added node to the new node. The cable, by definition, starts at the first node added and ends at the last node.

All modes must be added before the cable initialization is finalized. This happens when the cable is added to the simulation.

Parameters
node- The node to add to the cable route.
Returns
True if the node was added. Will return false if the cable has already been initialized.

◆ asCable()

static agxCable::Cable * agxCable::Cable::asCable ( agxSDK::Assembly *  assembly)
static

◆ attach() [1/2]

bool agxCable::Cable::attach ( agxCable::CableIterator  segment,
agx::RigidBody *  body,
const agx::AffineMatrix4x4 &  relativeTransform 
)

Attach the given segment to the given rigid body using a LockJoint.

The cable will be fixed relative to the body. The relative transform describe the transformation from the body's model coordinate frame to the point that the cable should pass through. The cable will pass through this point along the transformed Z axis.

Parameters
segment- CableIterator pointing to the segment that is to be attached.
body- RigidBody to attach the segment to.
relativeTransform- Transformation describing the orientation of the cable relative to the body.
Returns
True if the segment was successfully attached. False otherwise.

◆ attach() [2/2]

bool agxCable::Cable::attach ( agxCable::CableIterator  segment,
agx::RigidBody *  body,
const agx::Vec3 &  relativeTranslate 
)

Attach the given segment to the given rigid body using a BallJoint that lets the cable rotate freely around the point.

The relative translate is relative to the body's model coordinate frame.

Parameters
segment- CableIterator pointing to the segment that is to be attached.
body- RigidBody to attach the segment to.
relativeTranslate- Point on the body that the cable is to be attached to.
Returns
True if the segment was successfully attached. False otherwise.

◆ begin() [1/2]

agxCable::CableIterator agxCable::Cable::begin ( )

◆ begin() [2/2]

agxCable::CableIterator agxCable::Cable::begin ( ) const

Returns an iterator that walks over the segments of the cable.

From the iterator one can read information such as segment length and position, cable tension and get access to the underlying RigidBody.

◆ end() [1/2]

agxCable::CableIterator agxCable::Cable::end ( )

◆ end() [2/2]

agxCable::CableIterator agxCable::Cable::end ( ) const

Returns an iterator pointing one-past the last segment.

This iterator may not be dereferenced.

◆ find() [1/2]

static Cable * agxCable::Cable::find ( agxSDK::Simulation *  simulation,
const agx::Name &  name 
)
static

This method will do a linear search in Simulation and return a pointer to the specified Cable.

Parameters
simulation- The instance of the simulation in which we are searching
name- Name of the Cable we are searching for
Returns
Pointer to the found Cable or null if not found.

◆ find() [2/2]

static Cable * agxCable::Cable::find ( agxSDK::Simulation *  simulation,
const agx::Uuid &  uuid 
)
static

This method will do a linear search in Simulation and return a pointer to the specified Cable.

Parameters
simulation- The instance of the simulation in which we are searching
uuid- uuid of the Cable we are searching for
Returns
pointer to the found Cable or null if not found.

◆ findAll()

static agxCable::CablePtrVector agxCable::Cable::findAll ( agxSDK::Simulation *  simulation,
const agx::Name &  name 
)
static

This method will do a linear search in Simulation and return a vector with pointers to all matching Cables.

Parameters
simulation- The instance of the simulation in which we are searching
name- Name of the Cable's we are searching for
Returns
Vector containing pointers to all matching Cables.

◆ findLast()

agxCable::CableIterator agxCable::Cable::findLast ( ) const

Returns an iterator pointing to the last segment.

◆ getAll()

static agxCable::CablePtrVector agxCable::Cable::getAll ( agxSDK::Simulation *  simulation)
static

Collect all Cables in the given simulation.

Parameters
simulation- The simulation to get cables from.
Returns
Vector containing pointes to all cables in the simulation.

◆ getAvailableLibraryProperties()

static agx::StringVector agxCable::Cable::getAvailableLibraryProperties ( )
static

Returns a vector with all the named CableProperties that were found in the Material Library.

Returns
A vector with the names of all found CableProperties in the MaterialLibrary

◆ getCableForBody() [1/2]

static agxCable::Cable * agxCable::Cable::getCableForBody ( agx::RigidBody *  body)
static
Returns
The cable that the given body is part of, or nullptr if there is no such cable.

◆ getCableForBody() [2/2]

static const agxCable::Cable * agxCable::Cable::getCableForBody ( const agx::RigidBody *  body)
static

◆ getCableForGeometry() [1/2]

static agxCable::Cable * agxCable::Cable::getCableForGeometry ( agxCollide::Geometry *  geometry)
static
Returns
The cable that the given geometry is part of, or nullptr if there is no such cable.

◆ getCableForGeometry() [2/2]

static const agxCable::Cable * agxCable::Cable::getCableForGeometry ( const agxCollide::Geometry *  geometry)
static

◆ getCableProperties()

agxCable::CableProperties * agxCable::Cable::getCableProperties ( ) const

Return the cable properties for this cable.

CableProperties may be shared among several cables.

◆ getCurrentLength()

virtual agx::Real agxCable::Cable::getCurrentLength ( ) const
overridevirtual

Get the current length of the cable, including any stretching.

The current length of an uninitialized cable is the length of the path created by the routing nodes added so far.

Returns
The current length of the cable.

Reimplemented from agxSDK::LinkedStructure.

◆ getInitializationReport()

agxCable::RouteInitializationReport agxCable::Cable::getInitializationReport ( ) const
Returns
A report describing the result of the initialization.

◆ getNumSegments()

agx::UInt agxCable::Cable::getNumSegments ( ) const

Returns the number of segments in the cable.

Only valid after the cable has been fully initialized, i.e., added to a agxSDK::Simulation.

Results from the dry-runs performed by tryInitialize is not seen here. Inspect the report returned from tryInitialize instead.

Returns
The number of segments in the cable.

◆ getRadius()

agx::Real agxCable::Cable::getRadius ( ) const
Returns
The radius of this cable.

◆ getResolution()

agx::Real agxCable::Cable::getResolution ( ) const

Returns the resolution of the cable, measured in segments per unit length.

This value is updated by both the cable initialization and the dry-runs performed by tryInitialize.

◆ getRestLength()

virtual agx::Real agxCable::Cable::getRestLength ( ) const
overridevirtual

Get the rest length of the cable.

For an initialized cable this is the sum of the segment lengths. For an uninitialized cable it is the length of the path created by the routing nodes added so far.

Returns
The rest length of the cable.

Reimplemented from agxSDK::LinkedStructure.

◆ getRoute()

agxCable::HomogeneousSegmentsRoute * agxCable::Cable::getRoute ( ) const
protected
Returns
The route defining the initial path of the cable.

◆ getSegments()

agxCable::SegmentRange agxCable::Cable::getSegments ( ) const
Returns
A range spanning over all the segments in this cable.

◆ loadLibraryProperties()

bool agxCable::Cable::loadLibraryProperties ( const agx::String &  name)

Load named CableProperties from the Material Library for the current Cable.

Returns
True if properties could be loaded

◆ onAddNotification()

virtual void agxCable::Cable::onAddNotification ( agxSDK::Simulation *  simulation)
overrideprotectedvirtual

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

Reimplemented from agxSDK::LinkedStructure.

◆ onPostStep()

virtual void agxCable::Cable::onPostStep ( )
overrideprotectedvirtual

Called on simulation post step event - after user postStep.

Reimplemented from agxSDK::LinkedStructure.

◆ onPreStep()

virtual void agxCable::Cable::onPreStep ( )
overrideprotectedvirtual

Called on simulation pre step event - after user preStep.

Reimplemented from agxSDK::LinkedStructure.

◆ setCableProperties()

void agxCable::Cable::setCableProperties ( agxCable::CableProperties *  cableProperties)

Set the cable properties object used by this cable.

This will cause this cable to share properties with the cable from which the cable properties object was fetched.

◆ tryInitialize() [1/2]

agxCable::RouteInitializationReport agxCable::Cable::tryInitialize ( )

Make a dry-run of the cable initialization.

This will produce a report detailing the configuration of the cable that would be produced if added to the simulation right now. From this report one can read the routing error and the number of segments created.

The resolution of the cable is updated to match the resolution found by the test-initialization and can be queried using getResolution().

Returns
Report detailing the initialization results.

◆ tryInitialize() [2/2]

agxCable::RouteInitializationReport agxCable::Cable::tryInitialize ( agx::Real  maxError)

Make a dry-run with a specified maximum allowed routing error.

The error is the amount of overlap or gap between consecutive segments at initialization. The initialization process tries to find a resolution that produces an error that is below the given limit. This is not always possible.

If the cable is initialized without specifying a maximum error then an error limit is estimated from the route.


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