Support FilePaths instead of raw strings in XML code.
PiperOrigin-RevId: 655177026 Change-Id: I55b055551384b01ba7a4baa5d75fbe3329b7d25d
This commit is contained in:
committed by
Copybara-Service
parent
2d24c58819
commit
2746cb8559
+15
-14
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <mujoco/mujoco.h>
|
||||
#include <mujoco/mjspec.h>
|
||||
#include "user/user_util.h"
|
||||
#include "xml/xml_base.h"
|
||||
#include "xml/xml_util.h"
|
||||
|
||||
@@ -33,13 +34,13 @@ class mjXReader : public mjXBase {
|
||||
void Parse(tinyxml2::XMLElement* root, const mjVFS* vfs = nullptr); // parse XML document
|
||||
void PrintSchema(std::stringstream& str, bool html, bool pad); // print text or HTML schema
|
||||
|
||||
void SetModelFileDir(std::string modelfiledir);
|
||||
const std::string& ModelFileDir() const { return modelfiledir_; }
|
||||
void SetModelFileDir(const std::string& modelfiledir);
|
||||
const mujoco::user::FilePath& ModelFileDir() const { return modelfiledir_; }
|
||||
|
||||
// setters for directory defaults
|
||||
void SetAssetDir(std::string assetdir);
|
||||
void SetMeshDir(std::string meshdir);
|
||||
void SetTextureDir(std::string texturedir);
|
||||
void SetAssetDir(const std::string& assetdir);
|
||||
void SetMeshDir(const std::string& meshdir);
|
||||
void SetTextureDir(const std::string& texturedir);
|
||||
|
||||
// XML sections embedded in all formats
|
||||
static void Compiler(tinyxml2::XMLElement* section, mjSpec* spec); // compiler section
|
||||
@@ -82,20 +83,20 @@ class mjXReader : public mjXBase {
|
||||
void OneFlexcomp(tinyxml2::XMLElement* elem, mjsBody* pbody);
|
||||
void OnePlugin(tinyxml2::XMLElement* elem, mjsPlugin* plugin);
|
||||
|
||||
mjXSchema schema; // schema used for validation
|
||||
mjsDefault* GetClass(tinyxml2::XMLElement* section); // get default class name
|
||||
mjXSchema schema; // schema used for validation
|
||||
mjsDefault* GetClass(tinyxml2::XMLElement* section); // get default class name
|
||||
|
||||
bool readingdefaults; // true while reading defaults
|
||||
|
||||
// accessors for directory defaults
|
||||
std::string AssetDir() const;
|
||||
std::string MeshDir() const;
|
||||
std::string TextureDir() const;
|
||||
mujoco::user::FilePath AssetDir() const;
|
||||
mujoco::user::FilePath MeshDir() const;
|
||||
mujoco::user::FilePath TextureDir() const;
|
||||
|
||||
std::string modelfiledir_;
|
||||
std::string assetdir_;
|
||||
std::string meshdir_;
|
||||
std::string texturedir_;
|
||||
mujoco::user::FilePath modelfiledir_;
|
||||
mujoco::user::FilePath assetdir_;
|
||||
mujoco::user::FilePath meshdir_;
|
||||
mujoco::user::FilePath texturedir_;
|
||||
};
|
||||
|
||||
// MJCF schema
|
||||
|
||||
Reference in New Issue
Block a user