|
AGX Dynamics 2.42.3.1
|
Object that defines the relation between different types of wires (agxWire::Wire). More...
#include <Link.h>
Inheritance diagram for agxWire::Link:Public Types | |
| typedef agx::observer_ptr< const Algorithm > | AlgorithmConstObserver |
| typedef agx::ref_ptr< const Algorithm > | AlgorithmConstRef |
| typedef agx::observer_ptr< Algorithm > | AlgorithmObserver |
| typedef agx::ref_ptr< Algorithm > | AlgorithmRef |
| typedef agx::Vector< agxWire::ILinkNodeRef > | ConnectionsContainer |
| enum | ConnectionType { WIRE_BEGIN = 0 , WIRE_END = 1 , LINK , INVALID_CONNECTION = 0xFF } |
| Connection type of the wires connected to this link, i.e., if this link should be attached to begin or end of the wire. More... | |
| typedef agx::Vector< agxWire::LinkRef > | LinkConnectionsContainer |
| enum class | WinchState { PULLED_IN , INSIDE , OVERLAPPING , NONE } |
| State when a link is interacting with a winch. More... | |
Public Member Functions | |
| Link (agx::RigidBody *rb) | |
| Default constructor. | |
| agx::Bool | add (agxWire::Link::Algorithm *algorithm) |
| Add a link algorithm. | |
| agx::Bool | addChild (agxWire::Link::Algorithm *algorithm) |
| Add unique child algorithm. | |
| template<typename T > | |
| T * | as () |
| template<typename T > | |
| const T * | as () const |
| agx::Bool | attach (agxWire::Wire *wire, const agx::Vec3 &relativeTranslate, agxWire::Link::ConnectionType type) |
Connects/maps and attaches wire to this link. | |
| agx::Bool | connect (agxWire::Link *link, agx::Constraint *constraint) |
| Connect this link to another link with a constraint. | |
| agx::Bool | connect (agxWire::Wire *wire, const agx::Vec3 &relativeTranslate, agxWire::Link::ConnectionType type) |
Maps this link to wire at given connection type (WIRE_BEGIN/WIRE_END). | |
| void | debugRenderConnections () const |
| Shows connection points in debug rendering view. | |
| agx::Bool | disconnect (agxWire::Link *otherLink) |
Disconnect, or detach, this link from otherLink. | |
| agx::Bool | disconnect (agxWire::Wire *wire) |
Disconnect, or detach, this link from wire. | |
| template<typename T > | |
| T * | find () const |
| template<typename Pred > | |
| agxWire::ILinkNode * | findConnectingNode (Pred pred) const |
| template<typename Pred > | |
| ILinkNode * | findConnectingNode (Pred pred) const |
| agxWire::Winch * | findPulledInWinch () const |
| Finds the winch this link is completely pulled into, meaning this link is inactive with WinchState::PULLED_IN. | |
| WinchState | findWinchState () const |
| Finds a state how this link is interacting with any winch. | |
| template<typename T > | |
| T * | getAlgorithm () const |
| agxWire::Link::Algorithm * | getChild (agx::UInt i) const |
| agx::Constraint * | getConnectingConstraint (const agxWire::Link *link) const |
| agxWire::ILinkNode * | getConnectingNode (const agxWire::Link *link) const |
| agxWire::ILinkNode * | getConnectingNode (const agxWire::Wire *wire) const |
| template<typename Pred > | |
| agxWire::Link::ConnectionsContainer | getConnectingNodes (Pred pred) const |
| template<typename Pred > | |
| Link::ConnectionsContainer | getConnectingNodes (Pred pred) const |
| const agxWire::Link::ConnectionsContainer & | getConnections () const |
| agxWire::ILinkNode::ConnectionProperties * | getDefaultWireConnectionProperties () |
| Access default wire connection properties for each new wire that's connected to this link. | |
| const agxWire::ILinkNode::ConnectionProperties * | getDefaultWireConnectionProperties () const |
| agx::Bool | getEnable () const |
| agx::UInt | getNumChildren () const |
| agx::UInt | getNumConnections () const |
| agxWire::Link::Algorithm * | getParent () const |
| agx::RigidBody * | getRigidBody () const |
| agx::Bool | hasConnection (const agxWire::Wire *wire) const |
| virtual void | onLinkEnable (agx::Bool enable, agxWire::Link *link, agxSDK::SimulationProxy *simulationProxy) |
| Called when link enable state is changed. | |
| virtual void | post (agxWire::Link *link, agxSDK::SimulationProxy *simulationProxy) |
| Simulation post callback. | |
| void | postChildrenUpdate () |
| Internal method. | |
| virtual void | pre (agxWire::Link *link, agxSDK::SimulationProxy *simulationProxy) |
| Simulation pre callback. | |
| void | preChildrenUpdate () |
| Internal method. | |
| virtual void | preCollide (agxWire::Link *link, agxSDK::SimulationProxy *simulationProxy) |
| Simulation pre-collide callback. | |
| agx::Bool | remove (agxWire::Link::Algorithm *algorithm) |
| Remove link algorithm. | |
| agx::Bool | removeChild (agxWire::Link::Algorithm *algorithm) |
| Remove child algorithm. | |
| void | transform () |
| Transforms all the connecting nodes when for example the rigid body has been moved. | |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. | |
| Referenced (const Referenced &) | |
| template<typename T > | |
| T * | as () |
| Subclass casting. | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. | |
| template<typename T > | |
| const T * | asSafe () const |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
Public Member Functions inherited from agxStream::Serializable | |
| virtual | ~Serializable () |
| Destructor for normal C++ use but hidden from SWIG bindings. | |
| virtual const char * | getClassName () const |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. | |
| virtual StorageAgent * | getStorageAgent () const =0 |
| agx::Uuid | getUuid () const |
| bool | isFinished () const |
| void | setEnableSerialization (bool flag) |
| Set to false to disable serialization of this object. | |
| void | setFinished () |
| Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. | |
Static Public Member Functions | |
| static agx::Bool | connect (agxWire::Wire *wire1, const agx::Vec3 &relativeTranslate1, agxWire::Link *link, agxWire::Wire *wire2, const agx::Vec3 &relativeTranslate2) |
| Utility function to connect two wires with a link. | |
| static agxWire::Link * | getConnectingLink (const agxWire::ConnectingNode *connectingNode) |
| static agxWire::Link::ConnectionType | getConnectionType (const agxWire::ConnectingNode *connectingNode) |
| static agxWire::Link * | getLink (const agxWire::ConnectingNode *connectingNode) |
| static agxWire::Wire * | getWire (const agxWire::ConnectingNode *connectingNode, agx::Bool findClosestIfLinkConnections=false) |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Static Public Member Functions inherited from agxStream::Serializable | |
| static void | setEnableUuidGeneration (bool flag) |
| Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. | |
Protected Types | |
| typedef agx::Vector< agxWire::Link::AlgorithmRef > | AlgorithmContainer |
| enum | State { NONE = 0 , INITIALIZED = 1 << 0 , ENABLE_TOGGLED = 1 << 1 , IDLE = 0 , UPDATING_CHILDREN = (1<<0) } |
| State of the link. More... | |
Protected Member Functions | |
| Link () | |
| Default constructor during restore. | |
| virtual | ~Link () |
| Reference counted object - protected destructor. | |
| void | addConnection (agxWire::Link::ConnectionsContainer &connections, agxWire::ILinkNode *node) |
| Add connection, register to LinkController. | |
| void | addState (agxWire::Link::State state) |
| Add state. | |
| Algorithm () | |
| Abstract class - protected constructor. | |
| void | collectGarbage () |
| Checks connections and removes them where the wires have been deleted. | |
| void | eraseConnection (agxWire::Link::ConnectionsContainer &connections, agxWire::ILinkNode *node) |
| Erase connection, register to LinkController. | |
| virtual agx::Bool | executeUpdate (const agxSDK::SimulationProxy *simulationProxy) |
| Garbage collects and checks if this link is ready for update calls. | |
| agx::Bool | hasState (agxWire::Link::State state) const |
| void | removeState (agxWire::Link::State state) |
| Remove state. | |
| virtual void | update (agxWire::WireParallelCallbacksHandler::CallbackTypes type, agxSDK::SimulationProxy *simulationProxy) |
| Update call. | |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Protected Member Functions inherited from agxStream::Serializable | |
| Serializable () | |
| Default constructor. | |
| Serializable (const Serializable &other) | |
| Copy constructor. | |
| void | generateUuid () |
Protected Attributes | |
| AlgorithmContainer | m_algorithms |
| ILinkNode::ConnectionProperties | m_defaultLinkConnectionProperties |
| ILinkNode::ConnectionProperties | m_defaultWireConnectionProperties |
| AlgorithmContainer | m_newlyAddedAlgorithms |
| agx::RigidBodyRef | m_rb |
| agx::Int32 | m_state |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Additional Inherited Members | |
Static Protected Member Functions inherited from agx::Referenced | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
Object that defines the relation between different types of wires (agxWire::Wire).
Base class for an algorithm present in the agxWire::Link context.
I.e., this link object enables functionality to (for example) move nodes from one wire to another.
This algorithm gets callbacks on preCollide, pre, post and when the enable-state of the link has been toggled.
| typedef agx::observer_ptr< const Algorithm > agxWire::Link::AlgorithmConstObserver |
| typedef agx::ref_ptr< const Algorithm > agxWire::Link::AlgorithmConstRef |
|
protected |
| typedef agx::ref_ptr< Algorithm > agxWire::Link::AlgorithmRef |
Connection type of the wires connected to this link, i.e., if this link should be attached to begin or end of the wire.
| Enumerator | |
|---|---|
| WIRE_BEGIN | Link attached at begin of wire. |
| WIRE_END | Link attached at end of wire. |
| LINK | Link attached to another link. |
| INVALID_CONNECTION | Invalid connection, e.g., if this link isn't connected to a give wire. |
|
protected |
|
strong |
State when a link is interacting with a winch.
| agxWire::Link::Link | ( | agx::RigidBody * | rb | ) |
Default constructor.
|
protected |
Default constructor during restore.
|
protectedvirtual |
Reference counted object - protected destructor.
| agx::Bool agxWire::Link::add | ( | agxWire::Link::Algorithm * | algorithm | ) |
Add a link algorithm.
| algorithm | - algorithm to add |
| agx::Bool agxWire::Link::addChild | ( | agxWire::Link::Algorithm * | algorithm | ) |
Add unique child algorithm.
|
protected |
Add connection, register to LinkController.
|
protected |
Add state.
|
protected |
Abstract class - protected constructor.
| T * agxWire::Link::as | ( | ) |
| const T * agxWire::Link::as | ( | ) | const |
| agx::Bool agxWire::Link::attach | ( | agxWire::Wire * | wire, |
| const agx::Vec3 & | relativeTranslate, | ||
| agxWire::Link::ConnectionType | type | ||
| ) |
Connects/maps and attaches wire to this link.
The current attachment at type will be detached and replaced by this link.
| wire | - wire to attach |
| relativeTranslate | - position in this links frame where the connection point is |
| type | - connection type at WIRE_BEGIN or WIRE_END |
|
protected |
Checks connections and removes them where the wires have been deleted.
| agx::Bool agxWire::Link::connect | ( | agxWire::Link * | link, |
| agx::Constraint * | constraint | ||
| ) |
Connect this link to another link with a constraint.
| link | - other link to connect to this link |
| constraint | - constraint connecting the links |
| agx::Bool agxWire::Link::connect | ( | agxWire::Wire * | wire, |
| const agx::Vec3 & | relativeTranslate, | ||
| agxWire::Link::ConnectionType | type | ||
| ) |
Maps this link to wire at given connection type (WIRE_BEGIN/WIRE_END).
This method will only map wire to this link, it will not actually be attached.
| wire | - wire to connect |
| relativeTranslate | - position in this links frame where the connection point is |
| type | - connection type at WIRE_BEGIN or WIRE_END |
|
static |
Utility function to connect two wires with a link.
link will be connected at WIRE_END of wire1 and WIRE_BEGIN at wire2.
| wire1 | - first wire with link connected at end of its route |
| relativeTranslate1 | - position in this links frame where the connection point to wire 1 is |
| link | - The link that should be connected between the two wires |
| wire2 | - second wire with link connected at begin of its route |
| relativeTranslate2 | - position in this links frame where the connection point to wire 2 is |
| void agxWire::Link::debugRenderConnections | ( | ) | const |
Shows connection points in debug rendering view.
| agx::Bool agxWire::Link::disconnect | ( | agxWire::Link * | otherLink | ) |
Disconnect, or detach, this link from otherLink.
| otherLink | - link to detach |
| agx::Bool agxWire::Link::disconnect | ( | agxWire::Wire * | wire | ) |
Disconnect, or detach, this link from wire.
| wire | - wire to disconnect |
|
protected |
Erase connection, register to LinkController.
|
protectedvirtual |
Garbage collects and checks if this link is ready for update calls.
| T * agxWire::Link::find | ( | ) | const |
| agxWire::ILinkNode * agxWire::Link::findConnectingNode | ( | Pred | pred | ) | const |
| ILinkNode * agxWire::Link::findConnectingNode | ( | Pred | pred | ) | const |
Definition at line 549 of file Link.h.
References agx::Container::size().
| agxWire::Winch * agxWire::Link::findPulledInWinch | ( | ) | const |
Finds the winch this link is completely pulled into, meaning this link is inactive with WinchState::PULLED_IN.
If this link is enabled or when no winch is found, nullptr is returned.
| WinchState agxWire::Link::findWinchState | ( | ) | const |
Finds a state how this link is interacting with any winch.
| T * agxWire::Link::getAlgorithm | ( | ) | const |
| agxWire::Link::Algorithm * agxWire::Link::getChild | ( | agx::UInt | i | ) | const |
| agx::Constraint * agxWire::Link::getConnectingConstraint | ( | const agxWire::Link * | link | ) | const |
link, otherwise null
|
static |
| agxWire::ILinkNode * agxWire::Link::getConnectingNode | ( | const agxWire::Link * | link | ) | const |
| agxWire::ILinkNode * agxWire::Link::getConnectingNode | ( | const agxWire::Wire * | wire | ) | const |
| agxWire::Link::ConnectionsContainer agxWire::Link::getConnectingNodes | ( | Pred | pred | ) | const |
| Link::ConnectionsContainer agxWire::Link::getConnectingNodes | ( | Pred | pred | ) | const |
Definition at line 538 of file Link.h.
References agx::Vector< T, Allocator >::push_back(), and agx::Vector< T, Allocator >::reserve().
| const agxWire::Link::ConnectionsContainer & agxWire::Link::getConnections | ( | ) | const |
|
static |
| agxWire::ILinkNode::ConnectionProperties * agxWire::Link::getDefaultWireConnectionProperties | ( | ) |
Access default wire connection properties for each new wire that's connected to this link.
| const agxWire::ILinkNode::ConnectionProperties * agxWire::Link::getDefaultWireConnectionProperties | ( | ) | const |
| agx::Bool agxWire::Link::getEnable | ( | ) | const |
|
static |
| agx::UInt agxWire::Link::getNumChildren | ( | ) | const |
| agx::UInt agxWire::Link::getNumConnections | ( | ) | const |
| agxWire::Link::Algorithm * agxWire::Link::getParent | ( | ) | const |
| agx::RigidBody * agxWire::Link::getRigidBody | ( | ) | const |
|
static |
| connectingNode | - wire or link connecting node |
| findClosestIfLinkConnections | - if true and connectingNode is connected to a link, the search will continue over all link connections until first wire connection |
| agx::Bool agxWire::Link::hasConnection | ( | const agxWire::Wire * | wire | ) | const |
|
protected |
|
virtual |
Called when link enable state is changed.
enable is the new state of the link.
| enable | - true if the link is enabled, false if disabled |
| link | - link which state is changed |
| simulationProxy | - simulation proxy |
|
virtual |
Simulation post callback.
| link | - link this algorithm is connected to |
| simulationProxy | - simulation proxy |
| void agxWire::Link::postChildrenUpdate | ( | ) |
Internal method.
Called after children get update calls.
|
virtual |
Simulation pre callback.
| link | - link this algorithm is connected to |
| simulationProxy | - simulation proxy |
| void agxWire::Link::preChildrenUpdate | ( | ) |
Internal method.
Called before children get update calls.
|
virtual |
Simulation pre-collide callback.
| link | - link this algorithm is connected to |
| simulationProxy | - simulation proxy |
| agx::Bool agxWire::Link::remove | ( | agxWire::Link::Algorithm * | algorithm | ) |
Remove link algorithm.
| algorithm | - algorithm to remove |
| agx::Bool agxWire::Link::removeChild | ( | agxWire::Link::Algorithm * | algorithm | ) |
Remove child algorithm.
|
protected |
Remove state.
| void agxWire::Link::transform | ( | ) |
Transforms all the connecting nodes when for example the rigid body has been moved.
|
protectedvirtual |
Update call.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |