|
AGX Dynamics 2.42.3.1
|
Pure virtual class. More...
#include <PhysicalDimension.h>
Inheritance diagram for agxPowerLine::PhysicalDimension:Public Types | |
| typedef int | Type |
| typedef agx::Vector< Type > | TypeVector |
Public Member Functions | |
| virtual void | addLoad (agx::Real load) |
| Add a load to the dimension. | |
| AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agxPowerLine::PhysicalDimension) | |
| virtual void | calculateJacobian (agx::Jacobian6DOFElement *G, const agx::Real ratio, const size_t index) const |
| Calculates jacobian for a physical dimension. | |
| virtual void | clear () |
| Clear all reference pointers. | |
| bool | connect (agxPowerLine::PhysicalDimension *otherDimension, agxPowerLine::Connector *connector) |
| Connect to another dimension for possible power transfer. | |
| agxPowerLine::detail::AbstractDimensionState1Dof * | get1DofState () |
| Access the DimensionState as a 1-dimensional state. | |
| const agxPowerLine::detail::AbstractDimensionState1Dof * | get1DofState () const |
| agxPowerLine::detail::AbstractDimensionState3Dof * | get3DofState () |
| Access the DimensionState as a 3-dimensional state. | |
| const agxPowerLine::detail::AbstractDimensionState3Dof * | get3DofState () const |
| size_t | getBodyIndexIn (const RigidBodyPtrIntHashVector &bodyToIndexTable) |
| Connection * | getConnection (const Connector *connector, agxPowerLine::Side side) |
| Find the Connection object on the given side that connects to the given Connectors. | |
| const Connection * | getConnection (const Connector *connector, agxPowerLine::Side side) const |
| const agxPowerLine::ConnectionRefVector & | getConnections (agxPowerLine::Side side) const |
| agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation * | getConstraint (size_t outputConnection=0) const |
| virtual agx::Real | getGradient () const |
| Connection * | getInputConnection (const Connector *connector) |
| const Connection * | getInputConnection (const Connector *connector) const |
| Connection * | getInputConnection (const Unit *unit) |
| const Connection * | getInputConnection (const Unit *unit) const |
| agxPowerLine::Connection * | getInputConnection (size_t inputIndex=0) |
| const agxPowerLine::Connection * | getInputConnection (size_t inputIndex=0) const |
| Traversing helper functions. | |
| const agxPowerLine::ConnectionRefVector & | getInputConnections () const |
| agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation * | getInputConstraint (size_t inputConnection=0) const |
| virtual agx::Real | getInputLoad () const |
| return the load in/out | |
| virtual agx::Real | getMassProperty () const |
| returns the mass property of the dimension body. | |
| const agx::Name & | getName () const |
| Returns the name of this PhysicalDimension instance. | |
| size_t | getNumConnections () const |
| size_t | getNumConnections (agxPowerLine::Side side) const |
| size_t | getNumInputConnections () const |
| size_t | getNumOutputConnections () const |
| agx::RigidBody * | getOrReserveBody () |
| Return a body that is guaranteed to not be shared with any other PhysicalDimension. | |
| Connection * | getOutputConnection (const Connector *connector) |
| const Connection * | getOutputConnection (const Connector *connector) const |
| Connection * | getOutputConnection (const Unit *unit) |
| const Connection * | getOutputConnection (const Unit *unit) const |
| agxPowerLine::Connection * | getOutputConnection (size_t outputIndex=0) |
| const agxPowerLine::Connection * | getOutputConnection (size_t outputIndex=0) const |
| const agxPowerLine::ConnectionRefVector & | getOutputConnections () const |
| virtual agx::Real | getOutputLoad () const |
| virtual agx::Real | getPowerIn () const |
| return the power in/out | |
| virtual agx::Real | getPowerOut () const |
| agx::RigidBody * | getReservedBody () |
| Return a body that is guaranteed to not be shared with any other PhysicalDimension. | |
| const agx::RigidBody * | getReservedBody () const |
| virtual agx::Real | getSecondGradient () const |
| agxPowerLine::detail::DimensionState * | getState () |
| Provides direct access to the underlying DimensionState. | |
| const agxPowerLine::detail::DimensionState * | getState () const |
| agxPowerLine::PhysicalDimension::Type | getType () const |
| returns the PhysicalDimension::Type of this dimension | |
| virtual std::string | getTypeName () const |
| Returns the dimension type name of this PhysicalDimension instance. | |
| agxPowerLine::Unit * | getUnit () |
| const agxPowerLine::Unit * | getUnit () const |
| Returns pointer to the Unit that contains this dimension. | |
| virtual agx::Real | getValue () const |
| Physical properties of the dimension. | |
| float | getVelocityDamping () const |
| agx::Vec3 | getWorldDirection () const |
| bool | hasReservedBody () const |
| bool | isExternalBody () const |
| Return true if the body that defines the dimension was given to the Power- Line, false if the body was created by the PowerLine. | |
| virtual void | renderDebug () |
| Implement this to render Your physical dimension. | |
| void | reserveBody () |
| Ensure that this PhysicalDimension does not share it's body with any other PhysicalDimension. | |
| virtual void | restore (agxStream::InputArchive &in) override |
| void | restore (agxStream::InputArchive &in, agx::RigidBody *&body, bool &externalBody) |
| virtual bool | restore (agxStream::StorageStream &in) |
| Restores internal data from stream. | |
| virtual void | setGradient (agx::Real value) |
| virtual void | setMassProperty (agx::Real massProperty) |
| Set the mass property of the dimension. | |
| void | setName (const agx::Name &name) |
| virtual void | setValue (agx::Real value) |
| void | setVelocityDamping (float damping) |
| virtual void | store (agxStream::OutputArchive &out) const override |
| virtual bool | store (agxStream::StorageStream &str) const |
| Stores internal data into stream. | |
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 int | getNumberOfPhysicalDimensions () |
| static agxPowerLine::PhysicalDimension::Type | getStaticType () |
| static std::string | getStaticTypeName () |
| Returns the dimension type name of PhysicalDimension. | |
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 | |
| PhysicalDimension () | |
| PhysicalDimension (agxPowerLine::Unit *unit, agxPowerLine::PhysicalDimension::Type type, agxPowerLine::detail::DimensionState *state) | |
| virtual | ~PhysicalDimension () |
| void | addNotification (agxPowerLine::PowerLine *powerLine) |
| void | addNotification (agxSDK::Simulation *simulation) |
| Called when the Unit owning this PhysicalDimension is added to a simulation. | |
| void | addToListOfDimensions () |
| Add to singleton that controls the different types of physical dimensions. | |
| agxPowerLine::ConnectionRefVector & | getConnectionsWritable (agxPowerLine::Side side) |
| bool | removeInputConnection (Connection *connection) |
| void | removeNotification (agxPowerLine::PowerLine *powerLine) |
| void | removeNotification (agxSDK::Simulation *simulation) |
| virtual void | removeNotification (agxSDK::Simulation *simulation, agxUtil::ConstraintHolder *constraintHolder) |
| Remove the PhysicalDimension from the simulation. | |
| bool | removeOutputConnection (Connection *connection) |
| bool | restore (agxStream::StorageStream &in, const agx::Vec3 *direction) |
| Some serialization versions stored the dimension axis direction in classes deriving from PhysicalDimension. | |
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 | |
| ConnectionRefVector | m_inputConnections |
| agx::Name | m_name |
| ConnectionRefVector | m_outputConnections |
| agxPowerLine::detail::PhysicalDimensionStateRef | m_state |
| PhysicalDimension::Type | m_type |
| Unit * | m_unit |
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. | |
Pure virtual class.
Base class for representation of one physical dimension. It contains one 1D body(right now it is a agx::RigidBody that is potentially shared with other PhysicalDimensions), that is used in the dynamics solve.
The dimension could be for example a 1D position or a 1D rotation. The dimension has a:
Definition at line 92 of file PhysicalDimension.h.
| typedef int agxPowerLine::PhysicalDimension::Type |
Definition at line 95 of file PhysicalDimension.h.
Definition at line 96 of file PhysicalDimension.h.
|
protected |
|
protected |
|
protectedvirtual |
|
virtual |
Add a load to the dimension.
The effect depends on the type of the dimension.
|
protected |
|
protected |
Called when the Unit owning this PhysicalDimension is added to a simulation.
The body backing this PhysicalDimension is then added to the same simulation.
|
protected |
Add to singleton that controls the different types of physical dimensions.
(PowerLineDimensionNameSingleton)
| agxPowerLine::PhysicalDimension::AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE | ( | agxPowerLine::PhysicalDimension | ) |
|
virtual |
Calculates jacobian for a physical dimension.
| G | - Array of Jacobian elements to be filled in. |
| ratio | - Scaling to apply in order to convert the dimension's unit direction to a constraint Jacobian. |
| index | - Index in G to write to. |
|
virtual |
Clear all reference pointers.
| bool agxPowerLine::PhysicalDimension::connect | ( | agxPowerLine::PhysicalDimension * | otherDimension, |
| agxPowerLine::Connector * | connector | ||
| ) |
Connect to another dimension for possible power transfer.
| otherDimension | - a physical dimension with a body defining another dof. |
| connector | - defines the constraint between the dimensions |
| agxPowerLine::detail::AbstractDimensionState1Dof * agxPowerLine::PhysicalDimension::get1DofState | ( | ) |
Access the DimensionState as a 1-dimensional state.
Will return nullptr if the PhysicalDimension has a 3-dimensional DimensionState.
| const agxPowerLine::detail::AbstractDimensionState1Dof * agxPowerLine::PhysicalDimension::get1DofState | ( | ) | const |
| agxPowerLine::detail::AbstractDimensionState3Dof * agxPowerLine::PhysicalDimension::get3DofState | ( | ) |
Access the DimensionState as a 3-dimensional state.
Will return nullptr if the PhysicalDimension has a 1-dimensional DimensionState.
| const agxPowerLine::detail::AbstractDimensionState3Dof * agxPowerLine::PhysicalDimension::get3DofState | ( | ) | const |
| size_t agxPowerLine::PhysicalDimension::getBodyIndexIn | ( | const RigidBodyPtrIntHashVector & | bodyToIndexTable | ) |
| Connection * agxPowerLine::PhysicalDimension::getConnection | ( | const Connector * | connector, |
| agxPowerLine::Side | side | ||
| ) |
Find the Connection object on the given side that connects to the given Connectors.
Returns nullptr if there is no such Connection.
| connector | - The Connector to search for. |
| side | - The side of this PhysicalDimension to search on. |
| const Connection * agxPowerLine::PhysicalDimension::getConnection | ( | const Connector * | connector, |
| agxPowerLine::Side | side | ||
| ) | const |
| const agxPowerLine::ConnectionRefVector & agxPowerLine::PhysicalDimension::getConnections | ( | agxPowerLine::Side | side | ) | const |
|
protected |
| agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation * agxPowerLine::PhysicalDimension::getConstraint | ( | size_t | outputConnection = 0 | ) | const |
|
virtual |
| Connection * agxPowerLine::PhysicalDimension::getInputConnection | ( | const Connector * | connector | ) |
| const Connection * agxPowerLine::PhysicalDimension::getInputConnection | ( | const Connector * | connector | ) | const |
| Connection * agxPowerLine::PhysicalDimension::getInputConnection | ( | const Unit * | unit | ) |
| const Connection * agxPowerLine::PhysicalDimension::getInputConnection | ( | const Unit * | unit | ) | const |
| agxPowerLine::Connection * agxPowerLine::PhysicalDimension::getInputConnection | ( | size_t | inputIndex = 0 | ) |
| const agxPowerLine::Connection * agxPowerLine::PhysicalDimension::getInputConnection | ( | size_t | inputIndex = 0 | ) | const |
Traversing helper functions.
Has to be public. Do NOT use them.
| const agxPowerLine::ConnectionRefVector & agxPowerLine::PhysicalDimension::getInputConnections | ( | ) | const |
| agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation * agxPowerLine::PhysicalDimension::getInputConstraint | ( | size_t | inputConnection = 0 | ) | const |
|
virtual |
return the load in/out
Reimplemented in agxHydraulics::FlowDimension.
|
virtual |
returns the mass property of the dimension body.
( Inertia for the rotational dimension, mass for translational dimension, ... )
Reimplemented in agxPowerLine::RotationalDimension.
| const agx::Name & agxPowerLine::PhysicalDimension::getName | ( | ) | const |
Returns the name of this PhysicalDimension instance.
There are two types of names for a PhysicalDimension: the instance name and the type name. The instance name can be set by the user and the type name is an indentifier for a type of PhysicalDimension. For example, all RotationalDimensions have the same type name but may have different instance names.
|
static |
| size_t agxPowerLine::PhysicalDimension::getNumConnections | ( | ) | const |
| size_t agxPowerLine::PhysicalDimension::getNumConnections | ( | agxPowerLine::Side | side | ) | const |
| size_t agxPowerLine::PhysicalDimension::getNumInputConnections | ( | ) | const |
| size_t agxPowerLine::PhysicalDimension::getNumOutputConnections | ( | ) | const |
| agx::RigidBody * agxPowerLine::PhysicalDimension::getOrReserveBody | ( | ) |
Return a body that is guaranteed to not be shared with any other PhysicalDimension.
May create a new body for this PhysicalDimension.
| Connection * agxPowerLine::PhysicalDimension::getOutputConnection | ( | const Connector * | connector | ) |
| const Connection * agxPowerLine::PhysicalDimension::getOutputConnection | ( | const Connector * | connector | ) | const |
| Connection * agxPowerLine::PhysicalDimension::getOutputConnection | ( | const Unit * | unit | ) |
| const Connection * agxPowerLine::PhysicalDimension::getOutputConnection | ( | const Unit * | unit | ) | const |
| agxPowerLine::Connection * agxPowerLine::PhysicalDimension::getOutputConnection | ( | size_t | outputIndex = 0 | ) |
| const agxPowerLine::Connection * agxPowerLine::PhysicalDimension::getOutputConnection | ( | size_t | outputIndex = 0 | ) | const |
| const agxPowerLine::ConnectionRefVector & agxPowerLine::PhysicalDimension::getOutputConnections | ( | ) | const |
|
virtual |
Reimplemented in agxHydraulics::FlowDimension, and agxPowerLine::RotationalDimension.
|
virtual |
return the power in/out
Reimplemented in agxHydraulics::FlowDimension, and agxPowerLine::RotationalDimension.
|
virtual |
Reimplemented in agxHydraulics::FlowDimension, and agxPowerLine::RotationalDimension.
| agx::RigidBody * agxPowerLine::PhysicalDimension::getReservedBody | ( | ) |
Return a body that is guaranteed to not be shared with any other PhysicalDimension.
Will return nullptr if no such guarantee can be made.
| const agx::RigidBody * agxPowerLine::PhysicalDimension::getReservedBody | ( | ) | const |
|
virtual |
| agxPowerLine::detail::DimensionState * agxPowerLine::PhysicalDimension::getState | ( | ) |
Provides direct access to the underlying DimensionState.
This should be considered an implementation detail and not called in user code.
| const agxPowerLine::detail::DimensionState * agxPowerLine::PhysicalDimension::getState | ( | ) | const |
|
static |
|
static |
Returns the dimension type name of PhysicalDimension.
This is a static method and should be called as PhysicalDimension::getTypeName and not using . or -> operator on a reference or pointer.
There are two types of names for a PhysicalDimension: the instance name and the type name. The instance name can be set by the user and the type name is an indentifier for a type of PhysicalDimension. For example, all RotationalDimensions have the same type name but may have different instance names.
Each class inheriting from agxModel::Physical dimension HAS TO HAVE a static function that returns a unique name. The power line name singleton will sort and index the different names. The reason for this is that a user could create a physical dimension of his/hers own. The default dimension has name "UNDEFINED"
| agxPowerLine::PhysicalDimension::Type agxPowerLine::PhysicalDimension::getType | ( | ) | const |
returns the PhysicalDimension::Type of this dimension
|
virtual |
Returns the dimension type name of this PhysicalDimension instance.
If the this is a RotationalDimension, then the dimension type name of RotationalDimension is returned.
There are two types of names for a PhysicalDimension: the instance name and the type name. The instance name can be set by the user and the type name is an indentifier for a type of PhysicalDimension. For example, all RotationalDimensions have the same type name but may have different instance names.
Reimplemented in agxHydraulics::FlowDimension, and agxPowerLine::RotationalDimension.
| agxPowerLine::Unit * agxPowerLine::PhysicalDimension::getUnit | ( | ) |
| const agxPowerLine::Unit * agxPowerLine::PhysicalDimension::getUnit | ( | ) | const |
Returns pointer to the Unit that contains this dimension.
|
virtual |
Physical properties of the dimension.
Implement these in child class. (value is for example angle or position. gradient is velocity ...)
| float agxPowerLine::PhysicalDimension::getVelocityDamping | ( | ) | const |
| agx::Vec3 agxPowerLine::PhysicalDimension::getWorldDirection | ( | ) | const |
| bool agxPowerLine::PhysicalDimension::hasReservedBody | ( | ) | const |
| bool agxPowerLine::PhysicalDimension::isExternalBody | ( | ) | const |
Return true if the body that defines the dimension was given to the Power- Line, false if the body was created by the PowerLine.
|
protected |
|
protected |
|
protected |
Called when the Unit owning this PhysicalDimension is removed from a simulation.
/
|
protectedvirtual |
Remove the PhysicalDimension from the simulation.
May only be called if there are no connections to or from the dimension.
|
protected |
|
virtual |
Implement this to render Your physical dimension.
Reimplemented in agxPowerLine::RotationalDimension.
| void agxPowerLine::PhysicalDimension::reserveBody | ( | ) |
Ensure that this PhysicalDimension does not share it's body with any other PhysicalDimension.
A new body may be created for this PhysicalDimension in order to make that guarantee. Body sharing becomes disabled for this PhysicalDimension.
|
overridevirtual |
| void agxPowerLine::PhysicalDimension::restore | ( | agxStream::InputArchive & | in, |
| agx::RigidBody *& | body, | ||
| bool & | externalBody | ||
| ) |
|
virtual |
Restores internal data from stream.
Reimplemented in agxHydraulics::FlowDimension, agxPowerLine::RotationalDimension, and agxPowerLine::ActuatorRotationalDimension.
|
protected |
Some serialization versions stored the dimension axis direction in classes deriving from PhysicalDimension.
When loading such classes from such streams the restoring derived class need to pass the direction into the parent class, since the parent class is unable to read it from the stream.
|
virtual |
|
virtual |
Set the mass property of the dimension.
| void agxPowerLine::PhysicalDimension::setName | ( | const agx::Name & | name | ) |
|
virtual |
| void agxPowerLine::PhysicalDimension::setVelocityDamping | ( | float | damping | ) |
|
overridevirtual |
|
virtual |
Stores internal data into stream.
Reimplemented in agxHydraulics::FlowDimension, agxPowerLine::RotationalDimension, and agxPowerLine::ActuatorRotationalDimension.
|
protected |
Definition at line 446 of file PhysicalDimension.h.
|
protected |
Definition at line 450 of file PhysicalDimension.h.
|
protected |
Definition at line 447 of file PhysicalDimension.h.
|
protected |
Definition at line 449 of file PhysicalDimension.h.
|
protected |
Definition at line 445 of file PhysicalDimension.h.
|
protected |
Definition at line 448 of file PhysicalDimension.h.