AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
agxPowerLine::PowerLine Class Reference

PowerLine is the base class for a system of power transfer integrated into the rigid body simulation. More...

#include <PowerLine.h>

+ Inheritance diagram for agxPowerLine::PowerLine:

Public Member Functions

 PowerLine ()
 
bool add (agxPowerLine::SubGraph *component)
 
bool add (agxPowerLine::Unit *component)
 
virtual void addNotification (agxSDK::Assembly *) override
 Called when this assembly is added to another assembly.
 
virtual void addNotification (agxSDK::Simulation *simulation) override
 Called when this assembly is added to a simulation (given that it not already is in the simulation).
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxPowerLine::PowerLine)
 
bool cacheAdd (agxPowerLine::SubGraph *component)
 
bool cacheRemove (agxPowerLine::SubGraph *component)
 
void clearAddRemoveCache (ConnectorPtrVector &addedConnectors, UnitPtrVector &addedUnits)
 
void collectConstraintsToHolder ()
 
void createConstraintHolder ()
 Creates a constraint holder for all elementary constraints between the physical dimensions.
 
agx::Bool getAddUnitsOnConnect () const
 
const agxPowerLine::ConnectorRefSet & getConnectors () const
 
agxUtil::ConstraintHolder * getConstraintHolder () const
 
int getDimensionType (std::string name)
 
size_t getNumConnectors () const
 
size_t getNumUnits () const
 
void getRoots (agxPowerLine::UnitPtrPowerLinePtrHashVector &units) const
 Get pointers to all roots, each connected to a sub graph.
 
agxPowerLine::SlotMapper * getSlotMapper ()
 
agx::Constraint::SolveType getSolveType () const
 
agxPowerLine::Unit * getSource ()
 
const agxPowerLine::Unit * getSource () const
 
Unit * getUnit (const agx::Name &name)
 Find and return the first unit with the given name, if any exist.
 
template<typename T >
T * getUnit (const agx::Name &name)
 
const Unit * getUnit (const agx::Name &name) const
 Find and return the first unit with the given name, if any exist.
 
const agxPowerLine::UnitRefSetVector & getUnits () const
 
bool hasCachedOperations () const
 
void insertConnectorTemporary (Connector *connector)
 
void insertSubGraphRouterTemporary (SubGraph *router)
 
bool pointAddConnector (agxPowerLine::Connector *connector)
 
bool pointAddUnit (agxPowerLine::Unit *unit)
 
bool pointReplace (agxPowerLine::Unit *oldUnit, agxPowerLine::Unit *newUnit)
 
bool remove (agxPowerLine::SubGraph *component)
 
bool removeConnector (agxPowerLine::Connector *connector)
 
virtual void removeNotification (agxSDK::Assembly *) override
 Called when this assembly is removed from another assembly.
 
virtual void removeNotification (agxSDK::Simulation *simulation) override
 Called when this assembly is removed from a simulation.
 
bool removeSubGraph (agxPowerLine::SubGraph *component)
 
bool removeUnit (agxPowerLine::Unit *unit)
 
virtual bool restore (agxStream::StorageStream &str)
 Restores internal data from stream.
 
void setAddUnitsOnConnect (agx::Bool addOnConnect)
 Decide if: when units added to this powerLine are to be connected to units not belonging to any power line will be added to this power line, or not.
 
void setSolveType (agx::Constraint::SolveType solveType)
 Set the current solve type DIRECT_AND_ITERATIVE is used by default.
 
bool setSource (agxPowerLine::SubGraph *source)
 
bool setSource (agxPowerLine::Unit *source)
 Set the unit the traverser shall start traversing from.
 
virtual bool store (agxStream::StorageStream &str) const
 Stores internal data for this PowerLine into stream.
 
bool writeDimensionsGraph (const agx::String &path) const
 Write the current graph state of the powerline to a .dot file (path)
 
bool writeDimensionsGraph (const char *path) const
 
- Public Member Functions inherited from agxSDK::Assembly
 Assembly ()
 Default constructor.
 
bool add (agx::Constraint *constraint)
 Add a constraint to the assembly.
 
bool add (agx::ContactMaterial *contactMaterial)
 Add a contact material to this assembly.
 
bool add (agx::Emitter *emitter)
 Add an emitter to this assembly.
 
bool add (agx::Interaction *interaction)
 Add an interaction to this assembly.
 
bool add (agx::MergedBody *mergedBody)
 Add a MergedBody to this assembly.
 
