dart
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
dart::dynamics::Entity Class Referenceabstract

Entity class is a base class for any objects that exist in the kinematic tree structure of DART. More...

#include <Entity.hpp>

Inheritance diagram for dart::dynamics::Entity:
Inheritance graph
[legend]
Collaboration diagram for dart::dynamics::Entity:
Collaboration graph
[legend]

Public Types

using EntitySignal = common::Signal< void(const Entity *)>
 
using FrameChangedSignal = common::Signal< void(const Entity *, const Frame *_oldFrame, const Frame *_newFrame)>
 
using NameChangedSignal = common::Signal< void(const Entity *, const std::string &_oldName, const std::string &_newName)>
 

Public Member Functions

 Entity (Frame *_refFrame, bool _quiet)
 Constructor for typical usage.
 
 Entity ()
 Default constructor, delegates to Entity(ConstructAbstract_t)
 
 Entity (const Entity &)=delete
 
virtual ~Entity ()
 Destructor.
 
virtual const std::string & setName (const std::string &_name)=0
 Set name. More...
 
virtual const std::string & getName () const =0
 Return the name of this Entity.
 
FramegetParentFrame ()
 Get the parent (reference) frame of this Entity.
 
const FramegetParentFrame () const
 Get the parent (reference) frame of this Entity.
 
bool descendsFrom (const Frame *_someFrame) const
 Returns true if and only if this Entity is itself (i.e. More...
 
bool isFrame () const
 True iff this Entity is also a Frame.
 
bool isQuiet () const
 Returns true if this Entity is set to be quiet. More...
 
virtual void notifyTransformUpdate ()
 Notify the transformation update of this Entity that its parent Frame's pose is needed.
 
virtual void dirtyTransform ()
 Notify the transformation update of this Entity that its parent Frame's pose is needed.
 
bool needsTransformUpdate () const
 Returns true iff a transform update is needed for this Entity.
 
virtual void notifyVelocityUpdate ()
 Notify the velocity update of this Entity that its parent Frame's velocity is needed.
 
virtual void dirtyVelocity ()
 Notify the velocity update of this Entity that its parent Frame's velocity is needed.
 
bool needsVelocityUpdate () const
 Returns true iff a velocity update is needed for this Entity.
 
virtual void notifyAccelerationUpdate ()
 Notify the acceleration of this Entity that its parent Frame's acceleration is needed.
 
virtual void dirtyAcceleration ()
 Notify the acceleration of this Entity that its parent Frame's acceleration is needed.
 
bool needsAccelerationUpdate () const
 Returns true iff an acceleration update is needed for this Entity.
 
- Public Member Functions inherited from dart::common::Subject
virtual ~Subject ()
 Destructor will notify all Observers that it is destructing.
 

Protected Types

enum  ConstructFrameTag { ConstructFrame }
 Used when constructing a Frame class, because the Frame constructor will take care of setting up the parameters you pass into it.
 
enum  ConstructAbstractTag { ConstructAbstract }
 Used when constructing a pure abstract class, because calling the Entity constructor is just a formality.
 

Protected Member Functions

 Entity (ConstructFrameTag)
 
 Entity (ConstructAbstractTag)
 
virtual void changeParentFrame (Frame *_newParentFrame)
 Used by derived classes to change their parent frames.
 
- Protected Member Functions inherited from dart::common::Subject
void sendDestructionNotification () const
 Send a destruction notification to all Observers. More...
 
void addObserver (Observer *_observer) const
 Add an Observer to the list of Observers.
 
void removeObserver (Observer *_observer) const
 Remove an Observer from the list of Observers.
 

Protected Attributes

FramemParentFrame
 Parent frame of this Entity.
 
bool mNeedTransformUpdate
 Does this Entity need a Transform update.
 
bool mNeedVelocityUpdate
 Does this Entity need a Velocity update.
 
bool mNeedAccelerationUpdate
 Does this Entity need an Acceleration update.
 
FrameChangedSignal mFrameChangedSignal
 Frame changed signal.
 
NameChangedSignal mNameChangedSignal
 Name changed signal.
 
EntitySignal mTransformUpdatedSignal
 Transform changed signal.
 
EntitySignal mVelocityChangedSignal
 Velocity changed signal.
 
EntitySignal mAccelerationChangedSignal
 Acceleration changed signal.
 
- Protected Attributes inherited from dart::common::Subject
std::set< Observer * > mObservers
 List of current Observers.
 

Friends

class Frame
 

Slot registers

common::SlotRegister< FrameChangedSignalonFrameChanged
 Slot register for frame changed signal.
 
common::SlotRegister< NameChangedSignalonNameChanged
 Slot register for name changed signal.
 
common::SlotRegister< EntitySignalonTransformUpdated
 Slot register for transform updated signal.
 
common::SlotRegister< EntitySignalonVelocityChanged
 Slot register for velocity updated signal.
 
common::SlotRegister< EntitySignalonAccelerationChanged
 Slot register for acceleration updated signal.
 

Detailed Description

Entity class is a base class for any objects that exist in the kinematic tree structure of DART.

Entities all share the following properties: they exist within a reference frame, have a name, and are visualizable. However, different Entity types may have different policies about how/if their reference frame or name can be changed. Use the Detachable class to create an Entity whose reference Frame can be changed arbitrarily.

Member Function Documentation

◆ descendsFrom()

bool dart::dynamics::Entity::descendsFrom ( const Frame _someFrame) const

Returns true if and only if this Entity is itself (i.e.

this == _someFrame) or depends on (i.e. kinematically descends from) _someFrame.

If _someFrame is nullptr, this returns true in order to accommodate BodyNodes which always have a nullptr BodyNode as the parent of a root BodyNode.

◆ isQuiet()

bool dart::dynamics::Entity::isQuiet ( ) const

Returns true if this Entity is set to be quiet.

A quiet entity is unknown to its parent Frame. It will not be tracked by its parent; it will not receive notifications from its parent, and it will not be rendered. The advantage to a quiet Entity is that it has less overhead when constructing and deconstructing, which makes it more suitable for temporary objects.

◆ setName()

virtual const std::string& dart::dynamics::Entity::setName ( const std::string &  _name)
pure virtual

Set name.

Some implementations of Entity may make alterations to the name that gets passed in. The final name that this entity will use gets passed back in the return of this function.

Implemented in dart::dynamics::PointMassNotifier, dart::dynamics::WorldFrame, dart::dynamics::BodyNode, and dart::dynamics::SimpleFrame.


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