AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agxPowerLine::detail::DimensionState3Dof< DimensionType > Class Template Reference

Templated three dimensional dimension state. More...

#include <DimensionState.h>

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

Public Member Functions

 DimensionState3Dof (agx::RigidBody *body, agxPowerLine::PhysicalDimension *dimension, const agx::Vec3 &direction, DirectionReference directionReference)
 
 DimensionState3Dof (agx::RigidBody *body, agxPowerLine::PhysicalDimension *dimension, const agx::Vec3 &direction, DirectionReference directionReference, bool externalBody)
 
virtual void addLoad (agx::Real load) override
 
virtual void addNotification (agxPowerLine::PowerLine *powerLine) override
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
virtual void calculateJacobian (agx::Jacobian6DOFElement *G, agx::Real ratio, size_t index) const override
 
bool getAllowsPacking () const
 
virtual const char * getClassName () const override
 
agx::RigidBody * getCurrentBody ()
 Returns the body currently used by this dimension state. More...
 
const agx::RigidBody * getCurrentBody () const
 
const
agxPowerLine::PhysicalDimension * 
getDimension () const
 
virtual agx::Vec3 getDirection () const override
 
virtual DirectionReference getDirectionReference () const override
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
virtual agx::Real getGradient () const override
 
agx::UInt32 getIndex () const
 This index is given at creation of this object. More...
 
virtual agx::Vec3 getLocalDirection () const override
 
virtual agx::Real getMassProperty () const override
 
int getReferenceCount () const
 
virtual agx::RigidBody * getReservedBody () override
 Gives access to a RigidBody that is known to be used by this dimension state only. More...
 
virtual const agx::RigidBody * getReservedBody () const override
 
virtual agx::Real getSecondGradient () const override
 
virtual agxStream::StorageAgent * getStorageAgent () const override
 
agx::Uuid getUuid () const
 
virtual agx::Real getValue () const override
 
virtual float getVelocityDamping () override
 
virtual agx::Vec3 getWorldDirection () const override
 
template<typename T >
bool is () const
 Subclass test. More...
 
virtual bool isExternalBody () const override
 /return True if the body used by this dimension state was given by the user. More...
 
bool isFinished () const
 
virtual void postUpdate (agx::Real) override
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
virtual void removeNotification (agxPowerLine::PowerLine *powerLine) override
 
virtual void reserveBody () override
 Reserve a body for this dimension state. More...
 
virtual bool restore (agxStream::StorageStream &in) override
 
virtual void restore (agxStream::InputArchive &in) override
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object. More...
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More...
 
virtual void setGradient (agx::Real gradient) override
 
virtual void setLocalDirection (const agx::Vec3 &direction) override
 
virtual bool setMassProperty (agx::Real massProperty) override
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object. More...
 
virtual void setValue (agx::Real value) override
 
virtual void setVelocityDamping (float damping) override
 
virtual void setWorldDirection (const agx::Vec3 &direction) override
 
virtual bool store (agxStream::StorageStream &out) const override
 
virtual void store (agxStream::OutputArchive &out) const override
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Static Public Member Functions

static agxStream::Serializable * create ()
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static const char * getConstructClassId ()
 
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More...
 
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

virtual ~DimensionState3Dof ()
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
void disallowPacking ()
 Mark is DimensionState as not a candidate for packing. More...
 
void generateUuid ()
 
const agx::Frame * getBodyFrame () const
 
agx::Vec3 getWorldPosition () const
 
agx::Vec3 getWorldVelocity () const
 
void setBody (agx::RigidBody *newBody)
 

Static Protected Member Functions

static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Protected Attributes

Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

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

Templated three 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 354 of file DimensionState.h.

Constructor & Destructor Documentation

template<typename DimensionType >
agxPowerLine::detail::DimensionState3Dof< DimensionType >::DimensionState3Dof ( agx::RigidBody *  body,
agxPowerLine::PhysicalDimension *  dimension,
const agx::Vec3 &  direction,
DirectionReference  directionReference 
)
template<typename DimensionType >
agxPowerLine::detail::DimensionState3Dof< DimensionType >::DimensionState3Dof ( agx::RigidBody *  body,
agxPowerLine::PhysicalDimension *  dimension,
const agx::Vec3 &  direction,
DirectionReference  directionReference,
bool  externalBody 
)
template<typename DimensionType >
virtual agxPowerLine::detail::DimensionState3Dof< DimensionType >::~DimensionState3Dof ( )
protectedvirtual

