33 #ifndef DART_DYNAMICS_NODE_HPP_
34 #define DART_DYNAMICS_NODE_HPP_
87 template <
class,
class>
89 template <
class,
class>
110 template <
class Mixin>
131 template <
class Mixin>
138 virtual const std::string&
setName(
const std::string& newName) = 0;
141 virtual const std::string&
getName()
const = 0;
153 virtual void copyNodeStateTo(std::unique_ptr<State>& outputState)
const;
167 std::unique_ptr<Properties>& outputProperties)
const;
184 virtual std::shared_ptr<const Skeleton>
getSkeleton()
const;
236 template <
class NodeType>
#define DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
Definition: ClassWithVirtualBase.hpp:44
#define DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_BEGIN
Definition: ClassWithVirtualBase.hpp:43
BodyPropPtr properties
Definition: SdfParser.cpp:80
Cloneable is a CRTP base class that provides an interface for easily creating data structures that ar...
Definition: Cloneable.hpp:54
The MakeCloneable class is used to easily create an Cloneable (such as Node::State) which simply take...
Definition: Cloneable.hpp:84
The Subject class is a base class for any object that wants to report when it gets destroyed.
Definition: Subject.hpp:58
VersionCounter is an interface for objects that count their versions.
Definition: VersionCounter.hpp:43
AccessoryNode provides an interface for Nodes to get their index within the list of Nodes,...
Definition: Node.hpp:238
std::size_t getTreeIndex() const
Get the index of this Node's tree within its Skeleton.
Definition: Node.hpp:68
AccessoryNode()=default
Prevent a non-inheriting class from constructing one.
virtual ~AccessoryNode()=default
Virtual destructor.
std::size_t getIndexInBodyNode() const
Get the index of this Node within its BodyNode.
Definition: Node.hpp:47
std::size_t getIndexInSkeleton() const
Get the index of this Node within its Skeleton.
Definition: Node.hpp:54
void remove()
Stage the Node for removal.
Definition: Node.hpp:75
void reattach()
Undo the effectos of calling remove().
Definition: Node.hpp:82
std::size_t getIndexInTree() const
Get the index of this Node within its tree.
Definition: Node.hpp:61
BodyNode class represents a single node of the skeleton.
Definition: BodyNode.hpp:79
NodeDestructor(Node *_node)
Constructor.
Definition: Node.cpp:46
~NodeDestructor()
Non-virtual destructor (this class cannot be inherited)
Definition: Node.cpp:52
Node * getNode() const
Definition: Node.cpp:58
NodeDestructor(const NodeDestructor &_other)=delete
Do not copy.
Node * mNode
Node that this Destructor is responsible for.
Definition: Node.hpp:68
If your Node has a Properties class, then that Properties class should inherit this Node::Properties ...
Definition: Node.hpp:126
If your Node has a State class, then that State class should inherit this Node::State class.
Definition: Node.hpp:105
The Node class is a base class for BodyNode and any object that attaches to a BodyNode.
Definition: Node.hpp:81
BodyNodePtr getBodyNodePtr()
Get a pointer to the BodyNode that this Node is associated with.
Definition: Node.cpp:101
void attach()
Attach the Node to its BodyNode.
Definition: Node.cpp:185
virtual std::unique_ptr< Properties > getNodeProperties() const
Get the Properties of this Node.
Definition: Node.cpp:88
virtual const std::string & setName(const std::string &newName)=0
Set the name of this Node.
virtual const std::string & getName() const =0
Get the name of this Node.
std::string registerNameChange(const std::string &newName)
Inform the Skeleton that the name of this Node has changed.
Definition: Node.cpp:168
std::size_t mIndexInTree
Index of this Node within its tree.
Definition: Node.hpp:228
bool mAmAttached
bool that tracks whether this Node is attached to its BodyNode
Definition: Node.hpp:219
std::size_t mIndexInSkeleton
The index of this Node within its vector in its Skeleton's NodeMap.
Definition: Node.hpp:225
virtual void setNodeProperties(const Properties &properties)
Set the Properties of this Node. By default, this does nothing.
Definition: Node.cpp:82
std::weak_ptr< NodeDestructor > mDestructor
weak pointer to the destructor for this Node.
Definition: Node.hpp:213
bool isRemoved() const
Returns true if this Node has been staged for removal from its BodyNode.
Definition: Node.cpp:113
virtual void copyNodeStateTo(std::unique_ptr< State > &outputState) const
Copy the State of this Node into a unique_ptr.
Definition: Node.cpp:76
virtual Node * cloneNode(BodyNode *bn) const =0
Allow your Node implementation to be cloned into a new BodyNode.
virtual void setNodeState(const State &otherState)
Set the State of this Node. By default, this does nothing.
Definition: Node.cpp:64
std::size_t mIndexInBodyNode
The index of this Node within its vector in its BodyNode's NodeMap.
Definition: Node.hpp:222
virtual void copyNodePropertiesTo(std::unique_ptr< Properties > &outputProperties) const
Copy the Properties of this Node into a unique_ptr.
Definition: Node.cpp:94
virtual std::shared_ptr< Skeleton > getSkeleton()
Return the Skeleton that this Node is attached to.
Definition: Node.cpp:125
BodyNode * mBodyNode
Pointer to the BodyNode that this Node is attached to.
Definition: Node.hpp:216
virtual ~Node()=default
Virtual destructor.
std::shared_ptr< NodeDestructor > getOrCreateDestructor()
Definition: Node.cpp:137
Node(BodyNode *_bn)
Constructor.
Definition: Node.cpp:150
virtual std::unique_ptr< State > getNodeState() const
Get the State of this Node.
Definition: Node.cpp:70
void stageForRemoval()
When all external references to the Node disappear, it will be deleted.
Definition: Node.cpp:239
class Skeleton
Definition: Skeleton.hpp:59
TemplateBodyNodePtr is a templated class that enables users to create a reference-counting BodyNodePt...
Definition: BodyNodePtr.hpp:110
TemplateNodePtr is a templated class that enables users to create a strong reference-counting NodePtr...
Definition: NodePtr.hpp:50
TemplateWeakNodePtr is a templated class that enables users to create a weak non-reference-holding We...
Definition: NodePtr.hpp:152
Definition: BulletCollisionDetector.cpp:65