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

#include <Tree.h>

+ Inheritance diagram for agxOSG::Tree:

Public Types

typedef
BranchContainer::const_iterator 
BranchConstIterator
 
typedef agx::Vector< BranchRef > BranchContainer
 
typedef agx::ref_ptr
< BranchEventListener > 
BranchEventListenerRef
 
typedef BranchContainer::iterator BranchIterator
 
typedef agx::observer_ptr< Branch > BranchObs
 
typedef agx::ref_ptr< Branch > BranchRef
 
typedef agx::HashVector
< agxCollide::Geometry
*, agx::observer_ptr
< agxCollide::Geometry > > 
DisabledCollisionsGeometryContainer
 
typedef agx::SetVector
< agx::UInt32 > 
GroupIdContainer
 
enum  State { INITIALIZED = (1<<0), STATIC = (1<<1), WAKE_ON_CONTACT = (1<<2) }
 
typedef agx::ref_ptr
< TreeExecuteFilter > 
TreeExecuteFilterRef
 
enum  Type { ASSEMBLY, COLLECTION }
 Specifies the type an assembly is. More...
 

Public Member Functions

 Tree (osg::Group *root)
 
bool add (agx::Constraint *constraint)
 Add a constraint to the assembly. 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...
 
bool addGroupID (agx::UInt32 id)
 Add group id to all geometries in this tree. 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
 
virtual bool attach (agx::RigidBody *rb, agx::Frame *frame)
 Attach bottom branch to an object given attachment frame. More...
 
virtual void clear ()
 Remove all branches from this tree. More...
 
virtual Tree * cut (agxCollide::Geometry *geometry, const agx::Vec3 &point, agx::Real minShapeHeight=agx::Real(1E-2))
 Cut geometry (only one shape per geometry supported) given point in world and minimum shape height, after cut. More...
 
virtual Tree * cut (agxModel::Tree::Branch *branch)
 Cut at branch and get a new tree. More...
 
Branch * findBranch (const agx::RigidBody *rb) const
 Search the tree for rigid body rb. More...
 
Branch * findBranch (const agxModel::Tree::Branch *fromBranch, const agx::RigidBody *rb) const
 Search the tree for rigid body rb given start branch (i.e., whole tree if root). More...
 
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...
 
agxModel::Tree::BranchEventListener * getBranchEventListener () const
 
const char * getClassName () const override
 
const agx::Vec4 getColor () 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
 
agx::Referenced * getCustomData () const
 
const agx::EmitterRefSet & getEmitters () const
 
bool getEnableCollisions (const agx::RigidBody *rb) const
 
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...
 
const InteractionRefSetVector & getInteractions () const
 
agx::Vec3 getLocalPosition () const
 
agx::Quat getLocalRotation () const
 
const agx::AffineMatrix4x4 & getLocalTransform () const
 
agx::Material * getMaterial () const
 
agx::Name getName () const
 
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
 
int getReferenceCount () const
 
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...
 
Branch * getRoot () const
 
agxSDK::Simulation * getSimulation ()
 
const agxSDK::Simulation * getSimulation () const
 
agxStream::StorageAgent * getStorageAgent () const override
 
Type getType () const
 
agx::Uuid getUuid () const
 
bool hasGroupID (agx::UInt32 id) const
 
virtual bool initialize ()
 Explicit call to this method to check return value. More...
 
bool initialized () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
bool isFinished () const
 
bool isStatic () const
 
bool makeDynamic ()
 Make all rigid bodies dynamic and add all constraints to the simulation. More...
 
bool makeStatic (bool wakeOnContactEvent, agxModel::Tree::TreeExecuteFilter *filter=new agxModel::Tree::TreeExecuteFilter())
 Simplify this tree. 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...
 
bool removeGroupID (agx::UInt32 id)
 Removes group id from all geometries in this tree. More...
 
virtual void removeNotification (Assembly *)
 Called when this assembly is removed from another assembly. More...
 
virtual void restore (agxStream::InputArchive &in) override
 
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 setBranchEventListener (agxModel::Tree::BranchEventListener *branchListener)
 Assign branch event listener. More...
 
void setColor (const agx::Vec4 &color)
 Assign color to this tree. More...
 
virtual void setConstraintSolveType (agx::Constraint::SolveType solveType)
 Set new solve type for the branch connections. More...
 
void setCustomData (agx::Referenced *customData)
 Assign custom data. More...
 
