AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agxCable::Cable Class Reference

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

#include <Cable.h>

+ Inheritance diagram for agxCable::Cable:

Public Types

enum  Type { ASSEMBLY, COLLECTION }
 Specifies the type an assembly is. More...
 

Public Member Functions

 Cable (agx::Real radius, agx::Real resolutionPerUnitLength)
 Create a new cable with the given radius and resolution. More...
 
 Cable (agx::Real radius, agxCable::HomogeneousSegmentsRoute *routingAlgorithm)
 Create a new cable using the given routing algorithm. More...
 
bool add (agx::Constraint *constraint)
 Add a constraint to the assembly. More...
 
agx::Bool add (agxCable::RoutingNode *node)
 Add the given cable node to the end of the cable. More...
 
bool add (agx::Interaction *interaction)
 Add an interaction to this assembly. More...
 
bool add (agxSDK::EventListener *listener)
 Add a listener to the assembly. More...
 
bool add (agx::RigidBody *body)
 Add a rigid body to the assembly. More...
 
bool add (agxCollide::Geometry *geometry)
 Add a geometry to the assembly. More...
 
bool add (Assembly *assembly)
 Add another assembly as child to this assembly. More...
 
bool add (agx::ContactMaterial *contactMaterial)
 Add a contact material to this assembly. More...
 
bool add (agx::Emitter *emitter)
 Add an emitter to this assembly. More...
 
bool add (agx::ObserverFrame *observerFrame)
 Add an ObserverFrame to this assembly. More...
 
bool add (agxStream::Serializable *object)
 Add an object of type serialized. More...
 
virtual agx::Bool addComponent (agxSDK::LinkedStructureComponent *component)
 Add new component to this linked structure. More...
 
virtual void addGroup (agx::UInt32 id)
 Add group id to all segments in this linked structure. More...
 
virtual void addGroup (const agx::Name &name)
 Add group name to all segments in this linked structure. More...
 
void addNotification (agxSDK::Simulation *simulation) finaloverride
 Called when this linked structure is added to the simulation. More...
 
virtual void addNotification (Assembly *)
 Called when this assembly is added to another assembly. More...
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
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. More...
 
bool attach (agxCable::CableIterator segment, agx::RigidBody *body, const agx::AffineMatrix4x4 &relativeTransform)
 Attach the given segment to the given rigid body using a LockJoint. More...
 
agxCable::CableIterator begin () const
 Returns an iterator that walks over the segments of the cable. More...
 
agxCable::CableIterator begin ()
 
agxCable::CableIterator end () const
 Returns an iterator pointing one-past the last segment. More...
 
agxCable::CableIterator end ()
 
virtual
agxCollide::GroupIdCollection 
findGroupIdCollection () const
 
agxCable::CableIterator findLast () const
 Returns an iterator pointing to the last segment. More...
 
virtual agx::Vec3 getAngularVelocityDamping () const
 
const AssemblyRefSet & getAssemblies () const
 
