| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #ifndef MUJOCO_SRC_XML_XML_NATIVE_READER_H_ |
| | #define MUJOCO_SRC_XML_XML_NATIVE_READER_H_ |
| |
|
| | #include <sstream> |
| | #include <string> |
| |
|
| | #include <mujoco/mujoco.h> |
| | #include <mujoco/mjspec.h> |
| | #include "user/user_util.h" |
| | #include "xml/xml_base.h" |
| | #include "xml/xml_util.h" |
| | #include "tinyxml2.h" |
| |
|
| | class mjXReader : public mjXBase { |
| | public: |
| | mjXReader(); |
| | virtual ~mjXReader() = default; |
| |
|
| | void Parse(tinyxml2::XMLElement* root, const mjVFS* vfs = nullptr); |
| | void PrintSchema(std::stringstream& str, bool html, bool pad); |
| |
|
| | void SetModelFileDir(const std::string& modelfiledir); |
| | const mujoco::user::FilePath& ModelFileDir() const { return modelfiledir_; } |
| |
|
| | |
| | void SetAssetDir(const std::string& assetdir); |
| | void SetMeshDir(const std::string& meshdir); |
| | void SetTextureDir(const std::string& texturedir); |
| |
|
| | |
| | static void Compiler(tinyxml2::XMLElement* section, mjSpec* s); |
| | static void Option(tinyxml2::XMLElement* section, mjOption* opt); |
| | static void Size(tinyxml2::XMLElement* section, mjSpec* s); |
| |
|
| | private: |
| | |
| | void Default(tinyxml2::XMLElement* section, const mjsDefault* def, |
| | const mjVFS* vfs); |
| | void Extension(tinyxml2::XMLElement* section); |
| | void Custom(tinyxml2::XMLElement* section); |
| | void Visual(tinyxml2::XMLElement* section); |
| | void Statistic(tinyxml2::XMLElement* section); |
| | void Asset(tinyxml2::XMLElement* section, const mjVFS* vfs); |
| | void Body(tinyxml2::XMLElement* section, mjsBody* pbody, |
| | mjsFrame* pframe, const mjVFS* vfs); |
| | void Contact(tinyxml2::XMLElement* section); |
| | void Deformable(tinyxml2::XMLElement* section, const mjVFS* vfs); |
| | void Equality(tinyxml2::XMLElement* section); |
| | void Tendon(tinyxml2::XMLElement* section); |
| | void Actuator(tinyxml2::XMLElement* section); |
| | void Sensor(tinyxml2::XMLElement* section); |
| | void Keyframe(tinyxml2::XMLElement* section); |
| |
|
| | |
| | void OneFlex(tinyxml2::XMLElement* elem, mjsFlex* pflex); |
| | void OneMesh(tinyxml2::XMLElement* elem, mjsMesh* pmesh, const mjVFS* vfs); |
| | void OneSkin(tinyxml2::XMLElement* elem, mjsSkin* pskin, const mjVFS* vfs); |
| | void OneMaterial(tinyxml2::XMLElement* elem, mjsMaterial* pmaterial); |
| | void OneJoint(tinyxml2::XMLElement* elem, mjsJoint* pjoint); |
| | void OneGeom(tinyxml2::XMLElement* elem, mjsGeom* pgeom); |
| | void OneSite(tinyxml2::XMLElement* elem, mjsSite* site); |
| | void OneCamera(tinyxml2::XMLElement* elem, mjsCamera* pcamera); |
| | void OneLight(tinyxml2::XMLElement* elem, mjsLight* plight); |
| | void OnePair(tinyxml2::XMLElement* elem, mjsPair* ppair); |
| | void OneEquality(tinyxml2::XMLElement* elem, mjsEquality* pequality); |
| | void OneTendon(tinyxml2::XMLElement* elem, mjsTendon* ptendon); |
| | void OneActuator(tinyxml2::XMLElement* elem, mjsActuator* pactuator); |
| | void OneComposite(tinyxml2::XMLElement* elem, mjsBody* pbody, mjsFrame* pframe, |
| | const mjsDefault* def); |
| | void OneFlexcomp(tinyxml2::XMLElement* elem, mjsBody* pbody, const mjVFS* vfs); |
| | void OnePlugin(tinyxml2::XMLElement* elem, mjsPlugin* plugin); |
| |
|
| | mjXSchema schema; |
| | const mjsDefault* GetClass(tinyxml2::XMLElement* section); |
| |
|
| | bool readingdefaults; |
| |
|
| | |
| | mujoco::user::FilePath AssetDir() const; |
| | mujoco::user::FilePath MeshDir() const; |
| | mujoco::user::FilePath TextureDir() const; |
| |
|
| | mujoco::user::FilePath modelfiledir_; |
| | mujoco::user::FilePath assetdir_; |
| | mujoco::user::FilePath meshdir_; |
| | mujoco::user::FilePath texturedir_; |
| | }; |
| |
|
| | |
| | #define nMJCF 239 |
| | extern const char* MJCF[nMJCF][mjXATTRNUM]; |
| |
|
| | #endif |
| |
|