bool setEnableCollisions (agx::RigidBody *rb, bool flag)
 Enable or disable collisions between this tree and a rigid body. More...
 
bool setEnableCollisions (agxCollide::Geometry *geometry, bool flag)
 Enable or disable collisions between this tree and a geometry. 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...
 
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 new material. 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 Branch * split (agxCollide::Geometry *geometry, const agx::Vec3 &point, agx::Real minShapeHeight=agx::Real(1E-2))
 Splits this tree given geometry and point in world. 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
 
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...
 
bool wakeOnContact () const
 

Static Public Member Functions

static Assembly * asAssembly (agxStream::Serializable *obj)
 
static agxStream::Serializable * create ()
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static const char * getConstructClassId ()
 
static void setAngularVelocityDamping (agxModel::Tree::Branch *branch, const agx::Vec3 &angularVelocityDamping)
 Utility method to set angular velocity damping for all branches. More...
 
static void setDefaultParameters (agx::Material *material)
 Sets default material parameters for a tree. More...
 
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More...
 
static void setLinearVelocityDamping (agxModel::Tree::Branch *branch, const agx::Vec3 &linearVelocityDamping)
 Utility method to set linear velocity damping for all branches. More...
 
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Types

typedef agx::ref_ptr
< TreeContactEventListener > 
TreeContactEventListenerRef
 
typedef agx::ref_ptr
< TreeStepEventListener > 
TreeStepEventListenerRef
 

Protected Member Functions

 Tree ()
 Use agxModel::Tree instead if you intend to use this constructor. More...
 
virtual ~Tree ()
 
void add (Branch *branch)
 Adds rigid body, constraint etc to this tree. More...
 
void addGroupID (Branch *branch, agx::UInt32 id)
 Adds the id to the branch geometries. More...
 
virtual void addNotification (agxSDK::Simulation *simulation)
 Called when this assembly is added to a simulation (given that it not already is in the simulation). More...
 
bool addParticleSystem (agx::ParticleSystem *particleSystem)
 Add a particle system to this assembly. More...
 
void addToSimulation (Simulation *simulation)
 
void allocateObserverVector () const
 
virtual void checkLoad (Branch *branch)
 Checks current load. More...
 
virtual Tree * clone ()
 Clone call when new tree is needed from internal methods. More...
 
void configure (Branch *branch)
 Traverse this tree and configures the branches. More...
 
void copyParameters (const Branch *source, Branch *destination) const
 Copy branch parameters from source to destination. More...
 
void copyParameters (const agx::Constraint *source, agx::Constraint *destination) const
 Copy constraint parameters from source to destination. More...
 
void deleteUsingDeleteHandler () const
 
void generateUuid ()
 
Branch * guessConnectingChild (Branch *branch) const
 Searches branch children and examines orientation etc to "guess" which of the children that is along the main/current tree branch. More...
 
virtual void post ()
 Post step event callback. More...
 
virtual void pre ()
 Pre event callback. More...
 
virtual void preCollide ()
 Pre-collide event callback. More...
 
void remove (Branch *branch)
 Removes rigid body, constraint etc associated to this tree. More...
 
void removeFromSimulation (Simulation *simulation)
 
void removeGroupID (Branch *branch, agx::UInt32 id)
 Removes the id from the branch geometries. More...
 
virtual void removeNotification (agxSDK::Simulation *simulation)
 Called when this assembly is removed from a simulation. More...
 
bool removeParticleSystem (agx::ParticleSystem *particleSystem)
 Remove a particle system from this assembly. More...
 
void setConstraintSolveType (Branch *branch, agx::Constraint::SolveType solveType)
 Assign constraint solve type. More...
 
void setMaterial (Branch *branch, agx::Material *material)
 Assign material to all geometries for branch. More...
 
void simplify (Branch *branch, bool flag, agxSDK::Simulation *simulation)
 Changes motion control and adds/removes constraints depending on flag. More...
 
void split (Branch *source, Branch *destination) const
 Move from source to destination. More...
 

Static Protected Member Functions

static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Protected Attributes

BranchEventListenerRef m_branchListener
 
agx::ref_ptr< agx::Referenced > m_customData
 
agx::UInt32 m_disabledCollisionsID
 
DisabledCollisionsGeometryContainer m_externalDisabledGeometries
 
agx::UInt32 m_geometriesID
 
GroupIdContainer m_geometryIDs
 
osg::observer_ptr< osg::Group > m_graphicsRoot
 
