| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #ifndef MUJOCO_SRC_XML_XML_NATIVE_WRITER_H_ |
| | #define MUJOCO_SRC_XML_XML_NATIVE_WRITER_H_ |
| |
|
| | #include <cstdlib> |
| | #include <string> |
| | #include <string_view> |
| |
|
| | #include <mujoco/mjmodel.h> |
| | #include <mujoco/mjspec.h> |
| | #include "user/user_objects.h" |
| | #include "xml/xml_base.h" |
| | #include "tinyxml2.h" |
| |
|
| | class mjXWriter : public mjXBase { |
| | public: |
| | mjXWriter(); |
| | virtual ~mjXWriter() = default; |
| | void SetModel(mjSpec* _spec, const mjModel* m = nullptr); |
| |
|
| | |
| | std::string Write(char *error, std::size_t error_sz); |
| |
|
| | private: |
| | |
| | tinyxml2::XMLElement* InsertEnd(tinyxml2::XMLElement* parent, const char* name); |
| |
|
| | |
| | mjCModel* model = 0; |
| |
|
| | |
| | void Compiler(tinyxml2::XMLElement* root); |
| | void Option(tinyxml2::XMLElement* root); |
| | void Size(tinyxml2::XMLElement* root); |
| | void Visual(tinyxml2::XMLElement* root); |
| | void Statistic(tinyxml2::XMLElement* root); |
| | void Default(tinyxml2::XMLElement* root, mjCDef* def); |
| | void Extension(tinyxml2::XMLElement* root); |
| | void Custom(tinyxml2::XMLElement* root); |
| | void Asset(tinyxml2::XMLElement* root); |
| | void Contact(tinyxml2::XMLElement* root); |
| | void Deformable(tinyxml2::XMLElement* root); |
| | void Equality(tinyxml2::XMLElement* root); |
| | void Tendon(tinyxml2::XMLElement* root); |
| | void Actuator(tinyxml2::XMLElement* root); |
| | void Sensor(tinyxml2::XMLElement* root); |
| | void Keyframe(tinyxml2::XMLElement* root); |
| |
|
| | |
| | void Body(tinyxml2::XMLElement* elem, mjCBody* body, mjCFrame* frame, std::string_view childclass = ""); |
| |
|
| | |
| | void OneFlex(tinyxml2::XMLElement* elem, const mjCFlex* pflex); |
| | void OneMesh(tinyxml2::XMLElement* elem, const mjCMesh* pmesh, mjCDef* def); |
| | void OneSkin(tinyxml2::XMLElement* elem, const mjCSkin* pskin); |
| | void OneMaterial(tinyxml2::XMLElement* elem, const mjCMaterial* pmaterial, mjCDef* def); |
| | void OneJoint(tinyxml2::XMLElement* elem, const mjCJoint* pjoint, mjCDef* def, |
| | std::string_view classname = ""); |
| | void OneGeom(tinyxml2::XMLElement* elem, const mjCGeom* pgeom, mjCDef* def, |
| | std::string_view classname = ""); |
| | void OneSite(tinyxml2::XMLElement* elem, const mjCSite* psite, mjCDef* def, |
| | std::string_view classname = ""); |
| | void OneCamera(tinyxml2::XMLElement* elem, const mjCCamera* pcamera, |
| | mjCDef* def, std::string_view classname = ""); |
| | void OneLight(tinyxml2::XMLElement* elem, const mjCLight* plight, mjCDef* def, |
| | std::string_view classname = ""); |
| | void OnePair(tinyxml2::XMLElement* elem, const mjCPair* ppair, mjCDef* def); |
| | void OneEquality(tinyxml2::XMLElement* elem, const mjCEquality* pequality, mjCDef* def); |
| | void OneTendon(tinyxml2::XMLElement* elem, const mjCTendon* ptendon, mjCDef* def); |
| | void OneActuator(tinyxml2::XMLElement* elem, const mjCActuator* pactuator, mjCDef* def); |
| | void OnePlugin(tinyxml2::XMLElement* elem, const mjsPlugin* plugin); |
| | tinyxml2::XMLElement* OneFrame(tinyxml2::XMLElement* elem, mjCFrame* frame); |
| |
|
| | bool writingdefaults; |
| | }; |
| |
|
| | #endif |
| |
|