bool add (agx::ObserverFrame *observerFrame)
 Add an ObserverFrame to this assembly.
 
bool add (agx::RigidBody *body)
 Add a rigid body to the assembly.
 
bool add (agxCollide::Geometry *geometry)
 Add a geometry to the assembly.
 
bool add (agxSDK::EventListener *listener)
 Add a listener to the assembly.
 
bool add (agxSDK::TerrainInstance *terrainInstance)
 Add a TerrainInstance to this assembly.
 
bool add (agxSDK::TerrainToolInstance *toolInstance)
 Add a TerrainToolInstance to this assembly.
 
bool add (agxStream::Serializable *object)
 Add an object of type serialized.
 
bool add (Assembly *assembly)
 Add another assembly as child to this assembly.
 
virtual void addNotification (agxSDK::Simulation *)
 Called when this assembly is added to a simulation (given that it not already is in the simulation).
 
virtual void addNotification (Assembly *)
 Called when this assembly is added to another assembly.
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxSDK::Assembly)
 
size_t collect (agx::ConstraintRefVector &result, bool recursive=true)
 
size_t collect (agx::EmitterRefVector &result, bool recursive=true)
 
size_t collect (agx::InteractionRefVector &result, bool recursive=true)
 
size_t collect (agx::MergedBodyRefVector &result, bool recursive=true)
 
size_t collect (agx::ObserverFrameRefVector &result, bool recursive=true)
 
size_t collect (agx::ParticleSystemRefVector &result, bool recursive=true)
 
size_t collect (agx::RigidBodyRefVector &result, bool recursive=true)
 
size_t collect (agxCollide::GeometryRefVector &result, bool recursive=true)
 
size_t collect (agxSDK::AssemblyRefVector &result, bool recursive=true)
 
size_t collect (agxSDK::EventListenerRefVector &result, bool recursive=true)
 
size_t collect (agxSDK::TerrainInstanceRefVector &result, bool recursive=true)
 
size_t collect (agxSDK::TerrainToolInstanceRefVector &result, bool recursive=true)
 
bool empty () const
 
const AssemblyRefSetVector & getAssemblies () const
 