agx::MaterialRef m_material
 
Mutex m_mutex
 
AtomicValue m_refCount
 
TreeRendererRef m_renderer
 
BranchRef m_root
 
int m_state
 
TreeStepEventListenerRef m_stepListener
 
TreeContactEventListenerRef m_wakeOnContactListener
 

Detailed Description

Definition at line 56 of file agxOSG/Tree.h.

Member Typedef Documentation

Definition at line 45 of file agxModel/Tree.h.

Definition at line 46 of file agxModel/Tree.h.

Definition at line 44 of file agxModel/Tree.h.

Definition at line 41 of file agxModel/Tree.h.

Definition at line 49 of file agxModel/Tree.h.

Definition at line 738 of file agxModel/Tree.h.

Member Enumeration Documentation

enum agxModel::Tree::State
inherited
Enumerator
INITIALIZED 
STATIC 
WAKE_ON_CONTACT 

Definition at line 347 of file agxModel/Tree.h.

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

agxOSG::Tree::Tree ( osg::Group *  root)
virtual agxOSG::Tree::~Tree ( )
inlineprotectedvirtual

Reimplemented from agxModel::Tree.

Definition at line 73 of file agxOSG/Tree.h.

agxOSG::Tree::Tree ( )
inlineprotected

Use agxModel::Tree instead if you intend to use this constructor.

Definition at line 78 of file agxOSG/Tree.h.

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)
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 agxModel::Tree::add ( Branch *  branch)
protectedinherited

Adds rigid body, constraint etc to this tree.

Recursive.

Parameters
branch- branch with rigid body and constraint to add
bool agxModel::Tree::addGroupID ( agx::UInt32  id)
inherited

Add group id to all geometries in this tree.

Parameters
id- id to add to all geometries in this tree
Returns
true if valid add
void agxModel::Tree::addGroupID ( Branch *  branch,
agx::UInt32  id 
)
protectedinherited

Adds the id to the branch geometries.

Recursive.

Parameters
branch- current branch
id- id to add
virtual void agxOSG::Tree::addNotification ( agxSDK::Simulation *  )
protectedvirtual

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

Reimplemented from agxModel::Tree.

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.

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
virtual bool agxModel::Tree::attach ( agx::RigidBody *  rb,
agx::Frame *  frame 
)
virtualinherited

Attach bottom branch to an object given attachment frame.

Make sure this tree has the correct transform when calling this method.

Parameters
rb- attach to rigid body (if 0, attached to world)
frame- attachment frame, will be calculated in this method (invalid if 0)
Returns
true if attach is successful - otherwise false (not initialized, frame = 0, root->getNumBranches() = 0)
virtual void agxModel::Tree::checkLoad ( Branch *  branch)
protectedvirtualinherited

Checks current load.

If it exceeds the maximum load an event is fired. Recursive.

Parameters
branch- current branch
virtual void agxModel::Tree::clear ( )
virtualinherited

Remove all branches from this tree.

Reimplemented in agxModel::Deformable1D.

virtual Tree* agxOSG::Tree::clone ( )
protectedvirtual

Clone call when new tree is needed from internal methods.

Implement this if when you have your own implementation of this tree class.

Returns
new tree

Reimplemented from agxModel::Tree.

void agxModel::Tree::configure ( Branch *  branch)
protectedinherited

Traverse this tree and configures the branches.

Recursive.

Parameters
branch- current branch
void agxModel::Tree::copyParameters ( const Branch *  source,
Branch *  destination 
) const
protectedinherited

Copy branch parameters from source to destination.

void agxModel::Tree::copyParameters ( const agx::Constraint *  source,
agx::Constraint *  destination 
) const
protectedinherited

Copy constraint parameters from source to destination.

static agxStream::Serializable* agxSDK::Assembly::create ( )
inlinestaticinherited

Definition at line 639 of file Assembly.h.

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

Definition at line 639 of file Assembly.h.

virtual Tree* agxModel::Tree::cut ( agxCollide::Geometry *  geometry,
const agx::Vec3 &  point,
agx::Real  minShapeHeight = agx::Real(1E-2) 
)
virtualinherited

Cut geometry (only one shape per geometry supported) given point in world and minimum shape height, after cut.

If cut is too close to the shape ends (minShapeHeight), the cut is made between two geometries or directly at a branch connection.

This method first splits this tree (see split method) and later cuts given the branch returned from split.

