AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxPowerLine::detail::DimensionState1Dof< DimensionType > Class Template Reference

Templated one dimensional dimension state. More...

#include <DimensionState.h>

+ Inheritance diagram for agxPowerLine::detail::DimensionState1Dof< DimensionType >:

Public Member Functions

 DimensionState1Dof (agx::RigidBody *body, agxPowerLine::PhysicalDimension *dimension, agx::UInt8 slot)
 
virtual void addLoad (agx::Real load) override
 
virtual void addNotification (agxPowerLine::PowerLine *powerLine) override
 
virtual void calculateJacobian (agx::Jacobian6DOFElement *G, agx::Real ratio, size_t index) const override
 
virtual const char * getClassName () const override
 
virtual agx::Vec3 getDirection () const override
 
virtual DirectionReference getDirectionReference () const override
 
virtual agx::Real getGradient () const override
 
virtual agx::Vec3 getLocalDirection () const override
 
virtual agx::Real getMassProperty () const override
 
virtual const agx::RigidBody * getReservedBody () const override
 
virtual agx::RigidBody * getReservedBody () override
 Returns a RigidBody that is guaranteed to not be shared with any other DimensionState.
 
virtual agx::Real getSecondGradient () const override
 
virtual agx::UInt8 getSlot () const override
 
SlotMapper * getSlotMapper ()
 
virtual agxStream::StorageAgent * getStorageAgent () const override
 
virtual agx::Real getValue () const override
 
virtual float getVelocityDamping () override
 
virtual agx::Vec3 getWorldDirection () const override
 
virtual bool isExternalBody () const override
 
void move (agx::RigidBody *body, agx::UInt8 slot)
 Make this dimension state use the given body for storage.
 
virtual void postUpdate (agx::Real timeStep) override
 
virtual void removeNotification (agxPowerLine::PowerLine *powerLine) override
 
virtual void reserveBody () override
 Ensure that this DimensionState is the only state using this state's RigidBody.
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual bool restore (agxStream::StorageStream &in) override
 
virtual void setGradient (agx::Real gradient) override
 
virtual bool setMassProperty (agx::Real massProperty) override
 
virtual void setValue (agx::Real value) override
 
virtual void setVelocityDamping (float damping) override
 
void split ()
 Move this DimensionState to a new RigidBody that is guaranteed to not be shared with any other DimensionState.
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual bool store (agxStream::StorageStream &out) const override
 
virtual agx::UInt8 getSlot () const =0
 
- Public Member Functions inherited from agxPowerLine::detail::DimensionState
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.
 

Static Public Member Functions

static agxStream::Serializable * create ()
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static const char * getConstructClassId ()
 
- 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

 DimensionState1Dof ()
 
virtual ~DimensionState1Dof ()
 
void moveImpl (agx::RigidBody *newBody, agx::UInt8 newSlot)
 
void reserveImpl ()
 
void splitImpl ()
 
- Protected Member Functions inherited from agxPowerLine::detail::AbstractDimensionState1Dof
 AbstractDimensionState1Dof (agx::RigidBody *body, agxPowerLine::PhysicalDimension *dimension, bool allowPacking)
 
- Protected Member Functions inherited from agxPowerLine::detail::DimensionState
 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 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

template<typename DimensionType>
class agxPowerLine::detail::DimensionState1Dof< DimensionType >

Templated one dimensional dimension state.

The template type is the rigid body accessor (Translational or Rotational) that is to be used for accessing data in the RigidBody that currenly holds the dimension state data.

Definition at line 210 of file DimensionState.h.

Constructor & Destructor Documentation

◆ DimensionState1Dof() [1/2]

template<typename DimensionType >
agxPowerLine::detail::DimensionState1Dof< DimensionType >::DimensionState1Dof ( agx::RigidBody *  body,
agxPowerLine::PhysicalDimension *  dimension,
agx::UInt8  slot 
)

◆ DimensionState1Dof() [2/2]

template<typename DimensionType >
agxPowerLine::detail::DimensionState1Dof< DimensionType >::DimensionState1Dof ( )
protected

