DART
6.7.3
|
Entity class is a base class for any objects that exist in the kinematic tree structure of DART. More...
#include <Entity.hpp>
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. More... | |
Entity () | |
Default constructor, delegates to Entity(ConstructAbstract_t) More... | |
Entity (const Entity &)=delete | |
virtual | ~Entity () |
Destructor. More... | |
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. More... | |
Frame * | getParentFrame () |
Get the parent (reference) frame of this Entity. More... | |
const Frame * | getParentFrame () const |
Get the parent (reference) frame of this Entity. More... | |
bool | descendsFrom (const Frame *_someFrame) const |
True if and only if this Entity depends on (i.e. More... | |
bool | isFrame () const |
True iff this Entity is also a Frame. More... | |
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. More... | |
virtual void | dirtyTransform () |
Notify the transformation update of this Entity that its parent Frame's pose is needed. More... | |
bool | needsTransformUpdate () const |
Returns true iff a transform update is needed for this Entity. More... | |
virtual void | notifyVelocityUpdate () |
Notify the velocity update of this Entity that its parent Frame's velocity is needed. More... | |
virtual void | dirtyVelocity () |
Notify the velocity update of this Entity that its parent Frame's velocity is needed. More... | |
bool | needsVelocityUpdate () const |
Returns true iff a velocity update is needed for this Entity. More... | |
virtual void | notifyAccelerationUpdate () |
Notify the acceleration of this Entity that its parent Frame's acceleration is needed. More... | |
virtual void | dirtyAcceleration () |
Notify the acceleration of this Entity that its parent Frame's acceleration is needed. More... | |
bool | needsAccelerationUpdate () const |
Returns true iff an acceleration update is needed for this Entity. More... | |
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. More... | |
enum | ConstructAbstractTag { ConstructAbstract } |
Used when constructing a pure abstract class, because calling the Entity constructor is just a formality. More... | |
Protected Member Functions | |
Entity (ConstructFrameTag) | |
Entity (ConstructAbstractTag) | |
virtual void | changeParentFrame (Frame *_newParentFrame) |
Used by derived classes to change their parent frames. More... | |
void | sendDestructionNotification () const |
Send a destruction notification to all Observers. More... | |
void | addObserver (Observer *_observer) const |
Add an Observer to the list of Observers. More... | |
void | removeObserver (Observer *_observer) const |
Remove an Observer from the list of Observers. More... | |
Protected Attributes | |
Frame * | mParentFrame |
Parent frame of this Entity. More... | |
bool | mNeedTransformUpdate |
Does this Entity need a Transform update. More... | |
bool | mNeedVelocityUpdate |
Does this Entity need a Velocity update. More... | |
bool | mNeedAccelerationUpdate |
Does this Entity need an Acceleration update. More... | |
FrameChangedSignal | mFrameChangedSignal |
Frame changed signal. More... | |
NameChangedSignal | mNameChangedSignal |
Name changed signal. More... | |
EntitySignal | mTransformUpdatedSignal |
Transform changed signal. More... | |
EntitySignal | mVelocityChangedSignal |
Velocity changed signal. More... | |
EntitySignal | mAccelerationChangedSignal |
Acceleration changed signal. More... | |
std::set< Observer * > | mObservers |
List of current Observers. More... | |
Friends | |
class | Frame |
Slot registers | |
common::SlotRegister< FrameChangedSignal > | onFrameChanged |
Slot register for frame changed signal. More... | |
common::SlotRegister< NameChangedSignal > | onNameChanged |
Slot register for name changed signal. More... | |
common::SlotRegister< EntitySignal > | onTransformUpdated |
Slot register for transform updated signal. More... | |
common::SlotRegister< EntitySignal > | onVelocityChanged |
Slot register for velocity updated signal. More... | |
common::SlotRegister< EntitySignal > | onAccelerationChanged |
Slot register for acceleration updated signal. More... | |
const bool | mAmQuiet |
Whether or not this Entity is set to be quiet. More... | |
bool | mAmFrame |
Whether or not this Entity is a Frame. More... | |
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.
using dart::dynamics::Entity::EntitySignal = common::Signal<void(const Entity*)> |
using dart::dynamics::Entity::FrameChangedSignal = common::Signal<void(const Entity*, const Frame* _oldFrame, const Frame* _newFrame)> |
using dart::dynamics::Entity::NameChangedSignal = common::Signal<void(const Entity*, const std::string& _oldName, const std::string& _newName)> |
|
protected |
Used when constructing a pure abstract class, because calling the Entity constructor is just a formality.
Enumerator | |
---|---|
ConstructAbstract |
|
protected |
|
explicit |
Constructor for typical usage.
dart::dynamics::Entity::Entity | ( | ) |
Default constructor, delegates to Entity(ConstructAbstract_t)
|
delete |
|
virtual |
Destructor.
|
explicitprotected |
|
explicitprotected |
|
protectedinherited |
Add an Observer to the list of Observers.
|
protectedvirtual |
Used by derived classes to change their parent frames.
Reimplemented in dart::dynamics::Frame.
bool dart::dynamics::Entity::descendsFrom | ( | const Frame * | _someFrame | ) | const |
|
virtual |
Notify the acceleration of this Entity that its parent Frame's acceleration is needed.
Reimplemented in dart::dynamics::PointMassNotifier, dart::dynamics::Frame, and dart::dynamics::BodyNode.
|
virtual |
Notify the transformation update of this Entity that its parent Frame's pose is needed.
Reimplemented in dart::dynamics::PointMassNotifier, dart::dynamics::Frame, and dart::dynamics::BodyNode.
|
virtual |
Notify the velocity update of this Entity that its parent Frame's velocity is needed.
Reimplemented in dart::dynamics::PointMassNotifier, dart::dynamics::Frame, and dart::dynamics::BodyNode.
|
pure virtual |
Return the name of this Entity.
Implemented in dart::dynamics::WorldFrame, dart::dynamics::SimpleFrame, dart::dynamics::PointMassNotifier, and dart::dynamics::BodyNode.
const Frame * dart::dynamics::Entity::getParentFrame | ( | ) | const |
Get the parent (reference) frame of this Entity.
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.
bool dart::dynamics::Entity::needsAccelerationUpdate | ( | ) | const |
Returns true iff an acceleration update is needed for this Entity.
bool dart::dynamics::Entity::needsTransformUpdate | ( | ) | const |
Returns true iff a transform update is needed for this Entity.
bool dart::dynamics::Entity::needsVelocityUpdate | ( | ) | const |
Returns true iff a velocity update is needed for this Entity.
|
virtual |
|
virtual |
|
virtual |
|
protectedinherited |
Remove an Observer from the list of Observers.
|
protectedinherited |
Send a destruction notification to all Observers.
This will cause all Observers to behave as if this Subject has been permanently deleted, so it should only be called when that behavior is desired.
|
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::WorldFrame, dart::dynamics::SimpleFrame, dart::dynamics::PointMassNotifier, and dart::dynamics::BodyNode.
|
friend |
|
protected |
Acceleration changed signal.
|
private |
Whether or not this Entity is set to be quiet.
|
protected |
Frame changed signal.
|
protected |
Name changed signal.
|
mutableprotected |
Does this Entity need an Acceleration update.
|
mutableprotected |
Does this Entity need a Transform update.
|
mutableprotected |
Does this Entity need a Velocity update.
|
mutableprotectedinherited |
List of current Observers.
|
protected |
Transform changed signal.
|
protected |
Velocity changed signal.
common::SlotRegister<EntitySignal> dart::dynamics::Entity::onAccelerationChanged |
Slot register for acceleration updated signal.
common::SlotRegister<FrameChangedSignal> dart::dynamics::Entity::onFrameChanged |
Slot register for frame changed signal.
common::SlotRegister<NameChangedSignal> dart::dynamics::Entity::onNameChanged |
Slot register for name changed signal.
common::SlotRegister<EntitySignal> dart::dynamics::Entity::onTransformUpdated |
Slot register for transform updated signal.
common::SlotRegister<EntitySignal> dart::dynamics::Entity::onVelocityChanged |
Slot register for velocity updated signal.