Note
Split and cut assumes that the geometries in a branch are ordered in position with first geometry furthest down in branch body coordinates.
Parameters
geometry- geometry to cut (only one shape per geometry supported)
point- point in world
minShapeHeight- resulting geometry/shape minimum height (default: 1 cm)
Returns
new tree "above" branch with geometry geometry
virtual Tree* agxModel::Tree::cut ( agxModel::Tree::Branch *  branch)
virtualinherited

Cut at branch and get a new tree.

Branch branch will be member (first child of root) in the new tree.

Parameters
branch- cut position in tree
Returns
new tree
void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
Branch* agxModel::Tree::findBranch ( const agx::RigidBody *  rb) const
inherited

Search the tree for rigid body rb.

Parameters
rb- rigid body to search for
Returns
branch with rigid body rb (0 if not found)
Branch* agxModel::Tree::findBranch ( const agxModel::Tree::Branch *  fromBranch,
const agx::RigidBody *  rb 
) const
inherited

Search the tree for rigid body rb given start branch (i.e., whole tree if root).

Recursive.

Parameters
fromBranch- branch to start from
rb- rigid body to search for
Returns
branch with rigid body rb (0 if not found)
void agxStream::Serializable::generateUuid ( )
protectedinherited
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
agxModel::Tree::BranchEventListener* agxModel::Tree::getBranchEventListener ( ) const
inherited
Returns
the branch event listener assigned to this tree - 0 if none
const char* agxSDK::Assembly::getClassName ( ) const
inlineoverridevirtualinherited
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

Reimplemented in agxWire::WireSimpleDrumController, agxVehicle::Track, agxSDK::LinkedStructure, and agxSDK::Collection.

Definition at line 639 of file Assembly.h.

const agx::Vec4 agxOSG::Tree::getColor ( ) const
inline
Returns
color of the tree

Definition at line 70 of file agxOSG/Tree.h.

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::Assembly::getConstructClassId ( )
inlinestaticinherited

Definition at line 639 of file Assembly.h.

agx::Referenced* agxModel::Tree::getCustomData ( ) const
inherited
Returns
any custom data assigned to this tree
static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
const agx::EmitterRefSet& agxSDK::Assembly::getEmitters ( ) const
inherited
Returns
a const reference to the Emitters in this Assembly (not tracing recursively into sub-assemblies)
bool agxModel::Tree::getEnableCollisions ( const agx::RigidBody *  rb) const
inherited
Returns
true if collisions is enabled between this tree and all geometries in rb
bool agxModel::Tree::getEnableCollisions ( const agxCollide::Geometry *  geometry) const
inherited
Returns
true if collisions is enabled between this tree and geometry
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.

const InteractionRefSetVector& agxSDK::Assembly::getInteractions ( ) const
inherited
Returns
interactions in this assembly (not tracing recursively into sub-assemblies)
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.
agx::Material* agxModel::Tree::getMaterial ( ) const
inherited
Returns
current material
agx::Name agxSDK::Assembly::getName ( ) const
inherited
Returns
the name of this Assembly
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)
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
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
Branch* agxModel::Tree::getRoot ( ) const
inherited
Returns
the root branch (created with this tree)
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::Assembly::getStorageAgent ( ) const
inlineoverridevirtualinherited
Returns
the storage agent

Implements agxStream::Serializable.

Reimplemented in agxWire::WireSimpleDrumController, agxVehicle::Track, agxSDK::LinkedStructure, and agxSDK::Collection.

Definition at line 639 of file Assembly.h.

Type agxSDK::Assembly::getType ( ) const
inherited
Returns
the type of this Assembly/Collection
agx::Uuid agxStream::Serializable::getUuid ( ) const
inherited
Returns
a unique id for this instance.

Definition at line 268 of file Serializable.h.

Branch* agxModel::Tree::guessConnectingChild ( Branch *  branch) const
protectedinherited

Searches branch children and examines orientation etc to "guess" which of the children that is along the main/current tree branch.

bool agxModel::Tree::hasGroupID ( agx::UInt32  id) const
inherited
Returns
true if this tree has id
virtual bool agxModel::Tree::initialize ( )
virtualinherited

Explicit call to this method to check return value.

This tree will initialize it self when added to a simulation.

Returns
true if initialize procedure was successful - otherwise false

Reimplemented in agxModel::Deformable1D.

bool agxModel::Tree::initialized ( ) const
inherited
Returns
true if this tree is initialized - 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.