Member Function Documentation

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState3Dof< DimensionType >::addLoad ( agx::Real  load)
overridevirtual
template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState3Dof< DimensionType >::addNotification ( agxPowerLine::PowerLine *  powerLine)
overridevirtual
void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().

template<typename T >
const T* agx::Referenced::as ( ) const
inherited
template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState3Dof< DimensionType >::calculateJacobian ( agx::Jacobian6DOFElement *  G,
agx::Real  ratio,
size_t  index 
) const
overridevirtual
template<typename DimensionType >
static agxStream::Serializable* agxPowerLine::detail::DimensionState3Dof< DimensionType >::create ( )
static
template<typename DimensionType >
static agxStream::Serializable* agxPowerLine::detail::DimensionState3Dof< DimensionType >::create ( agxStream::InputArchive &  )
static
void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
void agxPowerLine::detail::DimensionState::disallowPacking ( )
protectedinherited

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.
void agxStream::Serializable::generateUuid ( )
protectedinherited
bool agxPowerLine::detail::DimensionState::getAllowsPacking ( ) const
inherited
Returns
True if this dimension state may be packed in a RigidBody with other dimension state.
const agx::Frame* agxPowerLine::detail::DimensionState::getBodyFrame ( ) const
protectedinherited
template<typename DimensionType >
virtual const char* agxPowerLine::detail::DimensionState3Dof< DimensionType >::getClassName ( ) const
overridevirtual
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

template<typename DimensionType >
static const char* agxPowerLine::detail::DimensionState3Dof< DimensionType >::getConstructClassId ( )
static
agx::RigidBody* agxPowerLine::detail::DimensionState::getCurrentBody ( )
inherited

Returns the body currently used by this dimension state.

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

const agx::RigidBody* agxPowerLine::detail::DimensionState::getCurrentBody ( ) const
inherited
static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
const agxPowerLine::PhysicalDimension* agxPowerLine::detail::DimensionState::getDimension ( ) const
inherited
Returns
The PhysicalDimension that uses this dimension state for storage.
template<typename DimensionType >
virtual agx::Vec3 agxPowerLine::detail::DimensionState3Dof< DimensionType >::getDirection ( ) const
overridevirtual
template<typename DimensionType >
virtual DirectionReference agxPowerLine::detail::DimensionState3Dof< DimensionType >::getDirectionReference ( ) const
overridevirtual
bool agxStream::Serializable::getEnableSerialization ( ) const
inherited
Returns
true if serialization is enabled for this object

Definition at line 273 of file Serializable.h.

bool agxStream::Serializable::getEnableUuidGeneration ( )
inherited
Returns
true if Uuid:s should be generated for each new Serializable object
template<typename DimensionType >
virtual agx::Real agxPowerLine::detail::DimensionState3Dof< DimensionType >::getGradient ( ) const
overridevirtual
agx::UInt32 agxStream::Serializable::getIndex ( ) const
inherited

This index is given at creation of this object.

It is guaranteed to be unique for the lifetime of this library instance. As long as the application is running. This value is not serialized or restored. A new object will always get a new index no matter how it is created.

Returns
an instance index of this object. This is unique for the lifetime of this library instance.

Definition at line 247 of file Serializable.h.

template<typename DimensionType >
virtual agx::Vec3 agxPowerLine::detail::DimensionState3Dof< DimensionType >::getLocalDirection ( ) const
overridevirtual
template<typename DimensionType >
virtual agx::Real agxPowerLine::detail::DimensionState3Dof< DimensionType >::getMassProperty ( ) const
overridevirtual
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
template<typename DimensionType >
virtual agx::RigidBody* agxPowerLine::detail::DimensionState3Dof< DimensionType >::getReservedBody ( )
overridevirtual

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.

Implements agxPowerLine::detail::DimensionState.

