|
| Root () |
| Default constructor.
|
|
const sdf::Actor * | Actor () const |
| Get a pointer to the actor object if it exists.
|
|
sdf::ElementPtr | Element () const |
| Get a pointer to the SDF element that was generated during load.
|
|
const sdf::Light * | Light () const |
| Get a pointer to the light object if it exists.
|
|
Errors | Load (const SDFPtr _sdf) |
| Parse the given SDF pointer, and generate objects based on types specified in the SDF file.
|
|
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 | Load (const std::string &_filename) |
| Parse the given SDF file, and generate objects based on types specified in the SDF file.
|
|
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.
|
|
Errors | LoadSdfString (const std::string &_sdf) |
| Parse the given SDF string, and generate objects based on types specified in the SDF file.
|
|
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.
|
|
const sdf::Model * | Model () const |
| Get a pointer to the model object if it exists.
|
|
void | SetVersion (const std::string &_version) |
| Set the SDF version string.
|
|
std::string | Version () const |
| Get the SDF version specified in the parsed file or SDF pointer.
|
|
const World * | WorldByIndex (const uint64_t _index) const |
| Get a world based on an index.
|
|
uint64_t | WorldCount () const |
| Get the number of worlds.
|
|
bool | WorldNameExists (const std::string &_name) const |
| Get whether a world name exists.
|
|
Root class that acts as an entry point to the SDF document model.
Multiple worlds can exist in a single SDF file. A user of multiple worlds could run parallel instances of simulation, or offer selection of a world at runtime.
Usage
In this example, a root object is loaded from a file specified in the first command line argument to a program.
if (errors.empty())
{
std::cerr << "Valid SDF file.\n";
return 0;
}
else
{
std::cerr << "Errors encountered: \n";
for (auto const &e : errors)
{
std::cout << e << std::endl;
}
}
Root class that acts as an entry point to the SDF document model.
Definition Root.hh:55
Errors Load(const std::string &_filename)
Parse the given SDF file, and generate objects based on types specified in the SDF file.
std::vector< Error > Errors
A vector of Error.
Definition Types.hh:106