bool agxModel::Tree::isStatic ( ) const
inherited
Returns
true if this tree is simplified - otherwise false
bool agxModel::Tree::makeDynamic ( )
inherited

Make all rigid bodies dynamic and add all constraints to the simulation.

This is the default state.

Returns
true if the state was changed
bool agxModel::Tree::makeStatic ( bool  wakeOnContactEvent,
agxModel::Tree::TreeExecuteFilter *  filter = new agxModel::Tree::TreeExecuteFilter() 
)
inherited

Simplify this tree.

Make all rigid bodies static and remove all constraints from the simulation. It's possible to flag if this tree should wake on contact with other objects. If a contact wakes this tree, it will not automatically become static again. This has to be monitored by the user.

Default contact execute filter will trigger on all other contacts with this tree's geometries.

Parameters
wakeOnContactEvent- true to enable this tree to wake up upon contact
filter- default all contacts with this tree
Returns
true if the state was changed
virtual void agxModel::Tree::post ( )
protectedvirtualinherited

Post step event callback.

Check max load and fire events.

Reimplemented in agxModel::Deformable1D.

virtual void agxModel::Tree::pre ( )
protectedvirtualinherited

Pre event callback.

Reimplemented in agxModel::Deformable1D.

virtual void agxModel::Tree::preCollide ( )
protectedvirtualinherited

Pre-collide event callback.

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)
void agxModel::Tree::remove ( Branch *  branch)
protectedinherited

Removes rigid body, constraint etc associated to this tree.

Recursive.

void agxSDK::Assembly::removeFromSimulation ( Simulation *  simulation)
protectedinherited
bool agxModel::Tree::removeGroupID ( agx::UInt32  id)
inherited

Removes group id from all geometries in this tree.

Parameters
id- id to remove
Returns
true if valid remove
void agxModel::Tree::removeGroupID ( Branch *  branch,
agx::UInt32  id 
)
protectedinherited

Removes the id from the branch geometries.

Recursive.

Parameters
branch- current branch
id- id to remove
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.

virtual void agxModel::Tree::removeNotification ( agxSDK::Simulation *  )
protectedvirtualinherited

Called when this assembly is removed from a simulation.

Reimplemented from agxSDK::Assembly.

Reimplemented in agxModel::Deformable1D.

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

Remove a particle system from this assembly.

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.
static void agxModel::Tree::setAngularVelocityDamping ( agxModel::Tree::Branch *  branch,
const agx::Vec3 &  angularVelocityDamping 
)
staticinherited

Utility method to set angular velocity damping for all branches.

I.g., Tree::setAngularVelocityDamping( aTree->getRoot(), angDamping ). Recursive.

Note
Only utility method, i.e., a tree does NOT store or keep track of damping information.
Parameters
branch- start branch
angularVelocityDamping- angular velocity damping
virtual void agxModel::Tree::setBranchEventListener ( agxModel::Tree::BranchEventListener *  branchListener)
virtualinherited

Assign branch event listener.

Unique for this tree.

Parameters
branchListener- new listener unique for this tree
void agxOSG::Tree::setColor ( const agx::Vec4 &  color)
inline

Assign color to this tree.

Default color is white.

Parameters
color- new color

Definition at line 65 of file agxOSG/Tree.h.

virtual void agxModel::Tree::setConstraintSolveType ( agx::Constraint::SolveType  solveType)
virtualinherited

Set new solve type for the branch connections.

Only valid for initialized trees. Default: DIREKT_AND_ITERATIVE.

Parameters
solveTypenew solve type
void agxModel::Tree::setConstraintSolveType ( Branch *  branch,
agx::Constraint::SolveType  solveType 
)
protectedinherited

Assign constraint solve type.

Recursive.

Parameters
branch- current branch
solveType- new constraint solve type
void agxModel::Tree::setCustomData ( agx::Referenced *  customData)
inherited

Assign custom data.

Parameters
customData- custom data
static void agxModel::Tree::setDefaultParameters ( agx::Material *  material)
staticinherited

Sets default material parameters for a tree.

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

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

bool agxModel::Tree::setEnableCollisions ( agx::RigidBody *  rb,
bool  flag 
)
inherited

Enable or disable collisions between this tree and a rigid body.

Parameters
rb- rigid body
flag- true to enable, false to disable
Returns
true if collision flag was set - otherwise false
bool agxModel::Tree::setEnableCollisions ( agxCollide::Geometry *  geometry,
bool  flag 
)
inherited