template<typename DimensionType >
virtual const agx::RigidBody* agxPowerLine::detail::DimensionState3Dof< DimensionType >::getReservedBody ( ) const
overridevirtual
template<typename DimensionType >
virtual agx::Real agxPowerLine::detail::DimensionState3Dof< DimensionType >::getSecondGradient ( ) const
overridevirtual
template<typename DimensionType >
virtual agxStream::StorageAgent* agxPowerLine::detail::DimensionState3Dof< DimensionType >::getStorageAgent ( ) const
overridevirtual
Returns
the storage agent

Implements agxStream::Serializable.

agx::Uuid agxStream::Serializable::getUuid ( ) const
inherited
Returns
a unique id for this instance.

Definition at line 268 of file Serializable.h.

template<typename DimensionType >
virtual agx::Real agxPowerLine::detail::DimensionState3Dof< DimensionType >::getValue ( ) const
overridevirtual
template<typename DimensionType >
virtual float agxPowerLine::detail::DimensionState3Dof< DimensionType >::getVelocityDamping ( )
overridevirtual
template<typename DimensionType >
virtual agx::Vec3 agxPowerLine::detail::DimensionState3Dof< DimensionType >::getWorldDirection ( ) const
overridevirtual
agx::Vec3 agxPowerLine::detail::DimensionState::getWorldPosition ( ) const
protectedinherited
agx::Vec3 agxPowerLine::detail::DimensionState::getWorldVelocity ( ) const
protectedinherited
template<typename T >
bool agx::Referenced::is ( ) const
inherited
template<typename DimensionType >
virtual bool agxPowerLine::detail::DimensionState3Dof< DimensionType >::isExternalBody ( ) const
overridevirtual

/return 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.

bool agxStream::Serializable::isFinished ( ) const
inherited
Returns
true if this class is restored correctly and should not be deleted during destruction of an Archive.

Definition at line 252 of file Serializable.h.

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState3Dof< DimensionType >::postUpdate ( agx::Real  )
overridevirtual
void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.

This method should be used with care, always balanced with the same number of calls to unreference.

Referenced by agxData::Val< UInt >::Val().

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

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.

Implements agxPowerLine::detail::DimensionState.

template<typename DimensionType >
virtual bool agxPowerLine::detail::DimensionState3Dof< DimensionType >::restore ( agxStream::StorageStream &  in)
overridevirtual
template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState3Dof< DimensionType >::restore ( agxStream::InputArchive &  in)
overridevirtual
void agxPowerLine::detail::DimensionState::setBody ( agx::RigidBody *  newBody)
protectedinherited
static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

void agxStream::Serializable::setEnableSerialization ( bool  flag)
inherited

Set to false to disable serialization of this object.

It will just be ignored during serialization (writing). It is still possible to restore TO this object.

static void agxStream::Serializable::setEnableUuidGeneration ( bool  flag)
staticinherited

Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.

void agxStream::Serializable::setFinished ( )
inherited

Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState3Dof< DimensionType >::setGradient ( agx::Real  gradient)
overridevirtual
template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState3Dof< DimensionType >::setLocalDirection ( const agx::Vec3 &  direction)
overridevirtual
template<typename DimensionType >
virtual bool agxPowerLine::detail::DimensionState3Dof< DimensionType >::setMassProperty ( agx::Real  massProperty)
overridevirtual
void agxStream::Serializable::setUuid ( const agx::Uuid &  uuid)
inherited

Explicitly set a Uuid on a serializable object.

Use this method with great care, as it can result in non-unique identifiers in the system!

template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState3Dof< DimensionType >::setValue ( agx::Real  value)
overridevirtual
template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState3Dof< DimensionType >::setVelocityDamping ( float  damping)
overridevirtual
template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState3Dof< DimensionType >::setWorldDirection ( const agx::Vec3 &  direction)
overridevirtual
template<typename DimensionType >
virtual bool agxPowerLine::detail::DimensionState3Dof< DimensionType >::store ( agxStream::StorageStream &  out) const
overridevirtual
template<typename DimensionType >
virtual void agxPowerLine::detail::DimensionState3Dof< DimensionType >::store ( agxStream::OutputArchive &  out) const
overridevirtual
void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

This method should be used with care, always balanced with the same number of calls to reference.

void agx::Referenced::unreference_nodelete ( ) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.


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