◆ ~DimensionState1Dof()

template<typename DimensionType >
virtual agxPowerLine::detail::DimensionState1Dof< DimensionType >::~DimensionState1Dof ( )
protectedvirtual

Member Function Documentation

◆ addLoad()

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState1Dof< DimensionType >::addLoad ( agx::Real  load)
overridevirtual

◆ addNotification()

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState1Dof< DimensionType >::addNotification ( agxPowerLine::PowerLine *  powerLine)
overridevirtual

◆ calculateJacobian()

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState1Dof< DimensionType >::calculateJacobian ( agx::Jacobian6DOFElement *  G,
agx::Real  ratio,
size_t  index 
) const
overridevirtual

◆ create() [1/2]

template<typename DimensionType >
static agxStream::Serializable * agxPowerLine::detail::DimensionState1Dof< DimensionType >::create ( )
static

◆ create() [2/2]

template<typename DimensionType >
static agxStream::Serializable * agxPowerLine::detail::DimensionState1Dof< DimensionType >::create ( agxStream::InputArchive &  )
static

◆ getClassName()

template<typename DimensionType >
virtual const char * agxPowerLine::detail::DimensionState1Dof< DimensionType >::getClassName ( ) const
overridevirtual
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

◆ getConstructClassId()

template<typename DimensionType >
static const char * agxPowerLine::detail::DimensionState1Dof< DimensionType >::getConstructClassId ( )
static

◆ getDirection()

template<typename DimensionType >
virtual agx::Vec3 agxPowerLine::detail::DimensionState1Dof< DimensionType >::getDirection ( ) const
overridevirtual

◆ getDirectionReference()

template<typename DimensionType >
virtual DirectionReference agxPowerLine::detail::DimensionState1Dof< DimensionType >::getDirectionReference ( ) const
overridevirtual

◆ getGradient()

template<typename DimensionType >
virtual agx::Real agxPowerLine::detail::DimensionState1Dof< DimensionType >::getGradient ( ) const
overridevirtual

◆ getLocalDirection()

template<typename DimensionType >
virtual agx::Vec3 agxPowerLine::detail::DimensionState1Dof< DimensionType >::getLocalDirection ( ) const
overridevirtual

◆ getMassProperty()

template<typename DimensionType >
virtual agx::Real agxPowerLine::detail::DimensionState1Dof< DimensionType >::getMassProperty ( ) const
overridevirtual

◆ getReservedBody() [1/2]

template<typename DimensionType >
virtual const agx::RigidBody * agxPowerLine::detail::DimensionState1Dof< DimensionType >::getReservedBody ( ) const
overridevirtual

◆ getReservedBody() [2/2]

template<typename DimensionType >
virtual agx::RigidBody * agxPowerLine::detail::DimensionState1Dof< DimensionType >::getReservedBody ( )
overridevirtual

Returns a RigidBody that is guaranteed to not be shared with any other DimensionState.

Will return nullptr if such a guarantee cannot be made. Call reserveBody to ensure that this DimensionState does not share it's body with another DimensionState

Implements agxPowerLine::detail::DimensionState.

◆ getSecondGradient()

template<typename DimensionType >
virtual agx::Real agxPowerLine::detail::DimensionState1Dof< DimensionType >::getSecondGradient ( ) const
overridevirtual

◆ getSlot()

template<typename DimensionType >
virtual agx::UInt8 agxPowerLine::detail::DimensionState1Dof< DimensionType >::getSlot ( ) const
overridevirtual

◆ getSlotMapper()

template<typename DimensionType >
SlotMapper * agxPowerLine::detail::DimensionState1Dof< DimensionType >::getSlotMapper ( )

◆ getStorageAgent()

template<typename DimensionType >
virtual agxStream::StorageAgent * agxPowerLine::detail::DimensionState1Dof< DimensionType >::getStorageAgent ( ) const
overridevirtual
Returns
the storage agent

Implements agxStream::Serializable.

◆ getValue()

template<typename DimensionType >
virtual agx::Real agxPowerLine::detail::DimensionState1Dof< DimensionType >::getValue ( ) const
overridevirtual