agxSDK::Assembly * getAssembly (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named Assembly.
 
const agxSDK::Assembly * getAssembly (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named Assembly.
 
agxSDK::Assembly * getAssembly (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an Assembly matching the given uuid.
 
const agxSDK::Assembly * getAssembly (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an Assembly matching the given uuid.
 
agx::Constraint * getConstraint (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named Constraint.
 
template<typename T >
T * getConstraint (const agx::Name &name, bool recursive=true)
 Find and return named Constraint of a template type, for example Hinge:
 
const agx::Constraint * getConstraint (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named Constraint.
 
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:
 
agx::Constraint * getConstraint (const agx::Uuid &uuid, bool recursive=true)
 Find and return a pointer to a Constraint with the given uuid.
 
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.
 
agx::Constraint1DOF * getConstraint1DOF (const agx::Name &name, bool recursive=true)
 
agx::Constraint2DOF * getConstraint2DOF (const agx::Name &name, bool recursive=true)
 
const agx::ConstraintRefSetVector & getConstraints () const
 
const agx::EmitterRefSetVector & getEmitters () const
 
const EventListenerRefSetVector & getEventListeners () const
 
virtual agx::Frame * getFrame ()
 Return a reference to the frame containing transformation and velocity information for this assembly.
 
virtual const agx::Frame * getFrame () const
 
const agxCollide::GeometryRefSetVector & getGeometries () const
 
agxCollide::Geometry * getGeometry (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named collision Geometry.
 
const agxCollide::Geometry * getGeometry (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named collision Geometry.
 
agxCollide::Geometry * getGeometry (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return a Geometry matching the given uuid.
 
const agxCollide::Geometry * getGeometry (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return a Geometry matching the given uuid.
 
const agx::InteractionRefSetVector & getInteractions () const
 
agx::Vec3 getLocalPosition () const
 
agx::Quat getLocalRotation () const
 
const agx::AffineMatrix4x4 & getLocalTransform () const
 
const agx::MergedBodyRefSetVector & getMergedBodies () const
 
agx::MergedBody * getMergedBody (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an MergedBody matching the given uuid.
 
const agx::MergedBody * getMergedBody (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an MergedBody matching the given uuid.
 
agx::Name getName () const
 
agx::ObserverFrame * getObserverFrame (const agx::Name &name, bool recursive=true)
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFrame * getObserverFrame (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
agx::ObserverFrame * getObserverFrame (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFrame * getObserverFrame (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFrameRefSetVector & getObserverFrames () const
 
Assembly * getParent ()
 
const Assembly * getParent () const
 
agx::Frame * getParentFrame ()
 
const agx::Frame * getParentFrame () const
 
const agx::ParticleSystemRefSetVector & getParticleSystems () const
 
const agx::RigidBodyRefSetVector & getRigidBodies () const
 
agx::RigidBody * getRigidBody (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named RigidBody.
 
const agx::RigidBody * getRigidBody (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named RigidBody.
 
agx::RigidBody * getRigidBody (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return a pointer to a RigidBody with the given uuid.
 
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.
 
agxSDK::Simulation * getSimulation ()
 
const agxSDK::Simulation * getSimulation () const
 
agxSDK::TerrainInstance * getTerrainInstance (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an TerrainInstance matching the given uuid.
 
const agxSDK::TerrainInstance * getTerrainInstance (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an TerrainInstance matching the given uuid.
 
const agxSDK::TerrainInstanceRefSetVector & getTerrainInstances () const
 
agxSDK::TerrainToolInstance * getTerrainToolInstance (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an TerrainToolInstance matching the given uuid.
 
const agxSDK::TerrainToolInstance * getTerrainToolInstance (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an TerrainToolInstance matching the given uuid.
 
const agxSDK::TerrainToolInstanceRefSetVector & getTerrainToolInstances () const
 
Type getType () const
 
bool remove (agx::Constraint *constraint)
 Remove a constraint from this assembly (does not recurse down in tree).
 
bool remove (agx::ContactMaterial *contactMaterial)
 Remove a contact material from this assembly.
 
bool remove (agx::Emitter *emitter)
 Remove an emitter from this assembly.
 
bool remove (agx::Interaction *interaction)
 Remove an interaction from this assembly.
 
bool remove (agx::MergedBody *mergedBody)
 Remove a MergedBody from this assembly.
 
bool remove (agx::ObserverFrame *observerFrame, bool resetParentFrame=true)
 Remove an ObserverFrame from this assembly.
 
bool remove (agx::RigidBody *body, bool removeAssociatedGeometries=false, bool resetParentFrame=true)
 Remove a rigid body from this assembly (does not recurse down in tree).
 
bool remove (agxCollide::Geometry *geometry, bool resetParentFrame=true)
 Remove a geometry from this assembly (does not recurse down in tree).
 
bool remove (agxSDK::TerrainInstance *terrainInstance)
 Remove a TerrainInstance from this assembly.
 
bool remove (agxSDK::TerrainToolInstance *toolInstance)
 Remove a TerrainToolInstance from this assembly.
 
bool remove (Assembly *assembly, bool resetParentFrame=true)
 Remove a child assembly from a parent.
 
bool remove (EventListener *listener)
 Remove an EventListener from the assembly.
 
virtual void removeNotification (agxSDK::Simulation *)
 Called when this assembly is removed from a simulation.
 
virtual void removeNotification (Assembly *)
 Called when this assembly is removed from another assembly.
 
bool reset (bool resetParentFrame=true)
 If this assembly is not added to a simulation it will clear all added bodies etc.
 
virtual void setAngularVelocity (const agx::Vec3 &velocity)
 Set the angular velocity (in world frame) recursively for all rigid bodies stored in assembly.
 
void setLocalPosition (agx::Real x, agx::Real y, agx::Real z)
 Set the position of the assembly relative to its frame's parent frame.
 
void setLocalPosition (const agx::Vec3 &p)
 Set the position of the assembly relative to its frame's parent frame.
 
void setLocalRotation (const agx::EulerAngles &e)
 Set the rotation of the assembly relative to its frame's parent frame.
 
void setLocalRotation (const agx::Quat &q)
 Set the rotation of the assembly relative to its frame's parent frame.
 
void setLocalTransform (const agx::AffineMatrix4x4 &matrix)
 Assign the local transformation matrix for this assembly, ignoring any eventual parent transformation.
 
void setName (const agx::Name &name)
 Set the name of this Assembly.
 
bool setParentFrame (agx::Frame *frame)
 Set the parent frame of this assembly's frame.
 
void setPosition (agx::Real x, agx::Real y, agx::Real z)
 Set the position of the frame in world coordinates.
 
void setPosition (const agx::Vec3 &p)
 Set the position of the frame in world coordinates.
 
void setRotation (const agx::EulerAngles &e)
 Set the rotation of the assembly relative to world frame.
 
void setRotation (const agx::OrthoMatrix3x3 &m)
 Set the rotation of the assembly relative to world frame.
 
void setRotation (const agx::Quat &q)
 Set the rotation of the assembly relative to world frame.
 
void setTransform (const agx::AffineMatrix4x4 &matrix)
 Set the transform of the assembly.
 
virtual void setVelocity (const agx::Vec3 &velocity)
 Set the linear velocity (in world frame) recursively for all rigid bodies stored in assembly.
 
bool transfer (agxSDK::Assembly *target)
 Transfer all the content from this assembly to the target, including name and transformation.
 
virtual void traverse (AssemblyVisitor *visitor)
 Traverse the assembly tree recursively using a visitor.
 
virtual void traverse (const AssemblyVisitor *visitor) const
 
- 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 agxStream::Serializable * create (agxStream::InputArchive &)
 
static agxPowerLine::PowerLine * find (agxSDK::Assembly *assembly, const agx::Name &name)
 Search the given assembly for a power line with the given name.
 
static agxPowerLine::PowerLine * find (agxSDK::Simulation *simulation, const agx::Name &name)
 Search the given simulation for a power line with the given name.
 
static PowerLinePtrVector findAll (const agxSDK::Simulation *simulation)
 Finds all powerlines in the given simulation.
 
static PowerLinePtrVector findAll (const agxSDK::Simulation *simulation, const agx::Name &name)
 Find all powerlines with given name.
 
static bool renderDebug ()
 
- Static Public Member Functions inherited from agxSDK::Assembly
static Assembly * asAssembly (agxStream::Serializable *obj)
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
- 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 Member Functions

virtual ~PowerLine ()
 
virtual void initialize ()
 
void post (agx::Real time)
 
void pre (agx::Real time)
 
void prepareConstraintDimensions ()
 
bool preUpdateGraph ()
 
void restorePre46 (agxStream::InputArchive &in)
 
void setUnitPowerLine (agxPowerLine::Unit *unit)
 Set the given Unit's PowerLine to this.
 
bool traverseConnectors (bool(*callback)(agxPowerLine::Connector *))
 
bool traverseDimensions (bool(*callback)(agxPowerLine::PhysicalDimension *))
 
bool traverseUnits (bool(*callback)(agxPowerLine::Unit *))
 
- Protected Member Functions inherited from agxSDK::Assembly
 Assembly (Type type)
 
virtual ~Assembly ()
 Destructor.
 
bool addParticleSystem (agx::ParticleSystem *particleSystem)
 Add a particle system to this assembly.
 
void addToSimulation (Simulation *simulation)
 
void removeFromSimulation (Simulation *simulation)
 
bool removeParticleSystem (agx::ParticleSystem *particleSystem)
 Remove a particle system from this assembly.
 
- 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

bool m_addOnConnect
 
bool m_cacheAddsAndRemoves
 
agxPowerLine::SubGraphRefVector m_cachedAdds
 
agxPowerLine::SubGraphRefVector m_cachedRemoves
 
agxPowerLine::ConnectorRefSet m_connectors
 
agxUtil::ConstraintHolderRef m_constraintHolder
 
agx::observer_ptr< agx::RigidBody > m_parentBody
 
agxPowerLine::SlotMapperRef m_slotMapper
 
agx::Constraint::SolveType m_solveType
 
ConnectorBoolHashVector m_tempConnectorHashVector
 
SubGraphRouterBoolHashVector m_tempRouterHashVector
 
agxPowerLine::UnitRefSetVector m_units
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Public Types inherited from agxSDK::Assembly
enum  Type { ASSEMBLY , COLLECTION }
 Specifies the type an assembly is. More...
 
- 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.
 

Detailed Description

PowerLine is the base class for a system of power transfer integrated into the rigid body simulation.

Definition at line 65 of file PowerLine.h.

Constructor & Destructor Documentation

◆ PowerLine()

agxPowerLine::PowerLine::PowerLine ( )

◆ ~PowerLine()

virtual agxPowerLine::PowerLine::~PowerLine ( )
protectedvirtual

Member Function Documentation

◆ add() [1/2]

bool agxPowerLine::PowerLine::add ( agxPowerLine::SubGraph *  component)

◆ add() [2/2]

bool agxPowerLine::PowerLine::add ( agxPowerLine::Unit *  component)

OBSOLETE SINCE ROOT STRUCTURE

------------------------------------------------------------------------------------—

◆ addNotification() [1/2]

virtual void agxPowerLine::PowerLine::addNotification ( agxSDK::Assembly *  )
inlineoverridevirtual

Called when this assembly is added to another assembly.

Reimplemented from agxSDK::Assembly.

Definition at line 191 of file PowerLine.h.

◆ addNotification() [2/2]

virtual void agxPowerLine::PowerLine::addNotification ( agxSDK::Simulation *  )
overridevirtual

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

Reimplemented from agxSDK::Assembly.

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE()

agxPowerLine::PowerLine::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( agxPowerLine::PowerLine  )

◆ cacheAdd()

bool agxPowerLine::PowerLine::cacheAdd ( agxPowerLine::SubGraph *  component)

◆ cacheRemove()

bool agxPowerLine::PowerLine::cacheRemove ( agxPowerLine::SubGraph *  component)

◆ clearAddRemoveCache()

void agxPowerLine::PowerLine::clearAddRemoveCache ( ConnectorPtrVector &  addedConnectors,
UnitPtrVector &  addedUnits 
)

◆ collectConstraintsToHolder()

void agxPowerLine::PowerLine::collectConstraintsToHolder ( )

◆ create()

static agxStream::Serializable * agxPowerLine::PowerLine::create ( agxStream::InputArchive &  )
inlinestatic

Definition at line 221 of file PowerLine.h.

◆ createConstraintHolder()

void agxPowerLine::PowerLine::createConstraintHolder ( )

Creates a constraint holder for all elementary constraints between the physical dimensions.

◆ find() [1/2]

static agxPowerLine::PowerLine * agxPowerLine::PowerLine::find ( agxSDK::Assembly *  assembly,
const agx::Name &  name 
)
static

Search the given assembly for a power line with the given name.

Parameters
assembly- The assembly to search in.
name- The name of the power line to search for.
Returns
A power line with name name in assembly assembly, or nullptr.

◆ find() [2/2]

static agxPowerLine::PowerLine * agxPowerLine::PowerLine::find ( agxSDK::Simulation *  simulation,
const agx::Name &  name 
)
static

Search the given simulation for a power line with the given name.

Parameters
simulation- The simulation to search in.
name- The name of the power line to search for.
Returns
A power line with name name in simulation simulation, or nullptr.

◆ findAll() [1/2]

static PowerLinePtrVector agxPowerLine::PowerLine::findAll ( const agxSDK::Simulation *  simulation)
static

Finds all powerlines in the given simulation.

Parameters
simulation- simulation with powerlines.
Returns
vector of powerlines

◆ findAll() [2/2]

static PowerLinePtrVector agxPowerLine::PowerLine::findAll ( const agxSDK::Simulation *  simulation,
const agx::Name &  name 
)
static

Find all powerlines with given name.

Parameters
simulation- simulation the terrain is part of
name- name of the powerlines
Returns
vector of powerlines

◆ getAddUnitsOnConnect()

agx::Bool agxPowerLine::PowerLine::getAddUnitsOnConnect ( ) const

◆ getConnectors()

const agxPowerLine::ConnectorRefSet & agxPowerLine::PowerLine::getConnectors ( ) const

◆ getConstraintHolder()

agxUtil::ConstraintHolder * agxPowerLine::PowerLine::getConstraintHolder ( ) const
Returns
pointer to the constraint holder.

◆ getDimensionType()

int agxPowerLine::PowerLine::getDimensionType ( std::string  name)
Returns
the indexed value for a named physical dimension. Will index a non existing name by a call to bool addPhysicalDimension(std::string name);
-1 if the name is not indexed and the name fails to be indexed(how?).

◆ getNumConnectors()

size_t agxPowerLine::PowerLine::getNumConnectors ( ) const

◆ getNumUnits()

size_t agxPowerLine::PowerLine::getNumUnits ( ) const

◆ getRoots()

void agxPowerLine::PowerLine::getRoots ( agxPowerLine::UnitPtrPowerLinePtrHashVector &  units) const

Get pointers to all roots, each connected to a sub graph.

the root set will be increased in size for each new root. (Existing roots are to remain in set).

◆ getSlotMapper()

agxPowerLine::SlotMapper * agxPowerLine::PowerLine::getSlotMapper ( )

◆ getSolveType()

agx::Constraint::SolveType agxPowerLine::PowerLine::getSolveType ( ) const
Returns
the current solve type

◆ getSource() [1/2]

agxPowerLine::Unit * agxPowerLine::PowerLine::getSource ( )

◆ getSource() [2/2]

const agxPowerLine::Unit * agxPowerLine::PowerLine::getSource ( ) const
Returns
pointer to the source unit.

◆ getUnit() [1/3]

Unit * agxPowerLine::PowerLine::getUnit ( const agx::Name &  name)

Find and return the first unit with the given name, if any exist.

Will do a linear search through all units.

Parameters
name- The name of the unit to get.
Returns
A unit with the given name, or nullptr.

◆ getUnit() [2/3]

template<typename T >
T * agxPowerLine::PowerLine::getUnit ( const agx::Name &  name)

Definition at line 327 of file PowerLine.h.

References m_units.

◆ getUnit() [3/3]

const Unit * agxPowerLine::PowerLine::getUnit ( const agx::Name &  name) const

Find and return the first unit with the given name, if any exist.

Will do a linear search through all units.

Parameters
name- The name of the unit to get.
Returns
A unit with the given name, or nullptr.

◆ getUnits()

◆ hasCachedOperations()

bool agxPowerLine::PowerLine::hasCachedOperations ( ) const

◆ initialize()

virtual void agxPowerLine::PowerLine::initialize ( )
protectedvirtual

◆ insertConnectorTemporary()

void agxPowerLine::PowerLine::insertConnectorTemporary ( Connector *  connector)

◆ insertSubGraphRouterTemporary()

void agxPowerLine::PowerLine::insertSubGraphRouterTemporary ( SubGraph *  router)

◆ pointAddConnector()

bool agxPowerLine::PowerLine::pointAddConnector ( agxPowerLine::Connector *  connector)

◆ pointAddUnit()

bool agxPowerLine::PowerLine::pointAddUnit ( agxPowerLine::Unit *  unit)

◆ pointReplace()

bool agxPowerLine::PowerLine::pointReplace ( agxPowerLine::Unit *  oldUnit,
agxPowerLine::Unit *  newUnit 
)

◆ post()

void agxPowerLine::PowerLine::post ( agx::Real  time)
protected

◆ pre()

void agxPowerLine::PowerLine::pre ( agx::Real  time)
protected

◆ prepareConstraintDimensions()

void agxPowerLine::PowerLine::prepareConstraintDimensions ( )
protected

◆ preUpdateGraph()

bool agxPowerLine::PowerLine::preUpdateGraph ( )
protected

◆ remove()

bool agxPowerLine::PowerLine::remove ( agxPowerLine::SubGraph *  component)

◆ removeConnector()

bool agxPowerLine::PowerLine::removeConnector ( agxPowerLine::Connector *  connector)

◆ removeNotification() [1/2]

virtual void agxPowerLine::PowerLine::removeNotification ( agxSDK::Assembly *  )
inlineoverridevirtual

Called when this assembly is removed from another assembly.

Reimplemented from agxSDK::Assembly.

Definition at line 197 of file PowerLine.h.

◆ removeNotification() [2/2]

virtual void agxPowerLine::PowerLine::removeNotification ( agxSDK::Simulation *  )
overridevirtual

Called when this assembly is removed from a simulation.

Reimplemented from agxSDK::Assembly.

◆ removeSubGraph()

bool agxPowerLine::PowerLine::removeSubGraph ( agxPowerLine::SubGraph *  component)

◆ removeUnit()

bool agxPowerLine::PowerLine::removeUnit ( agxPowerLine::Unit *  unit)

◆ renderDebug()

static bool agxPowerLine::PowerLine::renderDebug ( )
static

◆ restore()

virtual bool agxPowerLine::PowerLine::restore ( agxStream::StorageStream &  str)
virtual

Restores internal data from stream.

Both the PowerLine and the StorgeStream may be left in an inconsistent state if an error occurs during restore.

Parameters
str- The stream to read from. Must be in RESTORE mode.
Returns
True if the restore was successfull. False otherwise.

◆ restorePre46()

void agxPowerLine::PowerLine::restorePre46 ( agxStream::InputArchive &  in)
protected

◆ setAddUnitsOnConnect()

void agxPowerLine::PowerLine::setAddUnitsOnConnect ( agx::Bool  addOnConnect)

Decide if: when units added to this powerLine are to be connected to units not belonging to any power line will be added to this power line, or not.

◆ setSolveType()

void agxPowerLine::PowerLine::setSolveType ( agx::Constraint::SolveType  solveType)

Set the current solve type DIRECT_AND_ITERATIVE is used by default.

◆ setSource() [1/2]

bool agxPowerLine::PowerLine::setSource ( agxPowerLine::SubGraph *  source)

◆ setSource() [2/2]

bool agxPowerLine::PowerLine::setSource ( agxPowerLine::Unit *  source)

Set the unit the traverser shall start traversing from.


------------------------------------------------------------------------------------—

OBSOLETE SINCE ROOT STRUCTURE

◆ setUnitPowerLine()

void agxPowerLine::PowerLine::setUnitPowerLine ( agxPowerLine::Unit *  unit)
protected

Set the given Unit's PowerLine to this.

Used by unit tests to circumvent a full PowerLine::add(Unit*).

◆ store()

virtual bool agxPowerLine::PowerLine::store ( agxStream::StorageStream &  str) const
virtual

Stores internal data for this PowerLine into stream.

The StorageStream may be left in an inconsistent state if an error occurs.

Parameters
str- Stream to write into. Must be in STORE mode.
Returns
True if the store was successful. False otherwise.

◆ traverseConnectors()

bool agxPowerLine::PowerLine::traverseConnectors ( bool(*)(agxPowerLine::Connector *)  callback)
protected

◆ traverseDimensions()

bool agxPowerLine::PowerLine::traverseDimensions ( bool(*)(agxPowerLine::PhysicalDimension *)  callback)
protected

◆ traverseUnits()

bool agxPowerLine::PowerLine::traverseUnits ( bool(*)(agxPowerLine::Unit *)  callback)
protected

◆ writeDimensionsGraph() [1/2]

bool agxPowerLine::PowerLine::writeDimensionsGraph ( const agx::String &  path) const

Write the current graph state of the powerline to a .dot file (path)

Returns
true if successful.

◆ writeDimensionsGraph() [2/2]

bool agxPowerLine::PowerLine::writeDimensionsGraph ( const char *  path) const

Member Data Documentation

◆ m_addOnConnect

bool agxPowerLine::PowerLine::m_addOnConnect
protected

Definition at line 313 of file PowerLine.h.

◆ m_cacheAddsAndRemoves

bool agxPowerLine::PowerLine::m_cacheAddsAndRemoves
protected

Definition at line 322 of file PowerLine.h.

◆ m_cachedAdds

agxPowerLine::SubGraphRefVector agxPowerLine::PowerLine::m_cachedAdds
protected

Definition at line 320 of file PowerLine.h.

◆ m_cachedRemoves

agxPowerLine::SubGraphRefVector agxPowerLine::PowerLine::m_cachedRemoves
protected

Definition at line 321 of file PowerLine.h.

◆ m_connectors

agxPowerLine::ConnectorRefSet agxPowerLine::PowerLine::m_connectors
protected

Definition at line 305 of file PowerLine.h.

◆ m_constraintHolder

agxUtil::ConstraintHolderRef agxPowerLine::PowerLine::m_constraintHolder
protected

Definition at line 311 of file PowerLine.h.

◆ m_parentBody

agx::observer_ptr<agx::RigidBody> agxPowerLine::PowerLine::m_parentBody
protected

Definition at line 309 of file PowerLine.h.

◆ m_slotMapper

agxPowerLine::SlotMapperRef agxPowerLine::PowerLine::m_slotMapper
protected

Definition at line 307 of file PowerLine.h.

◆ m_solveType

agx::Constraint::SolveType agxPowerLine::PowerLine::m_solveType
protected

Definition at line 315 of file PowerLine.h.

◆ m_tempConnectorHashVector

ConnectorBoolHashVector agxPowerLine::PowerLine::m_tempConnectorHashVector
protected

Definition at line 318 of file PowerLine.h.

◆ m_tempRouterHashVector

SubGraphRouterBoolHashVector agxPowerLine::PowerLine::m_tempRouterHashVector
protected

Definition at line 317 of file PowerLine.h.

◆ m_units

agxPowerLine::UnitRefSetVector agxPowerLine::PowerLine::m_units
protected

Definition at line 304 of file PowerLine.h.

Referenced by getUnit().


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