DART  6.10.1
Node.hpp File Reference
#include <cassert>
#include "dart/dynamics/Node.hpp"
#include "dart/common/StlHelpers.hpp"

Go to the source code of this file.

Namespaces

 dart
 
 dart::dynamics
 

Macros

#define DART_ENABLE_NODE_SPECIALIZATION()
 
#define DETAIL_DART_INSTANTIATE_SPECIALIZED_NODE(NodeName, it)
 
#define DART_INSTANTIATE_SPECIALIZED_NODE_IRREGULAR(NodeName, PluralName)    DETAIL_DART_INSTANTIATE_SPECIALIZED_NODE(NodeName, m##PluralName##Iterator)
 
#define DART_INSTANTIATE_SPECALIZED_NODE(NodeName)    DART_INSTANTIATE_SPECIALIZED_NODE_IRREGULAR(NodeName, NodeName##s)
 
#define DETAIL_DART_SPECIALIZED_NODE_INLINE(NodeName, PluralName, it)
 
#define DART_SPECIALIZED_NODE_INLINE_IRREGULAR(NodeName, PluralName)
 
#define DART_SPECIALIZED_NODE_INTERNAL(NodeName)    DART_SPECIALIZED_NODE_INLINE_IRREGULAR(NodeName, NodeName##s)
 
#define DETAIL_DART_SPECIALIZED_NODE_DECLARE(NodeName, PluralName, it)
 
#define DART_SPECIALIZED_NODE_DECLARE_IRREGULAR(NodeName, PluralName)
 
#define DART_SPECIALIZED_NODE_DECLARE(NodeName)    DART_SPECIALIZED_NODE_DECLARE_IRREGULAR(NodeName, NodeName##s)
 
#define DETAIL_DART_SPECIALIZED_NODE_DEFINE( BodyNodeType, NodeName, PluralName, it)
 
#define DART_SPECIALIZED_NODE_DEFINE_IRREGULAR( BodyNodeType, NodeName, PluralName)
 
#define DART_SPECIALIZED_NODE_DEFINE(BodyNodeType, NodeName)    DART_SPECIALIZED_NODE_DEFINE_IRREGULAR(BodyNodeType, NodeName, NodeName##s)
 
#define DETAIL_DART_SPECIALIZED_NODE_TEMPLATE( BodyNodeType, NodeName, PluralName)
 
#define DART_SPECIALIZED_NODE_TEMPLATE_IRREGULAR( BodyNodeType, NodeName, PluralName)    DETAIL_DART_SPECIALIZED_NODE_TEMPLATE(BodyNodeType, NodeName, PluralName)
 
#define DART_SPECIALIZED_NODE_TEMPLATE(BodyNodeType, NodeName)    DART_SPECIALIZED_NODE_TEMPLATE_IRREGULAR(BodyNodeType, NodeName, NodeName##s)
 
#define DART_SKEL_ENABLE_NODE_SPECIALIZATION()
 
#define DART_SKEL_INSTANTIATE_SPECIALIZED_NODE_IRREGULAR(NodeName, PluralName)
 
#define DART_SKEL_INSTANTIATE_SPECIALIZED_NODE(NodeName)    DART_SKEL_INSTANTIATE_SPECIALIZED_NODE_IRREGULAR(NodeName, NodeName##s);
 
#define DETAIL_DART_WARN_TREE_INDEX(treeIts, treeIndex, func)
 
#define DETAIL_DART_SKEL_SPECIALIZED_NODE_INLINE( NodeName, PluralName, skelIt, treeIts, NameMgr)
 
#define DART_SKEL_SPECIALIZED_NODE_INLINE_IRREGULAR(NodeName, PluralName)
 
#define DART_SKEL_SPECIALIZED_NODE_INLINE(NodeName)    DART_SKEL_SPECIALIZED_NODE_INLINE_IRREGULAR(NodeName, NodeName##s);
 
