AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxPowerLine::detail::DimensionState Class Referenceabstract

A DimensionState is the data carrier of a PhysicalDimension. More...

#include <DimensionState.h>

+ Inheritance diagram for agxPowerLine::detail::DimensionState:

Public Member Functions

virtual void addLoad (agx::Real load)=0
 
virtual void addNotification (agxPowerLine::PowerLine *powerLine)=0
 
virtual void calculateJacobian (agx::Jacobian6DOFElement *G, agx::Real ratio, size_t index) const =0
 
bool getAllowsPacking () const
 
agx::RigidBody * getCurrentBody ()
 Returns the body currently used by this dimension state.
 
const agx::RigidBody * getCurrentBody () const
 
const agxPowerLine::PhysicalDimension * getDimension () const
 
virtual agx::Vec3 getDirection () const =0
 
virtual agxPowerLine::DirectionReference getDirectionReference () const =0
 
virtual agx::Real getGradient () const =0
 
virtual agx::Vec3 getLocalDirection () const =0
 
virtual agx::Real getMassProperty () const =0
 
virtual const agx::RigidBody * getReservedBody () const =0
 
virtual agx::RigidBody * getReservedBody ()=0
 Gives access to a RigidBody that is known to be used by this dimension state only.
 
virtual agx::Real getSecondGradient () const =0
 
virtual agx::Real getValue () const =0
 
virtual float getVelocityDamping ()=0
 
virtual agx::Vec3 getWorldDirection () const =0
 
virtual bool isExternalBody () const =0
 
virtual void postUpdate (agx::Real timeStep)=0
 
virtual void removeNotification (agxPowerLine::PowerLine *powerLine)=0
 
virtual void reserveBody ()=0
 Reserve a body for this dimension state.
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual bool restore (agxStream::StorageStream &in)
 
virtual void setGradient (agx::Real value)=0
 
virtual bool setMassProperty (agx::Real massProperty)=0
 
virtual void setValue (agx::Real value)=0
 
virtual void setVelocityDamping (float damping)=0
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual bool store (agxStream::StorageStream &out) 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.
 

Protected Member Functions

 DimensionState (agx::RigidBody *body, PhysicalDimension *dimension, bool allowPacking)
 
virtual ~DimensionState ()
 
void disallowPacking ()
 Mark is DimensionState as not a candidate for packing.
 
const agx::Frame * getBodyFrame () const
 
agx::Vec3 getWorldPosition () const
 
agx::Vec3 getWorldVelocity () const
 
void setBody (agx::RigidBody *newBody)
 
- 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 ()
 

Additional Inherited Members

- 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.
 
- 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.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

A DimensionState is the data carrier of a PhysicalDimension.

It is reponsible for mapping data stored in the RigidBody into the values and types offered by the PhysicalDimension methods.

DimensionState is pure virtual and a number of subclasses are used to describe various ways of performing the mapping. Each subclass define two properties: number of degrees of freedom and storage location. The storage location dictate where in the RigidBody that the dimension data is stored and can be either translational or rotational. The degrees of freedom is the number of slots the dimension state use in the RigidBody and can be either one or three. If one, then the dimension state owns one particular slot in the rigid body data and other dimension states may own other slots.

Each dimension state has a direction that it either slides along or rotates around. For one dimensional dimension states this direction is always parallel to one of the principal axes, while for the three dimensional dimension states it can be any three dimensional vector. Further more, for three dimensional dimension states the direction can be specified in either local or world coordinates.

Definition at line 71 of file DimensionState.h.

Constructor & Destructor Documentation

◆ DimensionState()

agxPowerLine::detail::DimensionState::DimensionState ( agx::RigidBody *  body,
PhysicalDimension *  dimension,
bool  allowPacking 
)
protected

◆ ~DimensionState()

virtual agxPowerLine::detail::DimensionState::~DimensionState ( )
protectedvirtual

Member Function Documentation

◆ addLoad()

virtual void agxPowerLine::detail::DimensionState::addLoad ( agx::Real  load)
pure virtual

◆ addNotification()

virtual void agxPowerLine::detail::DimensionState::addNotification ( agxPowerLine::PowerLine *  powerLine)
pure virtual

◆ calculateJacobian()

virtual void agxPowerLine::detail::DimensionState::calculateJacobian ( agx::Jacobian6DOFElement *  G,
agx::Real  ratio,
size_t  index 
) const
pure virtual

◆ disallowPacking()

void agxPowerLine::detail::DimensionState::disallowPacking ( )
protected

Mark is DimensionState as not a candidate for packing.

Never call this method on a DimensionState that is currently packed since that would create an invalid state.

Note
Do not call this on a packed DimensionState.

◆ getAllowsPacking()

bool agxPowerLine::detail::DimensionState::getAllowsPacking ( ) const
Returns
True if this dimension state may be packed in a RigidBody with other dimension state.

◆ getBodyFrame()

const agx::Frame * agxPowerLine::detail::DimensionState::getBodyFrame ( ) const
protected

◆ getCurrentBody() [1/2]