Enable or disable collisions between this tree and a geometry.

Parameters
geometry- the geometry
flag- true to enable, false to disable
Returns
true if collision flag was set - otherwise false
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.

static void agxModel::Tree::setLinearVelocityDamping ( agxModel::Tree::Branch *  branch,
const agx::Vec3 &  linearVelocityDamping 
)
staticinherited

Utility method to set linear velocity damping for all branches.

I.e., Tree::setLinearVelocityDamping( aTree->getRoot(), linDamping ). Recursive.

Note
Only utility method, i.e., a tree does NOT store or keep track of damping information.
Parameters
branch- start branch
linearVelocityDamping- linear velocity damping
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 agxModel::Tree::setMaterial ( agx::Material *  material)
virtualinherited

Assign new material.

All geometries in this tree will have this material.

Parameters
material- new material
void agxModel::Tree::setMaterial ( Branch *  branch,
agx::Material *  material 
)
protectedinherited

Assign material to all geometries for branch.

Recursive.

Parameters
branch- current branch
material- new material
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.
void agxModel::Tree::simplify ( Branch *  branch,
bool  flag,
agxSDK::Simulation *  simulation 
)
protectedinherited

Changes motion control and adds/removes constraints depending on flag.

Recursive.

Parameters
branch- current branch
flag- true for STATIC and remove
virtual Branch* agxModel::Tree::split ( agxCollide::Geometry *  geometry,
const agx::Vec3 &  point,
agx::Real  minShapeHeight = agx::Real(1E-2) 
)
virtualinherited

Splits this tree given geometry and point in world.

During this split a new branch is created and will be child to branch the geometry belongs to. Parameters are inherited from the old branch.

With minShapeHeight it's possible to control how the split is made. If the split results in a shape with height less than that, the split will take place between two geometries (if present) or returns 0 if the split is too close to a branch connection (i.e., split unnecessary).

Note
Split and cut assumes that the geometries in a branch are ordered in position with first geometry furthest down in branch body coordinates.
Parameters
geometry- geometry to split (only one shape per geometry supported)
point- point in world
minShapeHeight- resulting geometry/shape minimum height (default: 1 cm)
Returns
the new branch which is a child branch to the one holding geometry
void agxModel::Tree::split ( Branch *  source,
Branch *  destination 
) const
protectedinherited

Move from source to destination.

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
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
bool agxModel::Tree::wakeOnContact ( ) const
inherited
Returns
true if this tree should wake on contact in state STATIC

Member Data Documentation

BranchEventListenerRef agxModel::Tree::m_branchListener
protectedinherited

Definition at line 749 of file agxModel/Tree.h.

agx::ref_ptr< agx::Referenced > agxModel::Tree::m_customData
protectedinherited

Definition at line 747 of file agxModel/Tree.h.

agx::UInt32 agxModel::Tree::m_disabledCollisionsID
protectedinherited

Definition at line 744 of file agxModel/Tree.h.

DisabledCollisionsGeometryContainer agxModel::Tree::m_externalDisabledGeometries
protectedinherited

Definition at line 745 of file agxModel/Tree.h.

agx::UInt32 agxModel::Tree::m_geometriesID
protectedinherited

Definition at line 743 of file agxModel/Tree.h.

GroupIdContainer agxModel::Tree::m_geometryIDs
protectedinherited

Definition at line 746 of file agxModel/Tree.h.

osg::observer_ptr< osg::Group > agxOSG::Tree::m_graphicsRoot
protected

Definition at line 87 of file agxOSG/Tree.h.

agx::MaterialRef agxModel::Tree::m_material
protectedinherited

Definition at line 748 of file agxModel/Tree.h.

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.

TreeRendererRef agxOSG::Tree::m_renderer
protected

Definition at line 86 of file agxOSG/Tree.h.

BranchRef agxModel::Tree::m_root
protectedinherited

Definition at line 741 of file agxModel/Tree.h.

int agxModel::Tree::m_state
protectedinherited

Definition at line 742 of file agxModel/Tree.h.

TreeStepEventListenerRef agxModel::Tree::m_stepListener
protectedinherited

Definition at line 751 of file agxModel/Tree.h.

TreeContactEventListenerRef agxModel::Tree::m_wakeOnContactListener
protectedinherited

Definition at line 750 of file agxModel/Tree.h.


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