#define DETAIL_DART_SKEL_SPECIALIZED_NODE_DECLARE( NodeName, PluralName, skelIt, treeIts, NameMgr)
 
#define DART_SKEL_SPECIALIZED_NODE_DECLARE_IRREGULAR(NodeName, PluralName)
 
#define DART_SKEL_SPECIALIZED_NODE_DECLARE(NodeName)    DART_SKEL_SPECIALIZED_NODE_DECLARE_IRREGULAR(NodeName, NodeName##s);
 
#define DETAIL_DART_SKEL_SPECIALIZED_NODE_DEFINE( SkeletonType, NodeName, PluralName, skelIt, treeIts, NameMgr)
 
#define DART_SKEL_SPECIALIZED_NODE_DEFINED_IRREGULAR( SkeletonType, NodeName, PluralName)
 
#define DART_SKEL_SPECIALIZED_NODE_DEFINE(SkeletonType, NodeName)
 
#define DETAIL_DART_SKEL_SPECIALIZED_NODE_TEMPLATE( SkelType, NodeName, PluralName)
 
#define DART_SKEL_SPECIALIZED_NODE_TEMPLATE_IRREGULAR( SkelType, NodeName, PluralName)    DETAIL_DART_SKEL_SPECIALIZED_NODE_TEMPLATE(SkelType, NodeName, PluralName)
 
#define DART_SKEL_SPECIALIZED_NODE_TEMPLATE(SkelType, NodeName)
 

Macro Definition Documentation

◆ DART_ENABLE_NODE_SPECIALIZATION

#define DART_ENABLE_NODE_SPECIALIZATION ( )
Value:
public: \
template <class T> \
std::size_t getNumNodes() const \
{ \
return dart::dynamics::BodyNode::getNumNodes<T>(); \
} \
template <class T> \
T* getNode(std::size_t index) \
{ \
return dart::dynamics::BodyNode::getNode<T>(index); \
} \
template <class T> \
const T* getNode(std::size_t index) const \
{ \
return dart::dynamics::BodyNode::getNode<T>(index); \
}
std::size_t index
Definition: SkelParser.cpp:1672

◆ DART_INSTANTIATE_SPECALIZED_NODE

#define DART_INSTANTIATE_SPECALIZED_NODE (   NodeName)     DART_INSTANTIATE_SPECIALIZED_NODE_IRREGULAR(NodeName, NodeName##s)

◆ DART_INSTANTIATE_SPECIALIZED_NODE_IRREGULAR

#define DART_INSTANTIATE_SPECIALIZED_NODE_IRREGULAR (   NodeName,
  PluralName 
)     DETAIL_DART_INSTANTIATE_SPECIALIZED_NODE(NodeName, m##PluralName##Iterator)

◆ DART_SKEL_ENABLE_NODE_SPECIALIZATION

#define DART_SKEL_ENABLE_NODE_SPECIALIZATION ( )

◆ DART_SKEL_INSTANTIATE_SPECIALIZED_NODE

#define DART_SKEL_INSTANTIATE_SPECIALIZED_NODE (   NodeName)     DART_SKEL_INSTANTIATE_SPECIALIZED_NODE_IRREGULAR(NodeName, NodeName##s);

◆ DART_SKEL_INSTANTIATE_SPECIALIZED_NODE_IRREGULAR

#define DART_SKEL_INSTANTIATE_SPECIALIZED_NODE_IRREGULAR (   NodeName,
  PluralName 
)
Value:
mSpecializedTreeNodes[typeid(NodeName)] = &mTree##PluralName##Iterators; \
mSkelCache.mNodeMap[typeid(NodeName)] \
= std::vector<dart::dynamics::Node*>(); \
m##PluralName##Iterator = mSkelCache.mNodeMap.find(typeid(NodeName)); \
mNodeNameMgrMap[typeid(NodeName)] = dart::common::NameManager<Node*>( \
std::string("Skeleton::") + #NodeName + " | " \
+ mAspectProperties.mName); \
mNameMgrFor##PluralName = &mNodeNameMgrMap.find(typeid(NodeName))->second;
class NameManager
Definition: NameManager.hpp:62