const agxSDK::Assembly * getAssembly (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named Assembly. More...
 
agxSDK::Assembly * getAssembly (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named Assembly. More...
 
const agxSDK::Assembly * getAssembly (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an Assembly matching the given uuid. More...
 
agxSDK::Assembly * getAssembly (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an Assembly matching the given uuid. More...
 
agxCable::CableProperties * getCableProperties () const
 Return the cable properties for this cable. More...
 
const char * getClassName () const override
 
template<typename T >
T * getComponent () const
 
agxSDK::LinkedStructureComponent * getComponent (const agx::Name &name) const
 
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. More...
 
agx::Constraint * getConstraint (const agx::Uuid &uuid, bool recursive=true)
 Find and return a pointer to a Constraint with the given uuid. More...
 
const agx::Constraint * getConstraint (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named Constraint. More...
 
agx::Constraint * getConstraint (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named Constraint. More...
 
template<typename T >
T * getConstraint (const agx::Name &name, bool recursive=true)
 Find and return named Constraint of a template type, for example Hinge: More...
 
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: More...
 
agx::Constraint1DOF * getConstraint1DOF (const agx::Name &name, bool recursive=true)
 
agx::Constraint2DOF * getConstraint2DOF (const agx::Name &name, bool recursive=true)
 
const agx::ConstraintRefSet & getConstraints () const
 
virtual agx::Real getCurrentLength () const override
 Get the current length of the cable, including any stretching. More...
 
virtual agx::UInt32 getDisabledCollisionGroupId () const
 
const agx::EmitterRefSet & getEmitters () const
 
virtual agx::Bool getEnableCollisions (const agx::RigidBody *rb) const
 
virtual agx::Bool getEnableCollisions (const agxCollide::Geometry *geometry) const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
virtual agx::Frame * getFrame ()
 Return a reference to the frame containing transformation and velocity information for this assembly. More...
 
virtual const agx::Frame * getFrame () const
 
const agxCollide::GeometryRefSet & getGeometries () const
 
const agxCollide::Geometry * getGeometry (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named collision Geometry. More...
 
agxCollide::Geometry * getGeometry (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named collision Geometry. More...
 
const agxCollide::Geometry * getGeometry (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return a Geometry matching the given uuid. More...
 
agxCollide::Geometry * getGeometry (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return a Geometry matching the given uuid. More...
 
agx::UInt32 getIndex () const
 This index is given at creation of this object. More...
 
agxCable::RouteInitializationReport getInitializationReport () const
 
const InteractionRefSetVector & getInteractions () const
 
virtual agx::Vec3 getLinearVelocityDamping () const
 
agx::Vec3 getLocalPosition () const
 
agx::Quat getLocalRotation () const
 
const agx::AffineMatrix4x4 & getLocalTransform () const
 
virtual agx::Real getMass () const
 Calculates and returns the total mass of this linked structure. More...
 
virtual agx::Material * getMaterial () const
 
agx::Name getName () const
 
agx::UInt getNumSegments () const
 Returns the number of segments in the cable. More...
 
const agx::ObserverFrame * getObserverFrame (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return an ObserverFrame matching the given uuid. More...
 
agx::ObserverFrame * getObserverFrame (const agx::Name &name, bool recursive=true)
 Find (linear search) and return an ObserverFrame matching the given uuid. More...
 
const agx::ObserverFrame * getObserverFrame (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an ObserverFrame matching the given uuid. More...
 
agx::ObserverFrame * getObserverFrame (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an ObserverFrame matching the given uuid. More...
 
const ObserverFrameRefSetVector & getObserverFrames () const
 
Assembly * getParent ()
 
const Assembly * getParent () const
 
agx::Frame * getParentFrame ()
 
const agx::Frame * getParentFrame () const
 
const
agxSDK::ParticleSystemRefSet & 
getParticleSystems () const
 
agx::Real getRadius () const
 
int getReferenceCount () const
 
agx::Real getResolution () const
 Returns the resolution of the cable, measured in units of length per segment. More...
 
virtual agx::Real getRestLength () const override
 Get the rest length of the cable. More...
 
virtual agx::Real getRestVolume () const
 Calculates and returns the total volume of this linked structure, at rest. More...
 
const agx::RigidBodyRefSet & getRigidBodies () const
 
agx::RigidBody * getRigidBody (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named RigidBody. More...
 
const agx::RigidBody * getRigidBody (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named RigidBody. More...
 
agx::RigidBody * getRigidBody (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return a pointer to a RigidBody with the given uuid. More...
 
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. More...
 
template<>
LinkedSegment * getSegment (const agx::RigidBody *rb) const
 
agx::UInt getSegmentIndex (const agx::RigidBody *rb) const
 
agxCable::SegmentRange getSegments () const
 
const
agxSDK::LinkedSegmentContainer & 
getSegmentsContainer () const
 
agxSDK::Simulation * getSimulation ()
 
const agxSDK::Simulation * getSimulation () const
 
agxStream::StorageAgent * getStorageAgent () const override
 
Type getType () const
 
virtual agx::UInt32 getUniqueId () const
 
agx::Uuid getUuid () const
 
virtual agx::Bool hasGroup (agx::UInt32 id) const
 
virtual agx::Bool hasGroup (const agx::Name &name) const
 
template<typename T >
bool is () const
 Subclass test. More...
 
bool isFinished () const
 
virtual agx::Bool rebind ()
 Make the current relative positions of all nodes the rest state. More...
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
bool remove (agx::Constraint *constraint)
 Remove a constraint from this assembly (does not recurse down in tree). More...
 
bool remove (agx::Interaction *interaction)
 Remove an interaction from this assembly. More...
 
bool remove (EventListener *listener)
 Remove an EventListener from the assembly. More...
 
bool remove (agx::RigidBody *body, bool removeAssociatedGeometries=false)
 Remove a rigid body from this assembly (does not recurse down in tree). More...
 
bool remove (agxCollide::Geometry *geometry)
 Remove a geometry from this assembly (does not recurse down in tree). More...
 
bool remove (Assembly *assembly)
 Remove a child assembly from a parent. More...
 
bool remove (agx::ContactMaterial *contactMaterial)
 Remove a contact material from this assembly. More...
 
bool remove (agx::Emitter *emitter)
 Remove an emitter from this assembly. More...
 
bool remove (agx::ObserverFrame *observerFrame)
 Remove an ObserverFrame from this assembly. More...
 
virtual agx::Bool removeComponent (agxSDK::LinkedStructureComponent *component)
 Remove an added component from this linked structure. More...
 
virtual void removeGroup (agx::UInt32 id)
 Remove group id from all segments in this linked structure. More...
 
virtual void removeGroup (const agx::Name &name)
 Remove group name from all segments in this linked structure. More...
 
void removeNotification (agxSDK::Simulation *simulation) finaloverride
 Called when this linked structure is added to the simulation. More...
 
virtual void removeNotification (Assembly *)
 Called when this assembly is removed from another assembly. More...
 
virtual void restore (agxStream::InputArchive &in) override
 
agxSDK::LinkedSegmentRange
< agxSDK::LinkedSegment > 
segments ()
 
virtual void setAngularVelocity (const agx::Vec3 &velocity)
 Set the angular velocity (in world frame) recursively for all rigid bodies stored in assembly. More...
 
virtual void setAngularVelocityDamping (const agx::Vec3 &angularVelocityDamping)
 Assigns angular velocity damping to all segments in this linked structure. More...
 
void setCableProperties (agxCable::CableProperties *cableProperties)
 Set the cable properties object used by this cable. More...
 
virtual void setEnableCollisions (agx::RigidBody *rb, agx::Bool enable)
 Enable/disable collisions between the rigid body and all segments of this linked structure. More...
 
virtual void setEnableCollisions (agxCollide::Geometry *geometry, agx::Bool enable)
 Enable/disable collisions between the geometry and all segments of this linked structure. More...
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object. More...
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More...
 
virtual void setLinearVelocityDamping (const agx::Vec3 &linearVelocityDamping)
 Assigns linear velocity damping to all segments in this linked structure. More...
 
void setLocalPosition (const agx::Vec3 &p)
 Set the position of the assembly relative to its frame's parent frame. More...
 
void setLocalPosition (agx::Real x, agx::Real y, agx::Real z)
 Set the position of the assembly relative to its frame's parent frame. More...
 
void setLocalRotation (const agx::Quat &q)
 Set the rotation of the assembly relative to its frame's parent frame. More...
 
void setLocalRotation (const agx::EulerAngles &e)
 Set the rotation of the assembly relative to its frame's parent frame. More...
 
void setLocalTransform (const agx::AffineMatrix4x4 &matrix)
 Assign the local transformation matrix for this assembly, ignoring any eventual parent transformation. More...
 
virtual void setMaterial (agx::Material *material)
 Assign material to all segments in this linked structure. More...
 
void setName (const agx::Name &name)
 Set the name of this Assembly. More...
 
bool setParentFrame (agx::Frame *frame)
 Set the parent frame of this assembly's frame. More...
 
void setPosition (const agx::Vec3 &p)
 Set the position of the frame in world coordinates. More...
 
void setPosition (agx::Real x, agx::Real y, agx::Real z)
 Set the position of the frame in world coordinates. More...
 
void setRotation (const agx::Quat &q)
 Set the rotation of the assembly relative to world frame. More...
 
void setRotation (const agx::EulerAngles &e)
 Set the rotation of the assembly relative to world frame. More...
 
void setRotation (const agx::OrthoMatrix3x3 &m)
 Set the rotation of the assembly relative to world frame. More...
 
void setTransform (const agx::AffineMatrix4x4 &matrix)
 Set the transform of the assembly. More...
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object. More...
 
virtual void setVelocity (const agx::Vec3 &velocity)
 Set the linear velocity (in world frame) recursively for all rigid bodies stored in assembly. More...
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual void traverse (AssemblyVisitor *visitor)
 Traverse the assembly tree recursively using a visitor. More...
 
virtual void traverse (const AssemblyVisitor *visitor) const
 
agxCable::RouteInitializationReport tryInitialize ()
 Make a dry-run of the cable initialization. More...
 
agxCable::RouteInitializationReport tryInitialize (agx::Real maxError)
 Make a dry-run with a specified maximum allowed routing error. More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Static Public Member Functions

static Assembly * asAssembly (agxStream::Serializable *obj)
 
static agxCable::Cable * asCable (agxSDK::Assembly *assembly)
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static agxStream::Serializable * create ()
 
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. More...
 
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. More...
 
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. More...
 
static LinkedStructure * get (agxCollide::Geometry *geometry)
 
static const LinkedStructure * get (const agxCollide::Geometry *geometry)
 
static LinkedStructure * get (agx::RigidBody *body)
 
static const LinkedStructure * get (const agx::RigidBody *body)
 
static agxCable::CablePtrVector getAll (agxSDK::Simulation *simulation)
 Collect all Cables in the given simulation. More...
 
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 const char * getConstructClassId ()
 
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More...
 
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

 Cable ()
 Used for serialization only. More...
 
virtual ~Cable ()
 
void add (LinkedSegment *segment)
 Add segment to this linked structure. More...
 
bool addParticleSystem (agx::ParticleSystem *particleSystem)
 Add a particle system to this assembly. More...
 
void addToSimulation (Simulation *simulation)
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
void generateUuid ()
 
LinkedStructureObjectData * getData (const agx::RigidBody *rb) const
 
agxCable::HomogeneousSegmentsRoute * getRoute () 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 (agx::UInt beginIndex, agx::UInt endIndex) const
 Range given begin and end segment index. More...
 
virtual void onAddNotification (agxSDK::Simulation *simulation) override
 Called when addNotification is executed when this linked structure is added to the simulation. More...
 
virtual void onGroupAdd (const IdData &group)
 Called when a new group has been added. More...
 
virtual void onGroupRemove (const IdData &group)
 Called when an existing group has been removed. More...
 
virtual void onLastStep ()
 Called on simulation last step event - after user lastStep. More...
 
virtual void onMaterialNew ()
 Called when a new material has been assigned. More...
 
virtual void onPostStep () override
 Called on simulation post step event - after user postStep. More...
 
virtual void onPreCollideStep ()
 Called on simulation pre-collide step event - after user preCollide. More...
 
virtual void onPreStep () override
 Called on simulation pre step event - after user preStep. More...
 
virtual void onRemoveNotification (agxSDK::Simulation *simulation)
 Called when removeNotification is executed when this linked structure is removed from the simulation. More...
 
virtual void onSetEnableCollisions (agxCollide::Geometry *geometry, agx::Bool enable)
 Called when collision state changed for given geometry. More...
 
void removeFromSimulation (Simulation *simulation)
 
bool removeParticleSystem (agx::ParticleSystem *particleSystem)
 Remove a particle system from this assembly. More...
 

Static Protected Member Functions

static DeleteHandler * getDeleteHandler ()
 
template<typename T >
static T * getT (agx::RigidBody *rb)
 
template<typename T >
static const T * getT (const agx::RigidBody *rb)
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Protected Attributes

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

Member Enumeration Documentation

enum agxSDK::Assembly::Type
inherited

Specifies the type an assembly is.

Enumerator
ASSEMBLY 

This is a full fledged Assembly which uses Frame for the hierarchy.

COLLECTION 

This is only a collection of objects NOT using Frame for the hierarchy.

Definition at line 615 of file Assembly.h.

Constructor & Destructor Documentation

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.
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.
agxCable::Cable::Cable ( )
protected

Used for serialization only.

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

Member Function Documentation

bool agxSDK::Assembly::add ( agx::Constraint *  constraint)
inherited

Add a constraint to the assembly.

Returns
true when the constraint has been successfully added - otherwise false (constraint is nullptr or already present in this assembly)
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.
bool agxSDK::Assembly::add ( agx::Interaction *  interaction)
inherited

Add an interaction to this assembly.

Returns
true when the interaction has been successfully added - otherwise false (interaction is nullptr or already present in this assembly)
bool agxSDK::Assembly::add ( agxSDK::EventListener *  listener)
inherited

Add a listener to the assembly.

Returns
true when the listener has been successfully added - otherwise false (listener is nullptr or already present in this assembly)
bool agxSDK::Assembly::add ( agx::RigidBody *  body)
inherited

Add a rigid body to the assembly.

Returns
true when the rigid body has been successfully added - otherwise false (the rigid body is nullptr or already present in this assembly)
bool agxSDK::Assembly::add ( agxCollide::Geometry *  geometry)
inherited

Add a geometry to the assembly.

Returns
true when the geometry has been successfully added - otherwise false (the geometry is nullptr or already present in this assembly)
bool agxSDK::Assembly::add ( Assembly *  assembly)
inherited

Add another assembly as child to this assembly.

Returns
true when the assembly has been successfully added - otherwise false (the assembly is nullptr or already present in this assembly)
bool agxSDK::Assembly::add ( agx::ContactMaterial *  contactMaterial)
inherited

Add a contact material to this assembly.

Returns
true when the contact material has been successfully added - otherwise false (the contact material is nullptr or already present in this assembly)
bool agxSDK::Assembly::add ( agx::Emitter *  emitter)
inherited

Add an emitter to this assembly.

Returns
true when the emitter has been successfully added - otherwise false (the emitter is nullptr or already present in this assembly)
bool agxSDK::Assembly::add ( agx::ObserverFrame *  observerFrame)
inherited

Add an ObserverFrame to this assembly.

Returns
true when the observer frame has been successfully added - otherwise false (the observer frame is nullptr or already present in this assembly)
bool agxSDK::Assembly::add ( agxStream::Serializable *  object)
inherited

Add an object of type serialized.

The object will be dynamically cast to the types supported by add() methods an appropriately added to this Assembly.

Returns
true when the object has been successfully added - otherwise false (the object is nullptr or already present in this assembly)
void agxSDK::LinkedStructure::add ( LinkedSegment *  segment)
protectedinherited

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
virtual agx::Bool agxSDK::LinkedStructure::addComponent ( agxSDK::LinkedStructureComponent *  component)
virtualinherited

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
virtual void agxSDK::LinkedStructure::addGroup ( agx::UInt32  id)
virtualinherited

Add group id to all segments in this linked structure.

Parameters
id- id to add
virtual void agxSDK::LinkedStructure::addGroup ( const agx::Name &  name)
virtualinherited

Add group name to all segments in this linked structure.

Parameters
name- name to add
void agxSDK::LinkedStructure::addNotification ( agxSDK::Simulation *  simulation)
finaloverridevirtualinherited

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.

virtual void agxSDK::Assembly::addNotification ( Assembly *  )
inlinevirtualinherited

Called when this assembly is added to another assembly.

Reimplemented in agxPowerLine::PowerLine.

Definition at line 589 of file Assembly.h.

bool agxSDK::Assembly::addParticleSystem ( agx::ParticleSystem *  particleSystem)
protectedinherited

Add a particle system to this assembly.

ParticleSystems should only be added to Collections.

void agxSDK::Assembly::addToSimulation ( Simulation *  simulation)
protectedinherited
void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().

template<typename T >
const T* agx::Referenced::as ( ) const
inherited
static Assembly* agxSDK::Assembly::asAssembly ( agxStream::Serializable *  obj)
inlinestaticinherited
Returns
a pointer to an Assembly if obj is infact an Assembly

Definition at line 636 of file Assembly.h.

static agxCable::Cable* agxCable::Cable::asCable ( agxSDK::Assembly *  assembly)
static
template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
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.
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.
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.

agxCable::CableIterator agxCable::Cable::begin ( )
static agxStream::Serializable* agxSDK::LinkedStructure::create ( )
inlinestaticinherited

Definition at line 247 of file LinkedStructure.h.

static agxStream::Serializable* agxSDK::LinkedStructure::create ( agxStream::InputArchive &  )
inlinestaticinherited

Definition at line 247 of file LinkedStructure.h.

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
agxCable::CableIterator agxCable::Cable::end ( ) const

Returns an iterator pointing one-past the last segment.

This iterator may not be dereferenced.

agxCable::CableIterator agxCable::Cable::end ( )
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.
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.
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.
virtual agxCollide::GroupIdCollection agxSDK::LinkedStructure::findGroupIdCollection ( ) const
virtualinherited
Returns
collection of group names and id's that has been added to this linked structure
agxCable::CableIterator agxCable::Cable::findLast ( ) const

Returns an iterator pointing to the last segment.

void agxStream::Serializable::generateUuid ( )
protectedinherited
static LinkedStructure* agxSDK::LinkedStructure::get ( agxCollide::Geometry *  geometry)
staticinherited
Returns
The LinkedStructure the given geometry is part of, or nullptr if there is no such LinkedStructure.
static const LinkedStructure* agxSDK::LinkedStructure::get ( const agxCollide::Geometry *  geometry)
staticinherited
Returns
The LinkedStructure the given geometry is part of, or nullptr if there is no such LinkedStructure.
static LinkedStructure* agxSDK::LinkedStructure::get ( agx::RigidBody *  body)
staticinherited
Returns
The LinkedStructure the given body is part of, or nullptr if there is no such LinkedStructure.
static const LinkedStructure* agxSDK::LinkedStructure::get ( const agx::RigidBody *  body)
staticinherited
Returns
The LinkedStructure the given body is part of, or nullptr if there is no such LinkedStructure.
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.
virtual agx::Vec3 agxSDK::LinkedStructure::getAngularVelocityDamping ( ) const
virtualinherited
Returns
the given angular velocity damping previously assigned to this linked structure (default: (0, 0, 0))
const AssemblyRefSet& agxSDK::Assembly::getAssemblies ( ) const
inherited
Returns
a const reference to the Assemblies in this Assembly (not tracing recursively into sub-assemblies)
const agxSDK::Assembly* agxSDK::Assembly::getAssembly ( const agx::Name &  name,
bool  recursive = true 
) const
inherited

Find (linear search) and return named Assembly.

Parameters
name- name of the Assembly to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found Assembly, null if not found
agxSDK::Assembly* agxSDK::Assembly::getAssembly ( const agx::Name &  name,
bool  recursive = true 
)
inherited

Find (linear search) and return named Assembly.

Parameters
name- name of the Assembly to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found Assembly, null if not found
const agxSDK::Assembly* agxSDK::Assembly::getAssembly ( const agx::Uuid &  uuid,
bool  recursive = true 
) const
inherited

Find (linear search) and return an Assembly matching the given uuid.

Parameters
uuid- uuid of the Assembly to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found Assembly, null if not found
agxSDK::Assembly* agxSDK::Assembly::getAssembly ( const agx::Uuid &  uuid,
bool  recursive = true 
)
inherited

Find (linear search) and return an Assembly matching the given uuid.

Parameters
uuid- uuid of the Assembly to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found Assembly, null if not found
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.
static const agxCable::Cable* agxCable::Cable::getCableForBody ( const agx::RigidBody *  body)
static
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.
static const agxCable::Cable* agxCable::Cable::getCableForGeometry ( const agxCollide::Geometry *  geometry)
static
agxCable::CableProperties* agxCable::Cable::getCableProperties ( ) const

Return the cable properties for this cable.

CableProperties may be shared among several cables.

const char* agxSDK::LinkedStructure::getClassName ( ) const
inlineoverridevirtualinherited
Returns
the class name of this class.

Reimplemented from agxSDK::Assembly.

Reimplemented in agxVehicle::Track.

Definition at line 247 of file LinkedStructure.h.

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

Definition at line 482 of file LinkedStructure.h.

agxSDK::LinkedStructureComponent* agxSDK::LinkedStructure::getComponent ( const agx::Name &  name) const
inherited
Returns
first component of given name
const agx::Constraint* agxSDK::Assembly::getConstraint ( const agx::Uuid &  uuid,
bool  recursive = true 
) const
inherited

Find (linear search) and return a pointer to a Constraint with the given uuid.

Parameters
uuid- uuid of the requested constraint
recursive- if true (default) the search will include sub-assemblies
Returns
const pointer to the found constraint, null if not found

Referenced by agxSDK::Assembly::getConstraint().

agx::Constraint* agxSDK::Assembly::getConstraint ( const agx::Uuid &  uuid,
bool  recursive = true 
)
inherited

Find and return a pointer to a Constraint with the given uuid.

Parameters
uuid- uuid of the requested constraint
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found Constraint, null if not found
const T * agxSDK::Assembly::getConstraint ( const agx::Name &  name,
bool  recursive = true 
) const
inherited

Find (linear search) and return named Constraint.

Parameters
name- name of the Constraint to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found Constraint, null if not found

Definition at line 763 of file Assembly.h.

References agxSDK::Assembly::getConstraint().

T * agxSDK::Assembly::getConstraint ( const agx::Name &  name,
bool  recursive = true 
)
inherited

Find (linear search) and return named Constraint.

Parameters
name- name of the Constraint to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found Constraint, null if not found

Definition at line 757 of file Assembly.h.

References agxSDK::Assembly::getConstraint().

template<typename T >
T* agxSDK::Assembly::getConstraint ( const agx::Name &  name,
bool  recursive = true 
)
inherited

Find and return named Constraint of a template type, for example Hinge:

agx::Hinge *hinge = simulation->getConstraint<agx::Hinge>("FrontWheelHinge");

Parameters
name- name of the Constraint to find
recursive- if true (default) the search will include sub-assemblies
Returns
typed pointer to the found Constraint, null if not found
template<typename T >
const T* agxSDK::Assembly::getConstraint ( const agx::Name &  name,
bool  recursive = true 
) const
inherited

Find and return named Constraint of a template type, for example Hinge:

const agx::Hinge* hinge = simulation->getConstraint<agx::Hinge>("FrontWheelHinge");

Parameters
name- name of the Constraint to find
recursive- if true (default) the search will include sub-assemblies
Returns
typed pointer to the found Constraint, null if not found
agx::Constraint1DOF* agxSDK::Assembly::getConstraint1DOF ( const agx::Name &  name,
bool  recursive = true 
)
inlineinherited

Definition at line 632 of file Assembly.h.

agx::Constraint2DOF* agxSDK::Assembly::getConstraint2DOF ( const agx::Name &  name,
bool  recursive = true 
)
inlineinherited

Definition at line 633 of file Assembly.h.

const agx::ConstraintRefSet& agxSDK::Assembly::getConstraints ( ) const
inherited
Returns
a const reference to the Constraints in this Assembly (not tracing recursively into sub-assemblies)
static const char* agxSDK::LinkedStructure::getConstructClassId ( )
inlinestaticinherited

Definition at line 247 of file LinkedStructure.h.

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.

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

Definition at line 555 of file LinkedStructure.h.

Referenced by agxSDK::LinkedStructure::getSegmentIndex().

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
virtual agx::UInt32 agxSDK::LinkedStructure::getDisabledCollisionGroupId ( ) const
virtualinherited
Returns
the collision id of this linked structure
const agx::EmitterRefSet& agxSDK::Assembly::getEmitters ( ) const
inherited
Returns
a const reference to the Emitters in this Assembly (not tracing recursively into sub-assemblies)
virtual agx::Bool agxSDK::LinkedStructure::getEnableCollisions ( const agx::RigidBody *  rb) const
virtualinherited
Returns
true if collisions are enabled - otherwise false
virtual agx::Bool agxSDK::LinkedStructure::getEnableCollisions ( const agxCollide::Geometry *  geometry) const
virtualinherited
Returns
true if collisions are enabled - otherwise false
bool agxStream::Serializable::getEnableSerialization ( ) const
inherited
Returns
true if serialization is enabled for this object

Definition at line 273 of file Serializable.h.

bool agxStream::Serializable::getEnableUuidGeneration ( )
inherited
Returns
true if Uuid:s should be generated for each new Serializable object
agx::Frame * agxSDK::Assembly::getFrame ( )
inlinevirtualinherited

Return a reference to the frame containing transformation and velocity information for this assembly.

Definition at line 690 of file Assembly.h.

References agx::ref_ptr< T >::get().

const agx::Frame * agxSDK::Assembly::getFrame ( ) const
inlinevirtualinherited

Definition at line 695 of file Assembly.h.

References agx::ref_ptr< T >::get().

const agxCollide::GeometryRefSet& agxSDK::Assembly::getGeometries ( ) const
inherited
Returns
a const reference to the Geometries in this Assembly (not tracing recursively into sub-assemblies)

Referenced by agxSDK::matchFilter().

const agxCollide::Geometry* agxSDK::Assembly::getGeometry ( const agx::Name &  name,
bool  recursive = true 
) const
inherited

Find (linear search) and return named collision Geometry.

Parameters
name- name of the collision Geometry to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found collision Geometry, null if not found
agxCollide::Geometry* agxSDK::Assembly::getGeometry ( const agx::Name &  name,
bool  recursive = true 
)
inherited

Find (linear search) and return named collision Geometry.

Parameters
name- name of the collision Geometry to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found collision Geometry, null if not found
const agxCollide::Geometry* agxSDK::Assembly::getGeometry ( const agx::Uuid &  uuid,
bool  recursive = true 
) const
inherited

Find (linear search) and return a Geometry matching the given uuid.

Parameters
uuid- uuid of the collision Geometry to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found collision Geometry, null if not found
agxCollide::Geometry* agxSDK::Assembly::getGeometry ( const agx::Uuid &  uuid,
bool  recursive = true 
)
inherited

Find (linear search) and return a Geometry matching the given uuid.

Parameters
uuid- uuid of the collision Geometry to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found collision Geometry, null if not found
agx::UInt32 agxStream::Serializable::getIndex ( ) const
inherited

This index is given at creation of this object.

It is guaranteed to be unique for the lifetime of this library instance. As long as the application is running. This value is not serialized or restored. A new object will always get a new index no matter how it is created.

Returns
an instance index of this object. This is unique for the lifetime of this library instance.

Definition at line 247 of file Serializable.h.

agxCable::RouteInitializationReport agxCable::Cable::getInitializationReport ( ) const
Returns
A report describing the result of the initialization.
const InteractionRefSetVector& agxSDK::Assembly::getInteractions ( ) const
inherited
Returns
interactions in this assembly (not tracing recursively into sub-assemblies)
virtual agx::Vec3 agxSDK::LinkedStructure::getLinearVelocityDamping ( ) const
virtualinherited
Returns
the given linear velocity damping previously assigned to this linked structure (default: (0, 0, 0))
agx::Vec3 agxSDK::Assembly::getLocalPosition ( ) const
inherited
Returns
- the relative translate to the parent frame of the assembly's frame.
agx::Quat agxSDK::Assembly::getLocalRotation ( ) const
inherited
Returns
- the assembly's rotation relative to its frame's parent frame.
const agx::AffineMatrix4x4& agxSDK::Assembly::getLocalTransform ( ) const
inherited
Returns
- the local transformation matrix of the assembly's frame, relative to the parent's frame.
virtual agx::Real agxSDK::LinkedStructure::getMass ( ) const
virtualinherited

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
virtual agx::Material* agxSDK::LinkedStructure::getMaterial ( ) const
virtualinherited
Returns
the material used for by the segments in this linked structure
agx::Name agxSDK::Assembly::getName ( ) const
inherited
Returns
the name of this Assembly
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.
const agx::ObserverFrame* agxSDK::Assembly::getObserverFrame ( const agx::Name &  name,
bool  recursive = true 
) const
inherited

Find (linear search) and return an ObserverFrame matching the given uuid.

Parameters
name- name of the ObserverFrame to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found ObserverFrame, null if not found
agx::ObserverFrame* agxSDK::Assembly::getObserverFrame ( const agx::Name &  name,
bool  recursive = true 
)
inherited

Find (linear search) and return an ObserverFrame matching the given uuid.

Parameters
name- name of the ObserverFrame to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found ObserverFrame, null if not found
const agx::ObserverFrame* agxSDK::Assembly::getObserverFrame ( const agx::Uuid &  uuid,
bool  recursive = true 
) const
inherited

Find (linear search) and return an ObserverFrame matching the given uuid.

Parameters
uuid- uuid of the ObserverFrame to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found ObserverFrame, null if not found
agx::ObserverFrame* agxSDK::Assembly::getObserverFrame ( const agx::Uuid &  uuid,
bool  recursive = true 
)
inherited

Find (linear search) and return an ObserverFrame matching the given uuid.

Parameters
uuid- uuid of the ObserverFrame to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found ObserverFrame, null if not found
const ObserverFrameRefSetVector& agxSDK::Assembly::getObserverFrames ( ) const
inherited
Returns
observers in this assembly (not tracing recursively into sub-assemblies)
Assembly* agxSDK::Assembly::getParent ( )
inherited
Returns
the parent assembly if this assembly is part of another assembly.
const Assembly* agxSDK::Assembly::getParent ( ) const
inherited
Returns
the parent assembly if this assembly is part of another assembly.
agx::Frame* agxSDK::Assembly::getParentFrame ( )
inherited
Returns
- the parent frame of the assembly's frame, or 0 if this frame has no parent
const agx::Frame* agxSDK::Assembly::getParentFrame ( ) const
inherited
Returns
- the parent frame of the assembly's frame, or 0 if this frame has no parent
const agxSDK::ParticleSystemRefSet& agxSDK::Assembly::getParticleSystems ( ) const
inherited
Returns
a const reference to the ParticleSystems in this Assembly (not tracing recursively into sub-assemblies)
agx::Real agxCable::Cable::getRadius ( ) const
Returns
The radius of this cable.
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
agx::Real agxCable::Cable::getResolution ( ) const

Returns the resolution of the cable, measured in units of length per segment.

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

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.

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

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

Returns
total volume of this linked structure
const agx::RigidBodyRefSet& agxSDK::Assembly::getRigidBodies ( ) const
inherited
Returns
a const reference to the RigidBodies in this Assembly (not tracing recursively into sub-assemblies)
agx::RigidBody* agxSDK::Assembly::getRigidBody ( const agx::Name &  name,
bool  recursive = true 
)
inherited

Find (linear search) and return named RigidBody.

Parameters
name- name of the body to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found RigidBody body, null if not found
const agx::RigidBody* agxSDK::Assembly::getRigidBody ( const agx::Name &  name,
bool  recursive = true 
) const
inherited

Find (linear search) and return named RigidBody.

Parameters
name- name of the body to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found RigidBody body, null if not found
agx::RigidBody* agxSDK::Assembly::getRigidBody ( const agx::Uuid &  uuid,
bool  recursive = true 
)
inherited

Find (linear search) and return a pointer to a RigidBody with the given uuid.

Parameters
uuid- uuid of the requested rigidbody
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found RigidBody, null if not found
const agx::RigidBody* agxSDK::Assembly::getRigidBody ( const agx::Uuid &  uuid,
bool  recursive = true 
) const
inherited

Find (linear search) and return a pointer to a RigidBody with the given uuid.

Parameters
uuid- uuid of the requested rigidbody
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found RigidBody, null if not found
agxCable::HomogeneousSegmentsRoute* agxCable::Cable::getRoute ( ) const
protected
Returns
The route defining the initial path of the cable.
LinkedSegment * agxSDK::LinkedStructure::getSegment ( agx::UInt  index) const
inlineprotectedinherited
Returns
segment given index

Definition at line 517 of file LinkedStructure.h.

References agxAssert, and agx::Container::size().

Referenced by agxVehicle::Track::getNode(), and agxSDK::LinkedStructure::getSegmentIterator().

template<typename ObjT >
LinkedSegment* agxSDK::LinkedStructure::getSegment ( const ObjT *  rb) const
protectedinherited
Returns
segment given rigid body
template<>
LinkedSegment* agxSDK::LinkedStructure::getSegment ( const agx::RigidBody *  rb) const
inlineinherited
agx::UInt agxSDK::LinkedStructure::getSegmentIndex ( const agx::RigidBody *  rb) const
inlineinherited
Returns
segment index if rigid body is a segment in this linked structure - otherwise agx::InvalidIndex

Definition at line 532 of file LinkedStructure.h.

References agxSDK::LinkedStructure::getData(), and agx::InvalidIndex.

Referenced by agxSDK::LinkedStructure::getSegment().

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

Definition at line 541 of file LinkedStructure.h.

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

Definition at line 547 of file LinkedStructure.h.

References agxSDK::LinkedSegmentIterator< T >::end(), and agxSDK::LinkedStructure::getSegment().

agxCable::SegmentRange agxCable::Cable::getSegments ( ) const
Returns
A range spanning over all the segments in this cable.
template<typename T >
LinkedSegmentRange< T > agxSDK::LinkedStructure::getSegments ( agx::UInt  beginIndex,
agx::UInt  endIndex 
) const
protectedinherited

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 511 of file LinkedStructure.h.

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

Definition at line 493 of file LinkedStructure.h.

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

agxSDK::Simulation* agxSDK::Assembly::getSimulation ( )
inherited
Returns
the simulation this assembly is added to. nullptr if none.
const agxSDK::Simulation* agxSDK::Assembly::getSimulation ( ) const
inherited
Returns
the simulation this assembly is added to. nullptr if none.
agxStream::StorageAgent* agxSDK::LinkedStructure::getStorageAgent ( ) const
inlineoverridevirtualinherited
Returns
the storage agent

Reimplemented from agxSDK::Assembly.

Reimplemented in agxVehicle::Track.

Definition at line 247 of file LinkedStructure.h.

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

Definition at line 469 of file LinkedStructure.h.

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

Definition at line 476 of file LinkedStructure.h.

Type agxSDK::Assembly::getType ( ) const
inherited
Returns
the type of this Assembly/Collection
virtual agx::UInt32 agxSDK::LinkedStructure::getUniqueId ( ) const
virtualinherited
Returns
the unique id of this linked structure
agx::Uuid agxStream::Serializable::getUuid ( ) const
inherited
Returns
a unique id for this instance.

Definition at line 268 of file Serializable.h.

virtual agx::Bool agxSDK::LinkedStructure::hasGroup ( agx::UInt32  id) const
virtualinherited
Returns
true if the id has been added to this linked structure - otherwise false
virtual agx::Bool agxSDK::LinkedStructure::hasGroup ( const agx::Name &  name) const
virtualinherited
Returns
true if the name has been added to this linked structure - otherwise false
template<typename T >
bool agx::Referenced::is ( ) const
inherited
bool agxStream::Serializable::isFinished ( ) const
inherited
Returns
true if this class is restored correctly and should not be deleted during destruction of an Archive.

Definition at line 252 of file Serializable.h.

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.

virtual void agxSDK::LinkedStructure::onGroupAdd ( const IdData &  group)
protectedvirtualinherited

Called when a new group has been added.

virtual void agxSDK::LinkedStructure::onGroupRemove ( const IdData &  group)
protectedvirtualinherited

Called when an existing group has been removed.

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

Called on simulation last step event - after user lastStep.

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

Called when a new material has been assigned.

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

Called on simulation post step event - after user postStep.

Reimplemented from agxSDK::LinkedStructure.

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

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

Reimplemented in agxVehicle::Track.

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

Called on simulation pre step event - after user preStep.

Reimplemented from agxSDK::LinkedStructure.

virtual void agxSDK::LinkedStructure::onRemoveNotification ( agxSDK::Simulation *  simulation)
protectedvirtualinherited

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

Reimplemented in agxVehicle::Track.

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

Called when collision state changed for given geometry.

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

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
void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.

This method should be used with care, always balanced with the same number of calls to unreference.

Referenced by agxData::Val< UInt >::Val().

bool agxSDK::Assembly::remove ( agx::Constraint *  constraint)
inherited

Remove a constraint from this assembly (does not recurse down in tree).

Returns
true when the constraint has been successfully removed - otherwise false (constraint is nullptr or not in this assembly)
bool agxSDK::Assembly::remove ( agx::Interaction *  interaction)
inherited

Remove an interaction from this assembly.

Returns
true when the interaction has been successfully removed - otherwise false (interaction is nullptr or not in this assembly)
bool agxSDK::Assembly::remove ( EventListener *  listener)
inherited

Remove an EventListener from the assembly.

Returns
true when the listener has been successfully removed - otherwise false (listener is nullptr or not in this assembly)
bool agxSDK::Assembly::remove ( agx::RigidBody *  body,
bool  removeAssociatedGeometries = false 
)
inherited

Remove a rigid body from this assembly (does not recurse down in tree).

Parameters
body- The body to be removed
removeAssociatedGeometries- If true, the geometries associated to this body will also be removed
Returns
true if the body been successfully removed
bool agxSDK::Assembly::remove ( agxCollide::Geometry *  geometry)
inherited

Remove a geometry from this assembly (does not recurse down in tree).

Returns
true when the geometry has been successfully removed - otherwise false (geometry is nullptr or not in this assembly)
bool agxSDK::Assembly::remove ( Assembly *  assembly)
inherited

Remove a child assembly from a parent.

Returns
true when the assembly has been successfully removed - otherwise false (assembly is nullptr or not in this assembly)
bool agxSDK::Assembly::remove ( agx::ContactMaterial *  contactMaterial)
inherited

Remove a contact material from this assembly.

Returns
true when the contact material has been successfully removed - otherwise false (contact material is nullptr or not in this assembly)
bool agxSDK::Assembly::remove ( agx::Emitter *  emitter)
inherited

Remove an emitter from this assembly.

Returns
true when the emitter has been successfully removed - otherwise false (emitter is nullptr or not in this assembly)
bool agxSDK::Assembly::remove ( agx::ObserverFrame *  observerFrame)
inherited

Remove an ObserverFrame from this assembly.

Returns
true when the observer frame has been successfully removed - otherwise false (observer frame is nullptr or not in this assembly)
virtual agx::Bool agxSDK::LinkedStructure::removeComponent ( agxSDK::LinkedStructureComponent *  component)
virtualinherited

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)
void agxSDK::Assembly::removeFromSimulation ( Simulation *  simulation)
protectedinherited
virtual void agxSDK::LinkedStructure::removeGroup ( agx::UInt32  id)
virtualinherited

Remove group id from all segments in this linked structure.

Parameters
id- id to remove
virtual void agxSDK::LinkedStructure::removeGroup ( const agx::Name &  name)
virtualinherited

Remove group name from all segments in this linked structure.

Parameters
name- name to remove
void agxSDK::LinkedStructure::removeNotification ( agxSDK::Simulation *  simulation)
finaloverridevirtualinherited

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.

virtual void agxSDK::Assembly::removeNotification ( Assembly *  )
inlinevirtualinherited

Called when this assembly is removed from another assembly.

Reimplemented in agxPowerLine::PowerLine.

Definition at line 594 of file Assembly.h.

bool agxSDK::Assembly::removeParticleSystem ( agx::ParticleSystem *  particleSystem)
protectedinherited

Remove a particle system from this assembly.

virtual void agxSDK::LinkedStructure::restore ( agxStream::InputArchive &  in)
overridevirtualinherited

Reimplemented from agxSDK::Assembly.

Reimplemented in agxVehicle::Track.

agxSDK::LinkedSegmentRange<agxSDK::LinkedSegment> agxSDK::LinkedStructure::segments ( )
inherited
Returns
A segment range over all segments in this LinkedStructure.
virtual void agxSDK::Assembly::setAngularVelocity ( const agx::Vec3 &  velocity)
virtualinherited

Set the angular velocity (in world frame) recursively for all rigid bodies stored in assembly.

Parameters
velocity- The angular velocity in world frame that will be set for all rigid bodies.
virtual void agxSDK::LinkedStructure::setAngularVelocityDamping ( const agx::Vec3 &  angularVelocityDamping)
virtualinherited

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

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

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

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
virtual void agxSDK::LinkedStructure::setEnableCollisions ( agxCollide::Geometry *  geometry,
agx::Bool  enable 
)
virtualinherited

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
void agxStream::Serializable::setEnableSerialization ( bool  flag)
inherited

Set to false to disable serialization of this object.

It will just be ignored during serialization (writing). It is still possible to restore TO this object.

static void agxStream::Serializable::setEnableUuidGeneration ( bool  flag)
staticinherited

Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.

void agxStream::Serializable::setFinished ( )
inherited

Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.

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

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))
void agxSDK::Assembly::setLocalPosition ( const agx::Vec3 &  p)
inherited

Set the position of the assembly relative to its frame's parent frame.

Parameters
p- local translate of assembly as a 3D vector
void agxSDK::Assembly::setLocalPosition ( agx::Real  x,
agx::Real  y,
agx::Real  z 
)
inherited

Set the position of the assembly relative to its frame's parent frame.

Parameters
x- local x translate
y- local y translate
z- local z translate
void agxSDK::Assembly::setLocalRotation ( const agx::Quat &  q)
inherited

Set the rotation of the assembly relative to its frame's parent frame.

Parameters
q- rotation given as a quaternion
void agxSDK::Assembly::setLocalRotation ( const agx::EulerAngles &  e)
inherited

Set the rotation of the assembly relative to its frame's parent frame.

Parameters
e- rotation given as Euler angles
void agxSDK::Assembly::setLocalTransform ( const agx::AffineMatrix4x4 &  matrix)
inherited

Assign the local transformation matrix for this assembly, ignoring any eventual parent transformation.

Parameters
matrix- transformation matrix relative to parent transform for the assembly's frame
virtual void agxSDK::LinkedStructure::setMaterial ( agx::Material *  material)
virtualinherited

Assign material to all segments in this linked structure.

Parameters
material- material for the segments
void agxSDK::Assembly::setName ( const agx::Name &  name)
inherited

Set the name of this Assembly.

Parameters
name- new name of this Assembly.
bool agxSDK::Assembly::setParentFrame ( agx::Frame *  frame)
inherited

Set the parent frame of this assembly's frame.

This means that getLocalTranslate, getLocalRotate, getLocalTransform will be given in the parents coordinate frame. I.e., this frame's transformation will be concatenated with the parents.

Parameters
frame- new parent frame, 0 to remove parent
Returns
true if parent is changed (not the same as before) - otherwise false
void agxSDK::Assembly::setPosition ( const agx::Vec3 &  p)
inherited

Set the position of the frame in world coordinates.

Parameters
p- desired position in world coordinates.
void agxSDK::Assembly::setPosition ( agx::Real  x,
agx::Real  y,
agx::Real  z 
)
inherited

Set the position of the frame in world coordinates.

Parameters
x- desired x-coordinate in world frame
y- desired y-coordinate in world frame
z- desired z-coordinate in world frame
void agxSDK::Assembly::setRotation ( const agx::Quat &  q)
inherited

Set the rotation of the assembly relative to world frame.

Parameters
q- rotation given as a quaternion
void agxSDK::Assembly::setRotation ( const agx::EulerAngles &  e)
inherited

Set the rotation of the assembly relative to world frame.

Parameters
e- rotation given as Euler angles
void agxSDK::Assembly::setRotation ( const agx::OrthoMatrix3x3 &  m)
inherited

Set the rotation of the assembly relative to world frame.

Parameters
m- rotation given as an orthogonal transformation matrix
void agxSDK::Assembly::setTransform ( const agx::AffineMatrix4x4 &  matrix)
inherited

Set the transform of the assembly.

Its frame will move to the specified transform, which is given in world coordinates.

Parameters
matrix- desired transform for the frame in world coordinates.
void agxStream::Serializable::setUuid ( const agx::Uuid &  uuid)
inherited

Explicitly set a Uuid on a serializable object.

Use this method with great care, as it can result in non-unique identifiers in the system!

virtual void agxSDK::Assembly::setVelocity ( const agx::Vec3 &  velocity)
virtualinherited

Set the linear velocity (in world frame) recursively for all rigid bodies stored in assembly.

Parameters
velocity- The linear velocity in world frame that will be set for all rigid bodies.
virtual void agxSDK::LinkedStructure::store ( agxStream::OutputArchive &  out) const
overridevirtualinherited

Reimplemented from agxSDK::Assembly.

Reimplemented in agxVehicle::Track.

virtual void agxSDK::Assembly::traverse ( AssemblyVisitor *  visitor)
virtualinherited

Traverse the assembly tree recursively using a visitor.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

virtual void agxSDK::Assembly::traverse ( const AssemblyVisitor *  visitor) const
virtualinherited
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.
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.

void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

This method should be used with care, always balanced with the same number of calls to reference.

void agx::Referenced::unreference_nodelete ( ) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.


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