|
AGXDynamics
2.31.1.0
|
Tree is a structure of Branch objects in a mathematical Tree structure where a Branch can have several children Branches an so forth. More...
#include <Tree.h>
Inheritance diagram for agxModel::Tree:Classes | |
| class | Branch |
| Branch is a part of the Tree, with a body and a constraint to its parent. More... | |
| class | BranchEventListener |
| BranchEventListener handles certain events happening to a Tree. More... | |
| class | TreeContactEventListener |
| class | TreeExecuteFilter |
| TreeExecuteFilter allows to catch contacts with the Tree. More... | |
| class | TreeStepEventListener |
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 () | |
| Default constructor. More... | |
| 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 * | clone () |
| Clone call when new tree is needed from internal methods. 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::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... | |
| 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 (agxModel::Tree::Branch *root) | |
| 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... | |
| 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... | |
Tree is a structure of Branch objects in a mathematical Tree structure where a Branch can have several children Branches an so forth.
Tree holds functions to cut, split and in other ways change the Tree structure.
Definition at line 38 of file agxModel/Tree.h.
Definition at line 47 of file agxModel/Tree.h.
| typedef agx::Vector< BranchRef > agxModel::Tree::BranchContainer |
Definition at line 45 of file agxModel/Tree.h.
Definition at line 307 of file agxModel/Tree.h.
Definition at line 46 of file agxModel/Tree.h.
| typedef agx::observer_ptr< Branch > agxModel::Tree::BranchObs |
Definition at line 44 of file agxModel/Tree.h.
| typedef agx::ref_ptr< Branch > agxModel::Tree::BranchRef |
Definition at line 41 of file agxModel/Tree.h.
| typedef agx::HashVector< agxCollide::Geometry*, agx::observer_ptr< agxCollide::Geometry > > agxModel::Tree::DisabledCollisionsGeometryContainer |
Definition at line 48 of file agxModel/Tree.h.
Definition at line 49 of file agxModel/Tree.h.
|
protected |
Definition at line 719 of file agxModel/Tree.h.
Definition at line 345 of file agxModel/Tree.h.
|
protected |
Definition at line 738 of file agxModel/Tree.h.
| Enumerator | |
|---|---|
| INITIALIZED | |
| STATIC | |
| WAKE_ON_CONTACT | |
Definition at line 347 of file agxModel/Tree.h.
|
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.
| agxModel::Tree::Tree | ( | ) |
Default constructor.
|
protected |
|
protectedvirtual |
Reimplemented in agxOSG::Tree.
|
inherited |
Add a constraint to the assembly.
|
inherited |
Add an interaction to this assembly.
|
inherited |
Add a listener to the assembly.
|
inherited |
Add a rigid body to the assembly.
|
inherited |
Add a geometry to the assembly.
|
inherited |
Add another assembly as child to this assembly.
|
inherited |
Add a contact material to this assembly.
|
inherited |
Add an emitter to this assembly.
|
inherited |
Add an ObserverFrame to this assembly.
|
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.
Adds rigid body, constraint etc to this tree.
Recursive.
| branch | - branch with rigid body and constraint to add |
| bool agxModel::Tree::addGroupID | ( | agx::UInt32 | id | ) |
Add group id to all geometries in this tree.
| id | - id to add to all geometries in this tree |
|
protected |
Adds the id to the branch geometries.
Recursive.
| branch | - current branch |
| id | - id to add |
Called when this assembly is added to another assembly.
Reimplemented in agxPowerLine::PowerLine.
Definition at line 589 of file Assembly.h.
|
protectedvirtual |
Called when this assembly is added to a simulation (given that it not already is in the simulation).
Reimplemented from agxSDK::Assembly.
Reimplemented in agxOSG::Tree.
Referenced by agxOSG::Tree::Tree().
|
protectedinherited |
Add a particle system to this assembly.
ParticleSystems should only be added to Collections.
|
protectedinherited |
|
protectedinherited |
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), agx::InternalData::getOrCreate(), and agx::InternalData::hasData().
|
inherited |
|
inlinestaticinherited |
Definition at line 636 of file Assembly.h.
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
|
virtual |
Attach bottom branch to an object given attachment frame.
Make sure this tree has the correct transform when calling this method.
| rb | - attach to rigid body (if 0, attached to world) |
| frame | - attachment frame, will be calculated in this method (invalid if 0) |
Checks current load.
If it exceeds the maximum load an event is fired. Recursive.
| branch | - current branch |
|
virtual |
Remove all branches from this tree.
Reimplemented in agxModel::Deformable1D.
|
virtual |
Clone call when new tree is needed from internal methods.
Implement this if when you have your own implementation of this tree class.
Reimplemented in agxModel::Deformable1D, and agxOSG::Tree.
Traverse this tree and configures the branches.
Recursive.
| branch | - current branch |
Copy branch parameters from source to destination.
|
protected |
Copy constraint parameters from source to destination.
|
inlinestaticinherited |
Definition at line 639 of file Assembly.h.
|
inlinestaticinherited |
Definition at line 639 of file Assembly.h.
|
virtual |
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.
| geometry | - geometry to cut (only one shape per geometry supported) |
| point | - point in world |
| minShapeHeight | - resulting geometry/shape minimum height (default: 1 cm) |
geometry
|
virtual |
Cut at branch and get a new tree.
Branch branch will be member (first child of root) in the new tree.
| branch | - cut position in tree |
|
protectedinherited |
| Branch* agxModel::Tree::findBranch | ( | const agx::RigidBody * | rb | ) | const |
Search the tree for rigid body rb.
| rb | - rigid body to search for |
rb (0 if not found) | Branch* agxModel::Tree::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).
Recursive.
| fromBranch | - branch to start from |
| rb | - rigid body to search for |
rb (0 if not found)
|
protectedinherited |
|
inherited |
|
inherited |
Find (linear search) and return named Assembly.
| name | - name of the Assembly to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find (linear search) and return named Assembly.
| name | - name of the Assembly to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find (linear search) and return an Assembly matching the given uuid.
| uuid | - uuid of the Assembly to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find (linear search) and return an Assembly matching the given uuid.
| uuid | - uuid of the Assembly to find |
| recursive | - if true (default) the search will include sub-assemblies |
| agxModel::Tree::BranchEventListener* agxModel::Tree::getBranchEventListener | ( | ) | const |
|
inlineoverridevirtualinherited |
Reimplemented from agxStream::Serializable.
Reimplemented in agxWire::WireSimpleDrumController, agxVehicle::Track, agxSDK::LinkedStructure, and agxSDK::Collection.
Definition at line 639 of file Assembly.h.
|
inherited |
Find (linear search) and return a pointer to a Constraint with the given uuid.
| uuid | - uuid of the requested constraint |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find and return a pointer to a Constraint with the given uuid.
| uuid | - uuid of the requested constraint |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find (linear search) and return named Constraint.
| name | - name of the Constraint to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find (linear search) and return named Constraint.
| name | - name of the Constraint to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find and return named Constraint of a template type, for example Hinge:
agx::Hinge *hinge = simulation->getConstraint<agx::Hinge>("FrontWheelHinge");
| name | - name of the Constraint to find |
| recursive | - if true (default) the search will include sub-assemblies |
Definition at line 757 of file Assembly.h.
|
inherited |
Find and return named Constraint of a template type, for example Hinge:
const agx::Hinge* hinge = simulation->getConstraint<agx::Hinge>("FrontWheelHinge");
| name | - name of the Constraint to find |
| recursive | - if true (default) the search will include sub-assemblies |
Definition at line 763 of file Assembly.h.
|
inlineinherited |
Definition at line 632 of file Assembly.h.
|
inlineinherited |
Definition at line 633 of file Assembly.h.
|
inherited |
|
inlinestaticinherited |
Definition at line 639 of file Assembly.h.
| agx::Referenced* agxModel::Tree::getCustomData | ( | ) | const |
|
staticprotectedinherited |
|
inherited |
| bool agxModel::Tree::getEnableCollisions | ( | const agx::RigidBody * | rb | ) | const |
rb | bool agxModel::Tree::getEnableCollisions | ( | const agxCollide::Geometry * | geometry | ) | const |
geometry
|
inherited |
Definition at line 273 of file Serializable.h.
|
inherited |
|
inlinevirtualinherited |
Return a reference to the frame containing transformation and velocity information for this assembly.
Definition at line 690 of file Assembly.h.
|
inlinevirtualinherited |
Definition at line 695 of file Assembly.h.
|
inherited |
Referenced by agxSDK::matchFilter().
|
inherited |
Find (linear search) and return named collision Geometry.
| name | - name of the collision Geometry to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find (linear search) and return named collision Geometry.
| name | - name of the collision Geometry to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find (linear search) and return a Geometry matching the given uuid.
| uuid | - uuid of the collision Geometry to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find (linear search) and return a Geometry matching the given uuid.
| uuid | - uuid of the collision Geometry to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
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.
Definition at line 247 of file Serializable.h.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
| agx::Material* agxModel::Tree::getMaterial | ( | ) | const |
|
inherited |
|
inherited |
Find (linear search) and return an ObserverFrame matching the given uuid.
| name | - name of the ObserverFrame to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find (linear search) and return an ObserverFrame matching the given uuid.
| name | - name of the ObserverFrame to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find (linear search) and return an ObserverFrame matching the given uuid.
| uuid | - uuid of the ObserverFrame to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find (linear search) and return an ObserverFrame matching the given uuid.
| uuid | - uuid of the ObserverFrame to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Find (linear search) and return named RigidBody.
| name | - name of the body to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find (linear search) and return named RigidBody.
| name | - name of the body to find |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find (linear search) and return a pointer to a RigidBody with the given uuid.
| uuid | - uuid of the requested rigidbody |
| recursive | - if true (default) the search will include sub-assemblies |
|
inherited |
Find (linear search) and return a pointer to a RigidBody with the given uuid.
| uuid | - uuid of the requested rigidbody |
| recursive | - if true (default) the search will include sub-assemblies |
| Branch* agxModel::Tree::getRoot | ( | ) | const |
|
inherited |
|
inherited |
|
inlineoverridevirtualinherited |
Implements agxStream::Serializable.
Reimplemented in agxWire::WireSimpleDrumController, agxVehicle::Track, agxSDK::LinkedStructure, and agxSDK::Collection.
Definition at line 639 of file Assembly.h.
|
inherited |
|
inherited |
Definition at line 268 of file Serializable.h.
Referenced by agxSDK::UuidHashCollisionFilter::match().
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 |
id
|
virtual |
Explicit call to this method to check return value.
This tree will initialize it self when added to a simulation.
Reimplemented in agxModel::Deformable1D.
| bool agxModel::Tree::initialized | ( | ) | const |
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::EntityStorage::getInstances(), and agx::Object::getResource().
|
inherited |
Definition at line 252 of file Serializable.h.
References AGX_FORCE_INLINE.
| bool agxModel::Tree::isStatic | ( | ) | const |
| bool agxModel::Tree::makeDynamic | ( | ) |
Make all rigid bodies dynamic and add all constraints to the simulation.
This is the default state.
| bool agxModel::Tree::makeStatic | ( | bool | wakeOnContactEvent, |
| agxModel::Tree::TreeExecuteFilter * | filter = new agxModel::Tree::TreeExecuteFilter() |
||
| ) |
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.
| wakeOnContactEvent | - true to enable this tree to wake up upon contact |
| filter | - default all contacts with this tree |
|
protectedvirtual |
|
protectedvirtual |
Pre event callback.
Reimplemented in agxModel::Deformable1D.
|
protectedvirtual |
Pre-collide event callback.
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.
|
inherited |
Remove a constraint from this assembly (does not recurse down in tree).
|
inherited |
Remove an interaction from this assembly.
|
inherited |
Remove an EventListener from the assembly.
|
inherited |
Remove a rigid body from this assembly (does not recurse down in tree).
| body | - The body to be removed |
| removeAssociatedGeometries | - If true, the geometries associated to this body will also be removed |
|
inherited |
Remove a geometry from this assembly (does not recurse down in tree).
|
inherited |
Remove a child assembly from a parent.
|
inherited |
Remove a contact material from this assembly.
|
inherited |
Remove an emitter from this assembly.
|
inherited |
Remove an ObserverFrame from this assembly.
Removes rigid body, constraint etc associated to this tree.
Recursive.
|
protectedinherited |
| bool agxModel::Tree::removeGroupID | ( | agx::UInt32 | id | ) |
Removes group id from all geometries in this tree.
| id | - id to remove |
|
protected |
Removes the id from the branch geometries.
Recursive.
| branch | - current branch |
| id | - id to remove |
Called when this assembly is removed from another assembly.
Reimplemented in agxPowerLine::PowerLine.
Definition at line 594 of file Assembly.h.
|
protectedvirtual |
Called when this assembly is removed from a simulation.
Reimplemented from agxSDK::Assembly.
Reimplemented in agxModel::Deformable1D.
|
protectedinherited |
Remove a particle system from this assembly.
|
overridevirtualinherited |
Set the angular velocity (in world frame) recursively for all rigid bodies stored in assembly.
| velocity | - The angular velocity in world frame that will be set for all rigid bodies. |
|
static |
Utility method to set angular velocity damping for all branches.
I.g., Tree::setAngularVelocityDamping( aTree->getRoot(), angDamping ). Recursive.
| branch | - start branch |
| angularVelocityDamping | - angular velocity damping |
|
virtual |
Assign branch event listener.
Unique for this tree.
| branchListener | - new listener unique for this tree |
|
virtual |
Set new solve type for the branch connections.
Only valid for initialized trees. Default: DIREKT_AND_ITERATIVE.
| solveType | new solve type |
|
protected |
Assign constraint solve type.
Recursive.
| branch | - current branch |
| solveType | - new constraint solve type |
| void agxModel::Tree::setCustomData | ( | agx::Referenced * | customData | ) |
Assign custom data.
| customData | - custom data |
|
static |
Sets default material parameters for a tree.
|
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 | ||
| ) |
Enable or disable collisions between this tree and a rigid body.
| rb | - rigid body |
| flag | - true to enable, false to disable |
| bool agxModel::Tree::setEnableCollisions | ( | agxCollide::Geometry * | geometry, |
| bool | flag | ||
| ) |
Enable or disable collisions between this tree and a geometry.
| geometry | - the geometry |
| flag | - true to enable, false to disable |
|
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.
|
staticinherited |
Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
|
inherited |
Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
|
static |
Utility method to set linear velocity damping for all branches.
I.e., Tree::setLinearVelocityDamping( aTree->getRoot(), linDamping ). Recursive.
| branch | - start branch |
| linearVelocityDamping | - linear velocity damping |
Set the position of the assembly relative to its frame's parent frame.
| p | - local translate of assembly as a 3D vector |
Set the position of the assembly relative to its frame's parent frame.
| x | - local x translate |
| y | - local y translate |
| z | - local z translate |
Set the rotation of the assembly relative to its frame's parent frame.
| q | - rotation given as a quaternion |
|
inherited |
Set the rotation of the assembly relative to its frame's parent frame.
| e | - rotation given as Euler angles |
|
inherited |
Assign the local transformation matrix for this assembly, ignoring any eventual parent transformation.
| matrix | - transformation matrix relative to parent transform for the assembly's frame |
|
virtual |
Assign new material.
All geometries in this tree will have this material.
| material | - new material |
|
protected |
Assign material to all geometries for branch.
Recursive.
| branch | - current branch |
| material | - new material |
Set the name of this Assembly.
| name | - new name of this Assembly. |
|
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.
| frame | - new parent frame, 0 to remove parent |
Set the position of the frame in world coordinates.
| p | - desired position in world coordinates. |
Set the position of the frame in world coordinates.
| x | - desired x-coordinate in world frame |
| y | - desired y-coordinate in world frame |
| z | - desired z-coordinate in world frame |
Set the rotation of the assembly relative to world frame.
| q | - rotation given as a quaternion |
|
inherited |
Set the rotation of the assembly relative to world frame.
| e | - rotation given as Euler angles |
|
inherited |
Set the rotation of the assembly relative to world frame.
| m | - rotation given as an orthogonal transformation matrix |
|
inherited |
Set the transform of the assembly.
Its frame will move to the specified transform, which is given in world coordinates.
| matrix | - desired transform for the frame in world coordinates. |
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!
Set the linear velocity (in world frame) recursively for all rigid bodies stored in assembly.
| velocity | - The linear velocity in world frame that will be set for all rigid bodies. |
|
protected |
Changes motion control and adds/removes constraints depending on flag.
Recursive.
| branch | - current branch |
| flag | - true for STATIC and remove |
|
virtual |
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).
| geometry | - geometry to split (only one shape per geometry supported) |
| point | - point in world |
| minShapeHeight | - resulting geometry/shape minimum height (default: 1 cm) |
geometry Move from source to destination.
|
overridevirtualinherited |
|
virtualinherited |
Traverse the assembly tree recursively using a visitor.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
virtualinherited |
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.
Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().
|
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.
|
staticinherited |
| bool agxModel::Tree::wakeOnContact | ( | ) | const |
|
protected |
Definition at line 749 of file agxModel/Tree.h.
|
protected |
Definition at line 747 of file agxModel/Tree.h.
|
protected |
Definition at line 744 of file agxModel/Tree.h.
|
protected |
Definition at line 745 of file agxModel/Tree.h.
|
protected |
Definition at line 743 of file agxModel/Tree.h.
|
protected |
Definition at line 746 of file agxModel/Tree.h.
|
protected |
Definition at line 748 of file agxModel/Tree.h.
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.
|
protected |
Definition at line 741 of file agxModel/Tree.h.
|
protected |
Definition at line 742 of file agxModel/Tree.h.
|
protected |
Definition at line 751 of file agxModel/Tree.h.
|
protected |
Definition at line 750 of file agxModel/Tree.h.