◆ DART_SKEL_SPECIALIZED_NODE_DECLARE

#define DART_SKEL_SPECIALIZED_NODE_DECLARE (   NodeName)     DART_SKEL_SPECIALIZED_NODE_DECLARE_IRREGULAR(NodeName, NodeName##s);

◆ DART_SKEL_SPECIALIZED_NODE_DECLARE_IRREGULAR

#define DART_SKEL_SPECIALIZED_NODE_DECLARE_IRREGULAR (   NodeName,
  PluralName 
)
Value:
NodeName, \
PluralName, \
m##PluralName##Iterator, \
mTree##PluralName##Iterators, \
mNameMgrFor##PluralName);
#define DETAIL_DART_SKEL_SPECIALIZED_NODE_DECLARE( NodeName, PluralName, skelIt, treeIts, NameMgr)
Definition: Node.hpp:374

◆ DART_SKEL_SPECIALIZED_NODE_DEFINE

#define DART_SKEL_SPECIALIZED_NODE_DEFINE (   SkeletonType,
  NodeName 
)
Value:
SkeletonType, NodeName, NodeName##s);
#define DART_SKEL_SPECIALIZED_NODE_DEFINED_IRREGULAR( SkeletonType, NodeName, PluralName)
Definition: Node.hpp:461

◆ DART_SKEL_SPECIALIZED_NODE_DEFINED_IRREGULAR

#define DART_SKEL_SPECIALIZED_NODE_DEFINED_IRREGULAR (   SkeletonType,
  NodeName,
  PluralName 
)
Value:
SkeletonType, \
NodeName, \
PluralName, \
m##PluralName##Iterator, \
mTree##PluralName##Iterators, \
mNameMgrFor##PluralName);
#define DETAIL_DART_SKEL_SPECIALIZED_NODE_DEFINE( SkeletonType, NodeName, PluralName, skelIt, treeIts, NameMgr)
Definition: Node.hpp:413

◆ DART_SKEL_SPECIALIZED_NODE_INLINE

#define DART_SKEL_SPECIALIZED_NODE_INLINE (   NodeName)     DART_SKEL_SPECIALIZED_NODE_INLINE_IRREGULAR(NodeName, NodeName##s);

◆ DART_SKEL_SPECIALIZED_NODE_INLINE_IRREGULAR

#define DART_SKEL_SPECIALIZED_NODE_INLINE_IRREGULAR (   NodeName,
  PluralName 
)
Value:
NodeName, \
PluralName, \
m##PluralName##Iterator, \
mTree##PluralName##Iterators, \
mNameMgrFor##PluralName);
#define DETAIL_DART_SKEL_SPECIALIZED_NODE_INLINE( NodeName, PluralName, skelIt, treeIts, NameMgr)
Definition: Node.hpp:308

◆ DART_SKEL_SPECIALIZED_NODE_TEMPLATE

#define DART_SKEL_SPECIALIZED_NODE_TEMPLATE (   SkelType,
  NodeName 
)
Value:
SkelType, NodeName, NodeName##s);
#define DART_SKEL_SPECIALIZED_NODE_TEMPLATE_IRREGULAR( SkelType, NodeName, PluralName)
Definition: Node.hpp:524

◆ DART_SKEL_SPECIALIZED_NODE_TEMPLATE_IRREGULAR

#define DART_SKEL_SPECIALIZED_NODE_TEMPLATE_IRREGULAR (   SkelType,
  NodeName,
  PluralName 
)     DETAIL_DART_SKEL_SPECIALIZED_NODE_TEMPLATE(SkelType, NodeName, PluralName)

◆ DART_SPECIALIZED_NODE_DECLARE

#define DART_SPECIALIZED_NODE_DECLARE (   NodeName)     DART_SPECIALIZED_NODE_DECLARE_IRREGULAR(NodeName, NodeName##s)

