33 #ifndef DART_DYNAMICS_DETAIL_BODYNODE_HPP_
34 #define DART_DYNAMICS_DETAIL_BODYNODE_HPP_
44 template <
class Jo
intType>
46 const typename JointType::Properties& _joint)
48 if(
nullptr == _newParent)
53 this, _newParent->
getSkeleton(), _newParent, _joint);
57 template <
class Jo
intType>
60 const typename JointType::Properties& _joint)
63 this, _newSkeleton, _newParent, _joint);
67 template <
class Jo
intType>
69 const typename JointType::Properties& _joint)
72 skel->setName(_skeletonName);
73 moveTo<JointType>(skel,
nullptr, _joint);
78 template <
class Jo
intType>
80 const typename JointType::Properties& _joint)
86 template <
class Jo
intType>
89 const typename JointType::Properties& _joint,
92 if(
nullptr == _newParent)
97 this, _newParent->
getSkeleton(), _newParent, _joint, _recursive);
101 template <
class Jo
intType>
104 const typename JointType::Properties& _joint,
105 bool _recursive)
const
107 return getSkeleton()->cloneBodyNodeTree<JointType>(
108 this, _newSkeleton, _newParent, _joint, _recursive);
112 template <
class Jo
intType>
114 const typename JointType::Properties& _joint,
bool _recursive)
const
117 skel->setName(_skeletonName);
118 copyTo<JointType>(skel,
nullptr, _joint, _recursive);
123 template <
class Jo
intType,
class NodeType>
125 const typename JointType::Properties& _jointProperties,
126 const typename NodeType::Properties& _bodyProperties)
128 return getSkeleton()->createJointAndBodyNodePair<JointType, NodeType>(
129 this, _jointProperties, _bodyProperties);
133 template <
class NodeType,
typename ...Args>
136 NodeType* node =
new NodeType(
this, std::forward<Args>(args)...);
143 template <
class ShapeNodeProperties>
157 template <
class ShapeType>
167 template <
class ShapeType,
class StringType>
169 const std::shared_ptr<ShapeType>& shape,
180 template <
class... Aspects>
188 template <
class... Aspects>
200 template <
class AspectT>
206 for (
auto i = 0u; i < numShapeNode; ++i)
216 template <
class AspectT>
219 std::vector<ShapeNode*> shapeNodes;
223 for (
auto i = 0u; i < numShapeNode; ++i)
227 if (shapeNode->has<AspectT>())
228 shapeNodes.push_back(shapeNode);
235 template <
class AspectT>
238 std::vector<const ShapeNode*> shapeNodes;
242 for (
auto i = 0u; i < numShapeNode; ++i)
246 if (shapeNode->has<AspectT>())
247 shapeNodes.push_back(shapeNode);
254 template <
class AspectT>
257 auto shapeNodes = getShapeNodesWith<AspectT>();
258 for (
auto shapeNode : shapeNodes)
BodyPropPtr properties
Definition: SdfParser.cpp:80
std::string * name
Definition: SkelParser.cpp:1642
const AspectProperties & getAspectProperties() const
Definition: EmbeddedAspect.hpp:414
Definition: CompositeData.hpp:180
BodyNode class represents a single node of the skeleton.
Definition: BodyNode.hpp:78
const std::string & getName() const override
Get the name of this Node.
Definition: BodyNode.cpp:427
void removeAllShapeNodesWith()
Remove all ShapeNodes containing given Aspect from this BodyNode.
Definition: BodyNode.hpp:255
ShapeNode * createShapeNode(ShapeNodeProperties properties, bool automaticName=true)
Create an ShapeNode attached to this BodyNode.
Definition: BodyNode.hpp:144
SkeletonPtr getSkeleton() override
Return the Skeleton that this Node is attached to.
Definition: BodyNode.cpp:798
std::size_t getNumShapeNodes() const
Definition: BodyNode.cpp:894
NodeType * createNode(Args &&... args)
Create some Node type and attach it to this BodyNode.
Definition: BodyNode.hpp:134
const std::vector< ShapeNode * > getShapeNodesWith()
Return the list of ShapeNodes containing given Aspect.
Definition: BodyNode.hpp:217
JointType * changeParentJointType(const typename JointType::Properties &_joint=typename JointType::Properties())
Change the Joint type of this BodyNode's parent Joint.
Definition: BodyNode.hpp:79
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:124
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:750
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:787
bool moveTo(BodyNode *_newParent)
Remove this BodyNode and all of its children (recursively) from their current parent BodyNode,...
Definition: BodyNode.cpp:726
ShapeNode * createShapeNodeWith(const ShapePtr &shape)
Create a ShapeNode with the specified Aspects and an automatically assigned name: <BodyNodeName>Shape...
Definition: BodyNode.hpp:181
ShapeNode * getShapeNode(std::size_t index)
Definition: BodyNode.cpp:894
BodyNode * getParentBodyNode()
Return the parent BodyNdoe of this BodyNode.
Definition: BodyNode.cpp:822
std::size_t getNumShapeNodesWith() const
Return the number of ShapeNodes containing given Aspect in this BodyNode.
Definition: BodyNode.hpp:201
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:760
Definition: ShapeNode.hpp:49
static SkeletonPtr create(const std::string &_name="Skeleton")
Create a new Skeleton inside of a shared_ptr.
Definition: Skeleton.cpp:341
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
Definition: BulletCollisionDetector.cpp:63