◆ getVelocityDamping()

template<typename DimensionType >
virtual float agxPowerLine::detail::DimensionState1Dof< DimensionType >::getVelocityDamping ( )
overridevirtual

◆ getWorldDirection()

template<typename DimensionType >
virtual agx::Vec3 agxPowerLine::detail::DimensionState1Dof< DimensionType >::getWorldDirection ( ) const
overridevirtual

◆ isExternalBody()

template<typename DimensionType >
virtual bool agxPowerLine::detail::DimensionState1Dof< DimensionType >::isExternalBody ( ) const
overridevirtual
Returns
True if the body used by this dimension state was given by the user. False if it was created by the power line.

Implements agxPowerLine::detail::DimensionState.

◆ move()

template<typename DimensionType >
void agxPowerLine::detail::DimensionState1Dof< DimensionType >::move ( agx::RigidBody *  body,
agx::UInt8  slot 
)

Make this dimension state use the given body for storage.

All state stored in the current body is moved to the new body. It is important that the body/slot pair is not used by any other dimension state, and that the given body is not used for any other purpose than to store DimesionState1Dof data.

The dimension state must allow packing for this operation to be legal.

Parameters
body- The body to move to.
slot- The slot to inhabit in the new body.

◆ moveImpl()

template<typename DimensionType >
void agxPowerLine::detail::DimensionState1Dof< DimensionType >::moveImpl ( agx::RigidBody *  newBody,
agx::UInt8  newSlot 
)
protected

◆ postUpdate()

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState1Dof< DimensionType >::postUpdate ( agx::Real  timeStep)
overridevirtual

◆ removeNotification()

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState1Dof< DimensionType >::removeNotification ( agxPowerLine::PowerLine *  powerLine)
overridevirtual

◆ reserveBody()

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState1Dof< DimensionType >::reserveBody ( )
overridevirtual

Ensure that this DimensionState is the only state using this state's RigidBody.

The DimensionState may create a new body in order to give that guarantee. After this call getReservedBody is guaranteed to not return nullptr and getAllowsPacking is guaranteed to return false.

Implements agxPowerLine::detail::DimensionState.

◆ reserveImpl()

template<typename DimensionType >
void agxPowerLine::detail::DimensionState1Dof< DimensionType >::reserveImpl ( )
protected

◆ restore() [1/2]

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState1Dof< DimensionType >::restore ( agxStream::InputArchive &  in)
overridevirtual

◆ restore() [2/2]

template<typename DimensionType >
virtual bool agxPowerLine::detail::DimensionState1Dof< DimensionType >::restore ( agxStream::StorageStream &  in)
overridevirtual

◆ setGradient()

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState1Dof< DimensionType >::setGradient ( agx::Real  gradient)
overridevirtual

◆ setMassProperty()

template<typename DimensionType >
virtual bool agxPowerLine::detail::DimensionState1Dof< DimensionType >::setMassProperty ( agx::Real  massProperty)
overridevirtual

◆ setValue()

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState1Dof< DimensionType >::setValue ( agx::Real  value)
overridevirtual

◆ setVelocityDamping()

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState1Dof< DimensionType >::setVelocityDamping ( float  damping)
overridevirtual

◆ split()

template<typename DimensionType >
void agxPowerLine::detail::DimensionState1Dof< DimensionType >::split ( )

Move this DimensionState to a new RigidBody that is guaranteed to not be shared with any other DimensionState.

This does not alter the allow packing setting, so if the DimensionState allows packing then the DimensionState may later be packed into a body used by another DimensionState, and other DimensionState may be packed into the body just created.

◆ splitImpl()

template<typename DimensionType >
void agxPowerLine::detail::DimensionState1Dof< DimensionType >::splitImpl ( )
protected

◆ store() [1/2]

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState1Dof< DimensionType >::store ( agxStream::OutputArchive &  out) const
overridevirtual

◆ store() [2/2]

template<typename DimensionType >
virtual bool agxPowerLine::detail::DimensionState1Dof< DimensionType >::store ( agxStream::StorageStream &  out) const
overridevirtual

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