33#ifndef DART_UTILS_XMLHELPERS_HPP_
34#define DART_UTILS_XMLHELPERS_HPP_
39#include <Eigen/Geometry>
58template <
typename S,
int N>
59std::string
toString(
const Eigen::Matrix<S, N, 1>& v);
62 const Eigen::Transform<S, 3, Eigen::Isometry>& v,
63 const std::string& rotationType =
"intrinsic");
65bool toBool(
const std::string& str);
66int toInt(
const std::string& str);
67unsigned int toUInt(
const std::string& str);
68float toFloat(
const std::string& str);
69double toDouble(
const std::string& str);
70char toChar(
const std::string& str);
71Eigen::Vector2d
toVector2d(
const std::string& str);
72Eigen::Vector2i
toVector2i(
const std::string& str);
73Eigen::Vector3d
toVector3d(
const std::string& str);
74Eigen::Vector3i
toVector3i(
const std::string& str);
75Eigen::Vector4d
toVector4d(
const std::string& str);
77Eigen::VectorXd
toVectorXd(
const std::string& str);
78template <std::
size_t N>
79Eigen::Matrix<double, N, 1>
toVectorNd(
const std::string& str);
85 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
87 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
89 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
91 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
93 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
95 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
97 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
99 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
101 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
103 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
105 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
107 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
109 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
111 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
115 tinyxml2::XMLDocument& doc,
116 const common::Uri& uri,
120 tinyxml2::XMLDocument& doc,
121 const common::Uri& uri,
125 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
128 const tinyxml2::XMLElement* parentElement,
const std::string&
name);
131 tinyxml2::XMLElement* parentElement,
const std::string&
name);
133bool hasAttribute(
const tinyxml2::XMLElement* element,
const char*
const name);
137std::
string getAttribute(tinyxml2::XMLElement* element, const
char* const
name);
142 tinyxml2::XMLElement* element, const
char* const
name,
double* d);
145 const tinyxml2::XMLElement* element, const std::
string& attributeName);
147 const tinyxml2::XMLElement* element, const std::
string& attributeName);
149 const tinyxml2::XMLElement* element, const std::
string& attributeName);
151 const tinyxml2::XMLElement* element, const std::
string& attributeName);
153 const tinyxml2::XMLElement* element, const std::
string& attributeName);
155 const tinyxml2::XMLElement* element, const std::
string& attributeName);
157 const tinyxml2::XMLElement* element, const std::
string& attributeName);
159 const tinyxml2::XMLElement* element, const std::
string& attributeName);
161 const tinyxml2::XMLElement* element, const std::
string& attributeName);
163 const tinyxml2::XMLElement* element, const std::
string& attributeName);
165 const tinyxml2::XMLElement* element, const std::
string& attributeName);
167 const tinyxml2::XMLElement* element, const std::
string& attributeName);
169 const tinyxml2::XMLElement* element, const std::
string& attributeName);
170template <std::
size_t N>
172 const tinyxml2::XMLElement* element, const std::
string& attributeName);
177template <typename ElementType>
187 ElementPtr parentElement,
const std::string& childElementName);
232bool copyNode(tinyxml2::XMLNode* destParent,
const tinyxml2::XMLNode& src);
235 tinyxml2::XMLNode* destParent,
const tinyxml2::XMLNode& src);
#define DART_DEPRECATED(version)
Definition Deprecated.hpp:51
bool valid
Definition SkelParser.cpp:1674
std::string * name
Definition SkelParser.cpp:1698
TemplatedElementEnumerator is a convenience class to help visiting all the child elements of given pa...
Definition XmlHelpers.hpp:179
ElementType & ElementRef
Definition XmlHelpers.hpp:182
ElementPtr mCurrentElement
Currently visiting child element.
Definition XmlHelpers.hpp:224
std::string mChildElementName
Child element name.
Definition XmlHelpers.hpp:221
ElementType * ElementPtr
Definition XmlHelpers.hpp:181
ElementPtr mParentElement
Parent element.
Definition XmlHelpers.hpp:218
Definition Random-impl.hpp:92
Matrix< double, 6, 1 > Vector6d
Definition MathTypes.hpp:49
std::shared_ptr< ResourceRetriever > ResourceRetrieverPtr
Definition ResourceRetriever.hpp:77
bool hasElement(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:589
double getAttributeDouble(const tinyxml2::XMLElement *element, const std::string &attributeName)
Definition XmlHelpers.cpp:822
bool getValueBool(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:411
unsigned int toUInt(const std::string &str)
Definition XmlHelpers.cpp:105
Eigen::Vector6d getValueVector6d(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:529
Eigen::Matrix< double, N, 1 > toVectorNd(const std::string &str)
Definition XmlHelpers-impl.hpp:82
Eigen::Vector4d toVector4d(const std::string &str)
Definition XmlHelpers.cpp:252
Eigen::Isometry3d getValueIsometry3dWithExtrinsicRotation(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:577
bool copyChildNodes(tinyxml2::XMLNode *destParent, const tinyxml2::XMLNode &src)
Definition XmlHelpers.cpp:938
unsigned int getValueUInt(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:445
Eigen::Isometry3d toIsometry3d(const std::string &str)
Definition XmlHelpers.cpp:336
Eigen::Vector3d getAttributeVector3d(const tinyxml2::XMLElement *element, const std::string &attributeName)
Definition XmlHelpers.cpp:867
Eigen::Vector2i toVector2i(const std::string &str)
Definition XmlHelpers.cpp:168
char getAttributeChar(const tinyxml2::XMLElement *element, const std::string &attributeName)
Definition XmlHelpers.cpp:840
Eigen::VectorXd getValueVectorXd(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:541
const tinyxml2::XMLElement * getElement(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:600
Eigen::Vector3d toVector3d(const std::string &str)
Definition XmlHelpers.cpp:196
double toDouble(const std::string &str)
Definition XmlHelpers.cpp:117
float getAttributeFloat(const tinyxml2::XMLElement *element, const std::string &attributeName)
Definition XmlHelpers.cpp:804
Eigen::Vector6d getAttributeVector6d(const tinyxml2::XMLElement *element, const std::string &attributeName)
Definition XmlHelpers.cpp:885
bool copyNode(tinyxml2::XMLNode *destParent, const tinyxml2::XMLNode &src)
Definition XmlHelpers.cpp:903
Eigen::Matrix< double, N, 1 > getAttributeVectorNd(const tinyxml2::XMLElement *element, const std::string &attributeName)
Definition XmlHelpers-impl.hpp:121
std::string getAttribute(tinyxml2::XMLElement *element, const char *const name)
Definition XmlHelpers.cpp:719
Eigen::Isometry3d getValueIsometry3d(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:565
Eigen::Vector4d getAttributeVector4d(const tinyxml2::XMLElement *element, const std::string &attributeName)
Definition XmlHelpers.cpp:876
int toInt(const std::string &str)
Definition XmlHelpers.cpp:99
Eigen::Vector3d getValueVector3d(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:505
Eigen::VectorXd getAttributeVectorXd(const tinyxml2::XMLElement *element, const std::string &attributeName)
Definition XmlHelpers.cpp:894
Eigen::Vector2d toVector2d(const std::string &str)
Definition XmlHelpers.cpp:140
float getValueFloat(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:457
Eigen::Vector3i toVector3i(const std::string &str)
Definition XmlHelpers.cpp:224
Eigen::VectorXd toVectorXd(const std::string &str)
Definition XmlHelpers.cpp:308
Eigen::Isometry3d toIsometry3dWithExtrinsicRotation(const std::string &str)
Definition XmlHelpers.cpp:366
float toFloat(const std::string &str)
Definition XmlHelpers.cpp:111
std::string toString(const Eigen::Matrix< S, N, 1 > &v)
Definition XmlHelpers-impl.hpp:43
int getValueInt(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:433
std::string getAttributeString(const tinyxml2::XMLElement *element, const std::string &attributeName)
Definition XmlHelpers.cpp:732
char toChar(const std::string &str)
Definition XmlHelpers.cpp:123
Eigen::Vector3i getValueVector3i(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:517
Eigen::Vector2d getValueVector2d(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:493
char getValueChar(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:481
std::string getValueString(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:399
Eigen::Vector2d getAttributeVector2d(const tinyxml2::XMLElement *element, const std::string &attributeName)
Definition XmlHelpers.cpp:858
bool toBool(const std::string &str)
Definition XmlHelpers.cpp:84
bool getAttributeBool(const tinyxml2::XMLElement *element, const std::string &attributeName)
Definition XmlHelpers.cpp:749
double getValueDouble(const tinyxml2::XMLElement *parentElement, const std::string &name)
Definition XmlHelpers.cpp:469
Eigen::Vector6d toVector6d(const std::string &str)
Definition XmlHelpers.cpp:280
int getAttributeInt(const tinyxml2::XMLElement *element, const std::string &attributeName)
Definition XmlHelpers.cpp:767
bool readXmlFile(tinyxml2::XMLDocument &doc, const common::Uri &uri, const common::ResourceRetrieverPtr &retrieverOrNullPtr)
Definition XmlHelpers.cpp:688
bool hasAttribute(const tinyxml2::XMLElement *element, const char *const name)
Definition XmlHelpers.cpp:712
void openXMLFile(tinyxml2::XMLDocument &doc, const common::Uri &uri, const common::ResourceRetrieverPtr &retrieverOrNullPtr)
Definition XmlHelpers.cpp:666
Eigen::Vector2i getAttributeVector2i(const tinyxml2::XMLElement *element, const std::string &attributeName)
Definition XmlHelpers.cpp:849
unsigned int getAttributeUInt(const tinyxml2::XMLElement *element, const std::string &attributeName)
Definition XmlHelpers.cpp:785
Definition BulletCollisionDetector.cpp:60