|
AGX Dynamics 2.42.3.1
|
Overlaying object handling wires. More...
#include <WireController.h>
Inheritance diagram for agxWire::WireController:Public Member Functions | |
| agxSDK::Simulation * | find (agxWire::WireHandler *handler) const |
| agxWire::WireHandler * | find (const agxSDK::Simulation *simulation) |
| const agxWire::WireController::WirePtrContainer & | getAllWires () const |
| WireIterator | getBeginWireIterator () const |
| Access to all the wires. | |
| bool | getEnableCollisions (const agxWire::Wire *wire1, const agxWire::Wire *wire2) const |
| const WireWireContainer & | getEnabledWireWirePairs () const |
| Internal method. | |
| agx::Bool | getEnableDynamicWireContacts (const agx::RigidBody *rb) const |
| agx::Bool | getEnableDynamicWireContacts (const agxCollide::Geometry *geometry) const |
| agx::Bool | getEnableDynamicWireContactsGlobally () const |
| WireIterator | getEndWireIterator () const |
| agx::UInt | getNumWires () const |
| Can be used to iterate over all wires in a script language that e.g., not support iterators. | |
| agxWire::WireHandler * | getOrCreateWireHandler (agxSDK::Simulation *simulation) |
| agxWire::WireParallelCallbacksHandler * | getOrCreateWireParallelCallbacksHandler (agxSDK::Simulation *simulation) |
| agxWire::Wire * | getWire (agx::UInt index) const |
| bool | isWireWireActive () const |
| void | removeParallelCallbackHandler (agxSDK::Simulation *simulation) |
| Removes object. | |
| bool | setEnableCollisions (agxWire::Wire *wire1, agxWire::Wire *wire2, bool enable) |
| Enable, or disable, collision detection and contacts between two wires. | |
| agx::Bool | setEnableDynamicWireContacts (agx::RigidBody *rb, agx::Bool enable) |
| Enable, or disable, the use of dynamic wire contact model against this rigid body. | |
| agx::Bool | setEnableDynamicWireContacts (agxCollide::Geometry *geometry, agx::Bool enable) |
| Enable, or disable, the use of dynamic wire contact model against this geometry. | |
| void | setEnableDynamicWireContactsGlobally (agx::Bool enable) |
| Force all wire contacts to be dynamic. | |
Public Member Functions inherited from agx::Singleton | |
| Singleton (int priority=DEFAULT_PRIORITY) | |
| Default constructor. | |
| virtual std::string | getClassName () const =0 |
| int | getPriority () const |
| Return the shutdown priority of the singleton instance. | |
| virtual void | shutdown ()=0 |
| Implement this method to cleanup your Singleton class. | |
Static Public Member Functions | |
| static WireController * | instance () |
Protected Member Functions | |
| WireController () | |
| virtual | ~WireController () |
| void | onAddNotification (agxWire::Wire *wire) |
| Internal method. | |
| void | onCreate (agxWire::Wire *wire) |
| Internal method. | |
| void | onDelete (agxWire::Wire *wire) |
| Internal method. | |
| void | onRemoveNotification (agxWire::Wire *wire) |
| Internal method. | |
| void | onSimplify (agxSDK::Simulation *simulation, agxWire::Wire *wire) |
| Call when the wire is simplified. | |
| void | onUnsimplify (agxSDK::Simulation *simulation, agxWire::Wire *wire) |
| Call when the wire is unsimplified. | |
| virtual void | shutdown () override |
| Implement this method to cleanup your Singleton class. | |
| void | updateId (agxWire::Wire *wire) |
| Internal method. | |
Protected Member Functions inherited from agx::Singleton | |
| virtual | ~Singleton () |
| Destructor. | |
| void | _shutdown () |
Protected Attributes | |
| WireWireContainer | m_enabledWires |
| Explicitly enabled collisions pairs. | |
| IdWireContainer | m_idWire |
| Wire unique geometry id -> wire. | |
| agx::ReentrantMutex | m_mutex |
| WireParallelCallbacksHandlerFactoryRef | m_parallelCallbacksFactory |
| WireParallelCallbacksHandlerContainer | m_parallelCallbacksHandlers |
| Parallel callbacks handler, unique for each simulation. | |
| SimplifiedWiresContainer | m_simplifiedWires |
| agx::UInt | m_state |
| Current global state. | |
| WireHandlerContainer | m_wireHandlers |
| Wire handlers, unique for each simulation. | |
| WirePtrContainer | m_wires |
| All wires instantiated. | |
Overlaying object handling wires.
This class monitors construction and deletion (and adding, removing from simulations) of wires and enables interface for enabling and disabling contacts/collision handling between wires.
Note that this class handles agxWire::Wire objects, and nothing else.
Examples how to use this class.
Example 1: agxWire::WireRef wire1 = new ... agxWire::WireRef wire2 = new ... agxWire::WireController::instance()->getEnableCollisions( wire1, wire2 ); // false - default is false. agxWire::WireController::instance()->setEnableCollisions( wire1, wire2, true );
Example 2: Loop ALL wire objects created (registered during "new agxWire::Wire"). agxWire::WireController::WireIterator it = agxWire::WireController::instance()->getBeginWireIterator(); while ( it != agxWire::WireController::instance()->getEndWireIterator() ) { const agxWire::Wire* wire = *it; Do stuff. ++it; }
Definition at line 54 of file WireController.h.
| typedef agx::HashVector< agx::UInt32, agx::observer_ptr< agxWire::Wire > > agxWire::WireController::IdWireContainer |
Definition at line 61 of file WireController.h.
| typedef agx::Vector< SimulationObsWirePtrContainerPair > agxWire::WireController::SimplifiedWiresContainer |
Definition at line 66 of file WireController.h.
| typedef std::pair< agxSDK::SimulationObserver, WireParallelCallbacksHandlerRef > agxWire::WireController::SimulationObsWireParallelCallbacksHandlerRefPair |
Definition at line 63 of file WireController.h.
| typedef std::pair< agxSDK::SimulationObserver, WirePtrContainer > agxWire::WireController::SimulationObsWirePtrContainerPair |
Definition at line 64 of file WireController.h.
| typedef agx::Vector< WireHandlerRef > agxWire::WireController::WireHandlerContainer |
Definition at line 62 of file WireController.h.
Definition at line 58 of file WireController.h.
| typedef agx::Vector< SimulationObsWireParallelCallbacksHandlerRefPair > agxWire::WireController::WireParallelCallbacksHandlerContainer |
Definition at line 65 of file WireController.h.
Definition at line 57 of file WireController.h.
Definition at line 60 of file WireController.h.
| typedef agx::SymmetricPair< agx::observer_ptr< agxWire::Wire > > agxWire::WireController::WireWireSymmetricPair |
Definition at line 59 of file WireController.h.
Internal state handling.
Test, debug and development related.
Definition at line 72 of file WireController.h.
|
protected |
|
protectedvirtual |
| agxSDK::Simulation * agxWire::WireController::find | ( | agxWire::WireHandler * | handler | ) | const |
| agxWire::WireHandler * agxWire::WireController::find | ( | const agxSDK::Simulation * | simulation | ) |
| const agxWire::WireController::WirePtrContainer & agxWire::WireController::getAllWires | ( | ) | const |
| WireController::WireIterator agxWire::WireController::getBeginWireIterator | ( | ) | const |
Access to all the wires.
getEndWireIterator() - getBeginWireIterator() == total number of wires.
Definition at line 355 of file WireController.h.
References agx::SetVector< DataT, HashT >::begin().
| bool agxWire::WireController::getEnableCollisions | ( | const agxWire::Wire * | wire1, |
| const agxWire::Wire * | wire2 | ||
| ) | const |
| wire1 | - first wire |
| wire2 | - second wire |
wire1 can collide with wire2 - otherwise false | const WireWireContainer & agxWire::WireController::getEnabledWireWirePairs | ( | ) | const |
Internal method.
Pairs of wire where setEnableCollisions( ..., true ) has been called.
| agx::Bool agxWire::WireController::getEnableDynamicWireContacts | ( | const agx::RigidBody * | rb | ) | const |
rb has contact model 'dynamic' - otherwise false | agx::Bool agxWire::WireController::getEnableDynamicWireContacts | ( | const agxCollide::Geometry * | geometry | ) | const |
geometry is 'dynamic' - otherwise false | agx::Bool agxWire::WireController::getEnableDynamicWireContactsGlobally | ( | ) | const |
| WireController::WireIterator agxWire::WireController::getEndWireIterator | ( | ) | const |
Definition at line 360 of file WireController.h.
| agx::UInt agxWire::WireController::getNumWires | ( | ) | const |
Can be used to iterate over all wires in a script language that e.g., not support iterators.
| agxWire::WireHandler * agxWire::WireController::getOrCreateWireHandler | ( | agxSDK::Simulation * | simulation | ) |
| agxWire::WireParallelCallbacksHandler * agxWire::WireController::getOrCreateWireParallelCallbacksHandler | ( | agxSDK::Simulation * | simulation | ) |
| agxWire::Wire * agxWire::WireController::getWire | ( | agx::UInt | index | ) | const |
index
|
static |
| bool agxWire::WireController::isWireWireActive | ( | ) | const |
|
protected |
Internal method.
All wires should report themselves to this controller during addNotification.
|
protected |
Internal method.
All wires should report themselves to this controller during construction.
|
protected |
Internal method.
All wires must be removed from the controller when the destructor is called.
|
protected |
Internal method.
From removeNotification.
|
protected |
Call when the wire is simplified.
|
protected |
Call when the wire is unsimplified.
| void agxWire::WireController::removeParallelCallbackHandler | ( | agxSDK::Simulation * | simulation | ) |
Removes object.
| bool agxWire::WireController::setEnableCollisions | ( | agxWire::Wire * | wire1, |
| agxWire::Wire * | wire2, | ||
| bool | enable | ||
| ) |
Enable, or disable, collision detection and contacts between two wires.
By default collisions are disabled.
| wire1 | - first wire |
| wire2 | - second wire |
| enable | - true to enable collisions between wire1 and wire2 - false to disable |
| agx::Bool agxWire::WireController::setEnableDynamicWireContacts | ( | agx::RigidBody * | rb, |
| agx::Bool | enable | ||
| ) |
Enable, or disable, the use of dynamic wire contact model against this rigid body.
| rb | - rigid body with geometries to change wire contact model on |
| enable | - true to use the dynamics contact model, false to use the default contact model |
| agx::Bool agxWire::WireController::setEnableDynamicWireContacts | ( | agxCollide::Geometry * | geometry, |
| agx::Bool | enable | ||
| ) |
Enable, or disable, the use of dynamic wire contact model against this geometry.
| geometry | - geometry to change wire contact model on |
| enable | - true to use the dynamics contact model, false to use the default contact model |
| void agxWire::WireController::setEnableDynamicWireContactsGlobally | ( | agx::Bool | enable | ) |
Force all wire contacts to be dynamic.
|
overrideprotectedvirtual |
Implement this method to cleanup your Singleton class.
Implements agx::Singleton.
|
protected |
Internal method.
Updates identification number for a wire.
|
protected |
Explicitly enabled collisions pairs.
Definition at line 343 of file WireController.h.
|
protected |
Wire unique geometry id -> wire.
Definition at line 344 of file WireController.h.
|
protected |
Definition at line 350 of file WireController.h.
|
protected |
Definition at line 346 of file WireController.h.
|
protected |
Parallel callbacks handler, unique for each simulation.
Definition at line 347 of file WireController.h.
|
protected |
Definition at line 348 of file WireController.h.
|
protected |
Current global state.
Definition at line 349 of file WireController.h.
|
protected |
Wire handlers, unique for each simulation.
Definition at line 345 of file WireController.h.
|
protected |
All wires instantiated.
Definition at line 342 of file WireController.h.