33 #ifndef DART_DYNAMICS_NODE_HPP_ 34 #define DART_DYNAMICS_NODE_HPP_ 38 #include "dart/common/Cloneable.hpp" 39 #include "dart/common/EmbeddedAspect.hpp" 40 #include "dart/common/Subject.hpp" 41 #include "dart/common/VersionCounter.hpp" 43 #include "dart/dynamics/SmartPointer.hpp" 64 Node* getNode()
const;
78 DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_BEGIN
87 template <
class,
class>
89 template <
class,
class>
110 template <
class Mixin>
131 template <
class Mixin>
135 virtual ~
Node() =
default;
138 virtual const std::string& setName(
const std::string& newName) = 0;
141 virtual const std::string& getName()
const = 0;
144 virtual void setNodeState(
const State& otherState);
148 virtual std::unique_ptr<State> getNodeState()
const;
153 virtual void copyNodeStateTo(std::unique_ptr<State>& outputState)
const;
156 virtual void setNodeProperties(
const Properties& properties);
160 virtual std::unique_ptr<Properties> getNodeProperties()
const;
166 virtual void copyNodePropertiesTo(
167 std::unique_ptr<Properties>& outputProperties)
const;
170 BodyNodePtr getBodyNodePtr();
173 ConstBodyNodePtr getBodyNodePtr()
const;
178 bool isRemoved()
const;
181 virtual std::shared_ptr<Skeleton> getSkeleton();
184 virtual std::shared_ptr<const Skeleton> getSkeleton()
const;
187 std::shared_ptr<NodeDestructor> getOrCreateDestructor();
200 std::string registerNameChange(
const std::string& newName);
206 void stageForRemoval();
230 DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
236 template <
class NodeType>
244 std::size_t getIndexInBodyNode()
const;
247 std::size_t getIndexInSkeleton()
const;
250 std::size_t getIndexInTree()
const;
253 std::size_t getTreeIndex()
const;
271 #include "dart/dynamics/detail/Node.hpp" 273 #endif // DART_DYNAMICS_NODE_HPP_ TemplateWeakNodePtr is a templated class that enables users to create a weak non-reference-holding We...
Definition: NodePtr.hpp:151
The Subject class is a base class for any object that wants to report when it gets destroyed...
Definition: Subject.hpp:57
Cloneable is a CRTP base class that provides an interface for easily creating data structures that ar...
Definition: Cloneable.hpp:53
AccessoryNode provides an interface for Nodes to get their index within the list of Nodes...
Definition: Node.hpp:237
If your Node has a Properties class, then that Properties class should inherit this Node::Properties ...
Definition: Node.hpp:125
The Node class is a base class for BodyNode and any object that attaches to a BodyNode.
Definition: Node.hpp:79
The MakeCloneable class is used to easily create an Cloneable (such as Node::State) which simply take...
Definition: Cloneable.hpp:83
std::size_t mIndexInBodyNode
The index of this Node within its vector in its BodyNode's NodeMap.
Definition: Node.hpp:222
VersionCounter is an interface for objects that count their versions.
Definition: VersionCounter.hpp:42
TemplateNodePtr is a templated class that enables users to create a strong reference-counting NodePtr...
Definition: NodePtr.hpp:49
BodyNode * mBodyNode
Pointer to the BodyNode that this Node is attached to.
Definition: Node.hpp:216
Definition: Aspect.cpp:40
If your Node has a State class, then that State class should inherit this Node::State class...
Definition: Node.hpp:104
~NodeDestructor()
Non-virtual destructor (this class cannot be inherited)
Definition: Node.cpp:52
bool mAmAttached
bool that tracks whether this Node is attached to its BodyNode
Definition: Node.hpp:219
BodyNode class represents a single node of the skeleton.
Definition: BodyNode.hpp:74
NodeDestructor(Node *_node)
Constructor.
Definition: Node.cpp:46
std::weak_ptr< NodeDestructor > mDestructor
weak pointer to the destructor for this Node.
Definition: Node.hpp:213
std::size_t mIndexInSkeleton
The index of this Node within its vector in its Skeleton's NodeMap.
Definition: Node.hpp:225
class Skeleton
Definition: Skeleton.hpp:55
std::size_t mIndexInTree
Index of this Node within its tree.
Definition: Node.hpp:228