◆ DART_SPECIALIZED_NODE_DECLARE_IRREGULAR

#define DART_SPECIALIZED_NODE_DECLARE_IRREGULAR (   NodeName,
  PluralName 
)
Value:
NodeName, PluralName, m##PluralName##Iterator)
#define DETAIL_DART_SPECIALIZED_NODE_DECLARE(NodeName, PluralName, it)
Definition: Node.hpp:157

◆ DART_SPECIALIZED_NODE_DEFINE

#define DART_SPECIALIZED_NODE_DEFINE (   BodyNodeType,
  NodeName 
)     DART_SPECIALIZED_NODE_DEFINE_IRREGULAR(BodyNodeType, NodeName, NodeName##s)

◆ DART_SPECIALIZED_NODE_DEFINE_IRREGULAR

#define DART_SPECIALIZED_NODE_DEFINE_IRREGULAR (   BodyNodeType,
  NodeName,
  PluralName 
)
Value:
BodyNodeType, NodeName, PluralName, m##PluralName##Iterator)
#define DETAIL_DART_SPECIALIZED_NODE_DEFINE( BodyNodeType, NodeName, PluralName, it)
Definition: Node.hpp:176

◆ DART_SPECIALIZED_NODE_INLINE_IRREGULAR

#define DART_SPECIALIZED_NODE_INLINE_IRREGULAR (   NodeName,
  PluralName 
)
Value:
NodeName, PluralName, m##PluralName##Iterator)
#define DETAIL_DART_SPECIALIZED_NODE_INLINE(NodeName, PluralName, it)
Definition: Node.hpp:125

◆ DART_SPECIALIZED_NODE_INTERNAL

#define DART_SPECIALIZED_NODE_INTERNAL (   NodeName)     DART_SPECIALIZED_NODE_INLINE_IRREGULAR(NodeName, NodeName##s)

◆ DART_SPECIALIZED_NODE_TEMPLATE

#define DART_SPECIALIZED_NODE_TEMPLATE (   BodyNodeType,
  NodeName 
)     DART_SPECIALIZED_NODE_TEMPLATE_IRREGULAR(BodyNodeType, NodeName, NodeName##s)

◆ DART_SPECIALIZED_NODE_TEMPLATE_IRREGULAR

#define DART_SPECIALIZED_NODE_TEMPLATE_IRREGULAR (   BodyNodeType,
  NodeName,
  PluralName 
)     DETAIL_DART_SPECIALIZED_NODE_TEMPLATE(BodyNodeType, NodeName, PluralName)

◆ DETAIL_DART_INSTANTIATE_SPECIALIZED_NODE

#define DETAIL_DART_INSTANTIATE_SPECIALIZED_NODE (   NodeName,
  it 
)
Value:
mNodeMap[typeid(NodeName)] = std::vector<dart::dynamics::Node*>(); \
it = mNodeMap.find(typeid(NodeName));

◆ DETAIL_DART_SKEL_SPECIALIZED_NODE_DECLARE

#define DETAIL_DART_SKEL_SPECIALIZED_NODE_DECLARE (   NodeName,
  PluralName,
  skelIt,
  treeIts,
  NameMgr 
)
Value:
private: \
std::vector<dart::dynamics::Skeleton::NodeMap::iterator> treeIts; \
dart::common::NameManager<dart::dynamics::Node*>* NameMgr; \
\
public: \
std::size_t getNum##PluralName() const; \
\
std::size_t getNum##PluralName(std::size_t treeIndex) const; \
\
NodeName* get##NodeName(std::size_t index); \
\
NodeName* get##NodeName(std::size_t treeIndex, std::size_t nodeIndex); \
\
const NodeName* get##NodeName(std::size_t index) const; \
\
const NodeName* get##NodeName(std::size_t treeIndex, std::size_t nodeIndex) \
const; \
\
NodeName* get##NodeName(const std::string& name); \
\
const NodeName* get##NodeName(const std::string& name) const;
std::string * name
Definition: SkelParser.cpp:1697
std::multimap< dart::dynamics::Shape *, SimpleFrameShapeDnD * >::iterator iterator
Definition: Viewer.cpp:620