agx::RigidBody * agxPowerLine::detail::DimensionState::getCurrentBody ( )

Returns the body currently used by this dimension state.

If getAllowsPacking returns true then the body returned by getCurrentBody may change at any time.

◆ getCurrentBody() [2/2]

const agx::RigidBody * agxPowerLine::detail::DimensionState::getCurrentBody ( ) const

◆ getDimension()

const agxPowerLine::PhysicalDimension * agxPowerLine::detail::DimensionState::getDimension ( ) const
Returns
The PhysicalDimension that uses this dimension state for storage.

◆ getDirection()

virtual agx::Vec3 agxPowerLine::detail::DimensionState::getDirection ( ) const
pure virtual

◆ getDirectionReference()

virtual agxPowerLine::DirectionReference agxPowerLine::detail::DimensionState::getDirectionReference ( ) const
pure virtual

◆ getGradient()

virtual agx::Real agxPowerLine::detail::DimensionState::getGradient ( ) const
pure virtual

◆ getLocalDirection()

virtual agx::Vec3 agxPowerLine::detail::DimensionState::getLocalDirection ( ) const
pure virtual

◆ getMassProperty()

virtual agx::Real agxPowerLine::detail::DimensionState::getMassProperty ( ) const
pure virtual

◆ getReservedBody() [1/2]

virtual const agx::RigidBody * agxPowerLine::detail::DimensionState::getReservedBody ( ) const
pure virtual

◆ getReservedBody() [2/2]

virtual agx::RigidBody * agxPowerLine::detail::DimensionState::getReservedBody ( )
pure virtual

Gives access to a RigidBody that is known to be used by this dimension state only.

Will return nullptr if no such guarantee can be given. Will always return a valid RigidBody if reserveBody has been called on this dimension state.

Implemented in agxPowerLine::detail::DimensionState1Dof< DimensionType >, and agxPowerLine::detail::DimensionState3Dof< DimensionType >.

◆ getSecondGradient()

virtual agx::Real agxPowerLine::detail::DimensionState::getSecondGradient ( ) const
pure virtual

◆ getValue()

virtual agx::Real agxPowerLine::detail::DimensionState::getValue ( ) const
pure virtual

◆ getVelocityDamping()

virtual float agxPowerLine::detail::DimensionState::getVelocityDamping ( )
pure virtual

◆ getWorldDirection()

virtual agx::Vec3 agxPowerLine::detail::DimensionState::getWorldDirection ( ) const
pure virtual

◆ getWorldPosition()

agx::Vec3 agxPowerLine::detail::DimensionState::getWorldPosition ( ) const
protected

◆ getWorldVelocity()

agx::Vec3 agxPowerLine::detail::DimensionState::getWorldVelocity ( ) const
protected

◆ isExternalBody()

virtual bool agxPowerLine::detail::DimensionState::isExternalBody ( ) const
pure virtual
Returns
True if the body used by this dimension state was given by the user. False if it was created by the power line.

Implemented in agxPowerLine::detail::DimensionState1Dof< DimensionType >, and agxPowerLine::detail::DimensionState3Dof< DimensionType >.

◆ postUpdate()

virtual void agxPowerLine::detail::DimensionState::postUpdate ( agx::Real  timeStep)
pure virtual

◆ removeNotification()

virtual void agxPowerLine::detail::DimensionState::removeNotification ( agxPowerLine::PowerLine *  powerLine)
pure virtual

◆ reserveBody()

virtual void agxPowerLine::detail::DimensionState::reserveBody ( )
pure virtual

Reserve a body for this dimension state.

After this call the body used by this dimension state will not be used by any other dimension state and future calls to getAllowsPacking will return false. The dimension state may move to a new RigidBody during reserve.

Implemented in agxPowerLine::detail::DimensionState1Dof< DimensionType >, and agxPowerLine::detail::DimensionState3Dof< DimensionType >.

◆ restore() [1/2]

virtual void agxPowerLine::detail::DimensionState::restore ( agxStream::InputArchive &  in)
overridevirtual

◆ restore() [2/2]

virtual bool agxPowerLine::detail::DimensionState::restore ( agxStream::StorageStream &  in)
virtual

◆ setBody()

void agxPowerLine::detail::DimensionState::setBody ( agx::RigidBody *  newBody)
protected

◆ setGradient()

virtual void agxPowerLine::detail::DimensionState::setGradient ( agx::Real  value)
pure virtual

◆ setMassProperty()

virtual bool agxPowerLine::detail::DimensionState::setMassProperty ( agx::Real  massProperty)
pure virtual

◆ setValue()

virtual void agxPowerLine::detail::DimensionState::setValue ( agx::Real  value)
pure virtual

◆ setVelocityDamping()

virtual void agxPowerLine::detail::DimensionState::setVelocityDamping ( float  damping)
pure virtual

◆ store() [1/2]

virtual void agxPowerLine::detail::DimensionState::store ( agxStream::OutputArchive &  out) const
overridevirtual

◆ store() [2/2]

virtual bool agxPowerLine::detail::DimensionState::store ( agxStream::StorageStream &  out) const
virtual

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