22#include <gz/utils/ImplPtr.hh>
34 inline namespace SDF_VERSION_NAMESPACE {
71 std::vector<std::string> &_worldNames);
87 const std::string &_filename,
const ParserConfig &_config);
250 GZ_UTILS_IMPL_PTR(dataPtr)
Provides a description of an actor.
Definition: Actor.hh:192
Provides a description of a light source.
Definition: Light.hh:64
This class contains configuration options for SDF output.
Definition: OutputConfig.hh:59
static OutputConfig & GlobalConfig()
Mutable access to a singleton OutputConfig that serves as the global OutputConfig object for all pars...
This class contains configuration options for the libsdformat parser.
Definition: ParserConfig.hh:100
Root class that acts as an entry point to the SDF document model.
Definition: Root.hh:58
Root()
Default constructor.
Errors LoadSdfString(const std::string &_sdf, const ParserConfig &_config)
Parse the given SDF string, and generate objects based on types specified in the SDF file.
uint64_t WorldCount() const
Get the number of worlds.
const sdf::Light * Light() const
Get a pointer to the light object if it exists.
void SetActor(const sdf::Actor &_actor)
Set the actor object.
const World * WorldByName(const std::string &_name) const
Get a world based on a name.
Errors Load(const SDFPtr _sdf)
Parse the given SDF pointer, and generate objects based on types specified in the SDF file.
void SetModel(const sdf::Model &_model)
Set the model object.
sdf::Root Clone() const
Deep copy this Root object and return the new Root object.
sdf::ElementPtr ToElement(const OutputConfig &_config=OutputConfig::GlobalConfig()) const
Create and return an SDF element filled with data from this root.
const sdf::Model * Model() const
Get a pointer to the model object if it exists.
Errors Load(const SDFPtr _sdf, const ParserConfig &_config)
Parse the given SDF pointer, and generate objects based on types specified in the SDF file.
Errors UpdateGraphs()
Recreate the frame and pose graphs for the worlds and model that are children of this Root object.
World * WorldByName(const std::string &_name)
Get a world based on a name.
void SetLight(const sdf::Light &_light)
Set the light object.
std::string Version() const
Get the SDF version specified in the parsed file or SDF pointer.
sdf::ElementPtr Element() const
Get a pointer to the SDF element that was generated during load.
World * WorldByIndex(const uint64_t _index)
Get a mutable world based on an index.
bool WorldNameExists(const std::string &_name) const
Get whether a world name exists.
void SetVersion(const std::string &_version)
Set the SDF version string.
const sdf::Actor * Actor() const
Get a pointer to the actor object if it exists.
Errors LoadSdfString(const std::string &_sdf)
Parse the given SDF string, and generate objects based on types specified in the SDF file.
void ResolveAutoInertials(sdf::Errors &_errors, const ParserConfig &_config)
Calculate & set the inertial properties (mass, mass matrix and inertial pose) for all the worlds & mo...
Errors AddWorld(const World &_world)
Add a world to the root.
Errors WorldNamesFromFile(const std::string &_filename, std::vector< std::string > &_worldNames)
Get the name of the world without loading the entire world Users shouldn't normally need to use this ...
Errors Load(const std::string &_filename)
Parse the given SDF file, and generate objects based on types specified in the SDF file.
void ClearWorlds()
Remove all worlds.
const World * WorldByIndex(const uint64_t _index) const
Get a world based on an index.
Errors Load(const std::string &_filename, const ParserConfig &_config)
Parse the given SDF file, and generate objects based on types specified in the SDF file.
std::shared_ptr< SDF > SDFPtr
Definition: SDFImpl.hh:52
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:95
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:55
namespace for Simulation Description Format parser
Definition: Actor.hh:35
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:25