◆ DETAIL_DART_SKEL_SPECIALIZED_NODE_DEFINE

#define DETAIL_DART_SKEL_SPECIALIZED_NODE_DEFINE (   SkeletonType,
  NodeName,
  PluralName,
  skelIt,
  treeIts,
  NameMgr 
)

◆ DETAIL_DART_SKEL_SPECIALIZED_NODE_INLINE

#define DETAIL_DART_SKEL_SPECIALIZED_NODE_INLINE (   NodeName,
  PluralName,
  skelIt,
  treeIts,
  NameMgr 
)

◆ DETAIL_DART_SKEL_SPECIALIZED_NODE_TEMPLATE

#define DETAIL_DART_SKEL_SPECIALIZED_NODE_TEMPLATE (   SkelType,
  NodeName,
  PluralName 
)

◆ DETAIL_DART_SPECIALIZED_NODE_DECLARE

#define DETAIL_DART_SPECIALIZED_NODE_DECLARE (   NodeName,
  PluralName,
  it 
)
Value:
private: \
\
public: \
std::size_t getNum##PluralName() const; \
NodeName* get##NodeName(std::size_t index); \
const NodeName* get##NodeName(std::size_t index) const;

◆ DETAIL_DART_SPECIALIZED_NODE_DEFINE

#define DETAIL_DART_SPECIALIZED_NODE_DEFINE (   BodyNodeType,
  NodeName,
  PluralName,
  it 
)
Value:
std::size_t BodyNodeType ::getNum##PluralName() const \
{ \
return it->second.size(); \
} \
\
NodeName* BodyNodeType ::get##NodeName(std::size_t index) \
{ \
return static_cast<NodeName*>( \
getVectorObjectIfAvailable(index, it->second)); \
} \
\
const NodeName* BodyNodeType ::get##NodeName(std::size_t index) const \
{ \
return static_cast<const NodeName*>( \
getVectorObjectIfAvailable(index, it->second)); \
}

◆ DETAIL_DART_SPECIALIZED_NODE_INLINE

#define DETAIL_DART_SPECIALIZED_NODE_INLINE (   NodeName,
  PluralName,
  it 
)
Value:
private: \
\
public: \
inline std::size_t getNum##PluralName() const \
{ \
return it->second.size(); \
} \
\
inline NodeName* get##NodeName(std::size_t index) \
{ \
return static_cast<NodeName*>( \
getVectorObjectIfAvailable(index, it->second)); \
} \
\
inline const NodeName* get##NodeName(std::size_t index) const \
{ \
return static_cast<const NodeName*>( \
getVectorObjectIfAvailable(index, it->second)); \
}

◆ DETAIL_DART_SPECIALIZED_NODE_TEMPLATE

#define DETAIL_DART_SPECIALIZED_NODE_TEMPLATE (   BodyNodeType,
  NodeName,
  PluralName 
)
Value:
template <> \
inline std::size_t BodyNodeType ::getNumNodes<NodeName>() const \
{ \
return getNum##PluralName(); \
} \
template <> \
inline NodeName* BodyNodeType ::getNode<NodeName>(std::size_t index) \
{ \
return get##NodeName(index); \
} \
template <> \
inline const NodeName* BodyNodeType ::getNode<NodeName>(std::size_t index) \
const \
{ \
return get##NodeName(index); \
}

◆ DETAIL_DART_WARN_TREE_INDEX

#define DETAIL_DART_WARN_TREE_INDEX (   treeIts,
  treeIndex,
  func 
)
Value:
if (treeIndex >= treeIts.size()) \
{ \
dterr << "[" << #func << "] Requesting an invalid tree (" << treeIndex \
<< "). " \
<< "The number of trees in this Skeleton is: " << treeIts.size() \
<< "\n"; \
assert(false); \
return 0; \
}