AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agx::SeparationAngle Class Reference

Implementation of constraint angle ALONG an axis. More...

#include <ConstraintAngle.h>

+ Inheritance diagram for agx::SeparationAngle:

Public Types

enum  Axis { U, V, N }
 Axis this constraint angle is defined about or along. More...
 
enum  Type { TRANSLATIONAL, ROTATIONAL }
 Type, i.e., defines Axis as 'along' or 'about'. More...
 

Public Member Functions

 SeparationAngle (agx::Angle::Axis axis, agx::Real initialAngle=agx::Real(0))
 Construct given axis and initial angle. More...
 
 AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agx::Angle)
 
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
 
agx::Angle::Axis getAxis () const
 
const char * getClassName () const override
 
virtual const agx::Vec3 & getDir (const agx::AttachmentPair &ap, agx::UInt index) const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object. More...
 
int getReferenceCount () const
 
agxStream::StorageAgent * getStorageAgent () const override
 
agx::Angle::Type getType () const
 
agx::Uuid getUuid () const
 
const agx::Real & getValue () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
bool isFinished () const
 
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 restore (agxStream::InputArchive &in) override
 Restore given stream. More...
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore structural independent data from stream. More...
 
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...
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object. More...
 
virtual void store (agxStream::OutputArchive &out) const override
 Store given stream. More...
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store structural independent data to stream. More...
 
virtual void transform (const agx::AttachmentPair &ap) override
 Update value given constraint pair. More...
 
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 agx::SeparationAngle * safeCast (const agx::Angle *angle)
 Utility cast method. More...
 
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

 SeparationAngle ()
 Default constructor used during restore. More...
 
virtual ~SeparationAngle ()
 Reference counted object, protected destructor. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
void generateUuid ()
 

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

Axis m_axis
 
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 
Type m_type
 
agx::Real m_value
 

Detailed Description

Implementation of constraint angle ALONG an axis.

Definition at line 195 of file ConstraintAngle.h.

Member Enumeration Documentation

enum agx::Angle::Axis
inherited

Axis this constraint angle is defined about or along.

Enumerator
U 

Constraint x axis.

V 

Constraint y axis.

N 

Constraint z axis.

Definition at line 37 of file ConstraintAngle.h.

enum agx::Angle::Type
inherited

Type, i.e., defines Axis as 'along' or 'about'.

Enumerator
TRANSLATIONAL 

Axis is along U, V or N.

ROTATIONAL 

Axis is about U, V or N.

Definition at line 47 of file ConstraintAngle.h.

Constructor & Destructor Documentation

agx::SeparationAngle::SeparationAngle ( agx::Angle::Axis  axis,
agx::Real  initialAngle = agx::Real(0) 
)

Construct given axis and initial angle.

agx::SeparationAngle::SeparationAngle ( )
protected

Default constructor used during restore.

virtual agx::SeparationAngle::~SeparationAngle ( )
protectedvirtual

Reference counted object, protected destructor.

Member Function Documentation

agx::Angle::AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE ( agx::Angle  )
inherited
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
static agxStream::Serializable* agx::SeparationAngle::create ( agxStream::InputArchive &  )
inlinestatic

Definition at line 214 of file ConstraintAngle.h.

static agxStream::Serializable* agx::SeparationAngle::create ( )
inlinestatic

Definition at line 214 of file ConstraintAngle.h.

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
void agxStream::Serializable::generateUuid ( )
protectedinherited
agx::Angle::Axis agx::Angle::getAxis ( ) const
inherited
Returns
the axis this constraint angle is defined about or along
const char* agx::SeparationAngle::getClassName ( ) const
inlineoverridevirtual
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

Definition at line 214 of file ConstraintAngle.h.

static const char* agx::SeparationAngle::getConstructClassId ( )
inlinestatic

Definition at line 214 of file ConstraintAngle.h.

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
virtual const agx::Vec3& agx::Angle::getDir ( const agx::AttachmentPair &  ap,
agx::UInt  index 
) const
virtualinherited
Parameters
ap- attachment pair
index- which attachment (0,1)
Returns
the world direction of the axis given the attachment pair

Referenced by agx::ConstraintAngleBasedData::getDir1(), and agx::ConstraintAngleBasedData::getDir2().

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

int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
agxStream::StorageAgent* agx::SeparationAngle::getStorageAgent ( ) const
inlineoverridevirtual
Returns
the storage agent

Implements agxStream::Serializable.

Definition at line 214 of file ConstraintAngle.h.

agx::Angle::Type agx::Angle::getType ( ) const
inherited
Returns
the type of this constraint angle (i.e., if Axis is 'along' or 'about')
agx::Uuid agxStream::Serializable::getUuid ( ) const
inherited
Returns
a unique id for this instance.

Definition at line 268 of file Serializable.h.

const Real & agx::Angle::getValue ( ) const
inherited
Returns
const reference to value (so it may be used by elementary constraints that works on this angle)

Definition at line 230 of file ConstraintAngle.h.

References agx::Angle::m_value.

template<typename T >
bool agx::Referenced::is ( ) const
inherited
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.

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().

virtual void agx::SeparationAngle::restore ( agxStream::InputArchive &  in)
overridevirtual

Restore given stream.

Reimplemented from agx::Angle.

virtual void agx::Angle::restoreLightData ( agxStream::StorageStream &  str)
overridevirtualinherited

Restore structural independent data from stream.

Reimplemented in agx::RotationalAngle.

static agx::SeparationAngle* agx::SeparationAngle::safeCast ( const agx::Angle *  angle)
static

Utility cast method.

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.

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!

virtual void agx::SeparationAngle::store ( agxStream::OutputArchive &  out) const
overridevirtual

Store given stream.

Reimplemented from agx::Angle.

virtual void agx::Angle::storeLightData ( agxStream::StorageStream &  str) const
overridevirtualinherited

Store structural independent data to stream.

Reimplemented in agx::RotationalAngle.

virtual void agx::SeparationAngle::transform ( const agx::AttachmentPair &  ap)
overridevirtual

Update value given constraint pair.

Reimplemented from agx::Angle.

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

Axis agx::Angle::m_axis
protectedinherited

Definition at line 115 of file ConstraintAngle.h.

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.

Type agx::Angle::m_type
protectedinherited

Definition at line 116 of file ConstraintAngle.h.

agx::Real agx::Angle::m_value
protectedinherited

Definition at line 117 of file ConstraintAngle.h.

Referenced by agx::Angle::getValue().


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