|
| | Root () |
| | Default constructor.
|
| |
| | ~Root () |
| | Destructor.
|
| |
| const Actor * | ActorByIndex (const uint64_t _index) const |
| | Get an actor based on an index.
|
| |
| uint64_t | ActorCount () const |
| | Get the number of actors.
|
| |
| bool | ActorNameExists (const std::string &_name) const |
| | Get whether an actor name exists.
|
| |
| sdf::ElementPtr | Element () const |
| | Get a pointer to the SDF element that was generated during load.
|
| |
| const Light * | LightByIndex (const uint64_t _index) const |
| | Get a light based on an index.
|
| |
| uint64_t | LightCount () const |
| | Get the number of lights.
|
| |
| bool | LightNameExists (const std::string &_name) const |
| | Get whether a light name 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 std::string &_filename) |
| | 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.
|
| |
| const Model * | ModelByIndex (const uint64_t _index) const |
| | Get a model based on an index.
|
| |
| uint64_t | ModelCount () const |
| | Get the number of models.
|
| |
| bool | ModelNameExists (const std::string &_name) const |
| | Get whether a model name 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:89