33 #ifndef DART_DYNAMICS_DETAIL_BODYNODE_HPP_
34 #define DART_DYNAMICS_DETAIL_BODYNODE_HPP_
44 template <
class Jo
intType>
46 BodyNode* _newParent,
const typename JointType::Properties& _joint)
48 if (
nullptr == _newParent)
53 this, _newParent->
getSkeleton(), _newParent, _joint);
57 template <
class Jo
intType>
61 const typename JointType::Properties& _joint)
64 this, _newSkeleton, _newParent, _joint);
68 template <
class Jo
intType>
70 const std::string& _skeletonName,
71 const typename JointType::Properties& _joint)
74 skel->setName(_skeletonName);
75 moveTo<JointType>(skel,
nullptr, _joint);
80 template <
class Jo
intType>
82 const typename JointType::Properties& _joint)
88 template <
class Jo
intType>
91 const typename JointType::Properties& _joint,
94 if (
nullptr == _newParent)
99 this, _newParent->
getSkeleton(), _newParent, _joint, _recursive);
103 template <
class Jo
intType>
107 const typename JointType::Properties& _joint,
108 bool _recursive)
const
111 this, _newSkeleton, _newParent, _joint, _recursive);
115 template <
class Jo
intType>
117 const std::string& _skeletonName,
118 const typename JointType::Properties& _joint,
119 bool _recursive)
const
122 skel->setName(_skeletonName);
123 copyTo<JointType>(skel,
nullptr, _joint, _recursive);
128 template <
class Jo
intType,
class NodeType>
130 const typename JointType::Properties& _jointProperties,
131 const typename NodeType::Properties& _bodyProperties)
134 this, _jointProperties, _bodyProperties);
138 template <
class NodeType,
typename... Args>
141 NodeType* node =
new NodeType(
this, std::forward<Args>(args)...);
148 template <
class ShapeNodeProperties>
150 ShapeNodeProperties
properties,
bool automaticName)
162 template <
class ShapeType>
172 template <
class ShapeType,
class StringType>
174 const std::shared_ptr<ShapeType>& shape, StringType&&
name)
184 template <
class... Aspects>
192 template <
class... Aspects>
204 template <
class AspectT>
210 for (
auto i = 0u; i < numShapeNode; ++i)
220 template <
class AspectT>
223 std::vector<ShapeNode*> shapeNodes;
227 for (
auto i = 0u; i < numShapeNode; ++i)
231 if (shapeNode->has<AspectT>())
232 shapeNodes.push_back(shapeNode);
239 template <
class AspectT>
242 std::vector<const ShapeNode*> shapeNodes;
246 for (
auto i = 0u; i < numShapeNode; ++i)
250 if (shapeNode->has<AspectT>())
251 shapeNodes.push_back(shapeNode);
258 template <
class AspectT>
261 auto shapeNodes = getShapeNodesWith<AspectT>();
262 for (
auto shapeNode : shapeNodes)
BodyPropPtr properties
Definition: SdfParser.cpp:80
std::string * name
Definition: SkelParser.cpp:1697
const AspectProperties & getAspectProperties() const
Definition: EmbeddedAspect.hpp:408
Definition: CompositeData.hpp:186
BodyNode class represents a single node of the skeleton.
Definition: BodyNode.hpp:79
const std::string & getName() const override
Get the name of this Node.
Definition: BodyNode.cpp:456
void removeAllShapeNodesWith()
Remove all ShapeNodes containing given Aspect from this BodyNode.
Definition: BodyNode.hpp:259
ShapeNode * createShapeNode(ShapeNodeProperties properties, bool automaticName=true)
Create an ShapeNode attached to this BodyNode.
Definition: BodyNode.hpp:149
SkeletonPtr getSkeleton() override
Return the Skeleton that this Node is attached to.
Definition: BodyNode.cpp:858
std::size_t getNumShapeNodes() const
Definition: BodyNode.cpp:954
NodeType * createNode(Args &&... args)
Create some Node type and attach it to this BodyNode.
Definition: BodyNode.hpp:139
const std::vector< ShapeNode * > getShapeNodesWith()
Return the list of ShapeNodes containing given Aspect.
Definition: BodyNode.hpp:221
JointType * changeParentJointType(const typename JointType::Properties &_joint=typename JointType::Properties())
Change the Joint type of this BodyNode's parent Joint.
Definition: BodyNode.hpp:81
std::pair< JointType *, NodeType * > createChildJointAndBodyNodePair(const typename JointType::Properties &_jointProperties=typename JointType::Properties(), const typename NodeType::Properties &_bodyProperties=typename NodeType::Properties())
Create a Joint and BodyNode pair as a child of this BodyNode.
Definition: BodyNode.hpp:129
SkeletonPtr split(const std::string &_skeletonName)
Remove this BodyNode and all of its children (recursively) from their current Skeleton and move them ...
Definition: BodyNode.cpp:809
SkeletonPtr copyAs(const std::string &_skeletonName, bool _recursive=true) const
Create clones of this BodyNode and all of its children (recursively) and create a new Skeleton with t...
Definition: BodyNode.cpp:847
bool moveTo(BodyNode *_newParent)
Remove this BodyNode and all of its children (recursively) from their current parent BodyNode,...
Definition: BodyNode.cpp:785
ShapeNode * createShapeNodeWith(const ShapePtr &shape)
Create a ShapeNode with the specified Aspects and an automatically assigned name: <BodyNodeName>Shape...
Definition: BodyNode.hpp:185
ShapeNode * getShapeNode(std::size_t index)
Definition: BodyNode.cpp:954
BodyNode * getParentBodyNode()
Return the parent BodyNdoe of this BodyNode.
Definition: BodyNode.cpp:882
std::size_t getNumShapeNodesWith() const
Return the number of ShapeNodes containing given Aspect in this BodyNode.
Definition: BodyNode.hpp:205
std::pair< Joint *, BodyNode * > copyTo(BodyNode *_newParent, bool _recursive=true)
Create clones of this BodyNode and all of its children recursively (unless _recursive is set to false...
Definition: BodyNode.cpp:819
Definition: ShapeNode.hpp:49
static SkeletonPtr create(const std::string &_name="Skeleton")
Create a new Skeleton inside of a shared_ptr.
Definition: Skeleton.cpp:384
void createAspects(T *)
Attach an arbitrary number of Aspects to the specified Composite type.
Definition: Composite.hpp:145
std::shared_ptr< Shape > ShapePtr
Definition: SmartPointer.hpp:81
std::shared_ptr< Skeleton > SkeletonPtr
Definition: SmartPointer.hpp:60
JointType
Definition: Types.hpp:132
Definition: BulletCollisionDetector.cpp:65