|
SDFormat Editor
|
Implementation of SDFormatParserI. More...
#include <sdformat_parser.h>


Private Member Functions | |
| void | Initialize (const std::string file_path, bool &success) override |
| Implementation of interface method. | |
| sdf::SDFPtr | GetSDFElement () override |
| Implementation of interface method. | |
| std::vector< sdf::ElementPtr > | LookupElementsByAttributeType (const std::string &attribute_type) override |
| Implementation of interface method. | |
| std::vector< sdf::ElementPtr > | LookupElementsByAttributeTypeAndValue (const std::string &attribute_type, const std::string &attribute_value) override |
| Implementation of interface method. | |
| std::vector< sdf::ElementPtr > | LookupElementsInternal (const std::string &attribute_type, const std::string &attribute_value, sdf::ElementPtr scope, sdf::ElementPtr scope_to_exclude) |
| Attempts to find an element containing the given attribute type and attribute value within an inital scope. The method will continue expanding the scope until it reaches the root element. | |
| sdf::ElementPtr | FindScope (sdf::ElementPtr element) |
| Finds the nearest world, model, or root element parent of the given element. | |
| sdf::ElementPtr | FindCanonical (sdf::ElementPtr element) |
| Finds the canonical link of a model and, if that doesn't exist, the first child nested model. | |
| std::vector< sdf::ElementPtr > | LookupElementsByType (const std::string &type) override |
| Implementation of interface method. | |
| Mentions | FindMentions (std::string key) override |
| Implementation of interface method. | |
| Mentions | FindMentions (std::string key, sdf::ElementPtr element_to_exclude) override |
| Implementation of interface method. | |
| Mentions | FindMentions (std::string key, sdf::ParamPtr attribute_to_exclude) override |
| Implementation of interface method. | |
| Mentions | FindMentions (std::string key, sdf::ElementPtr element_to_exclude, sdf::ParamPtr attribute_to_exclude) override |
| Implementation of interface method. | |
| std::string | GetSDFTreePathToElement (sdf::ElementPtr element) override |
| Implementation of interface method. | |
| std::pair< glm::dvec3, glm::dquat > | FindAbsolutePose (sdf::ElementPtr element, std::vector< sdf::ElementPtr > previously_visited_elements={}) |
| Finds the absolute pose (translation and rotation) of a given mesh/geometry-containing element. | |
| std::pair< glm::dvec3, glm::dquat > | ParsePoseElement (sdf::ElementPtr element, std::string &relative_to) |
| Parses a given pose element to get the pose values, and also indicates if this pose is relative to anything else. | |
| bool | HandleRelativeToSpecificationSpecialcases (sdf::ElementPtr element, std::string &relative_to) |
| Considers if this is a special case of "relative_to" and approperiately handles it. | |
| std::vector< double > | ParseStringDoubleVector (const std::string &string_of_doubles, bool &success) |
| Given a string containing doubles seperated by spaces, this method returns a vector a doubles. | |
| std::pair< std::vector< ModelViewerI::ModelInfo >, std::vector< ModelViewerI::PresetModelInfo > > | GetModelsFromSDFTree (bool render_collisions=false) override |
| Implementation of interface method. | |
Private Attributes | |
| sdf::SDFPtr | sdfElement |
| The main sdfElement associated this this SDFormatParser instance. | |
| std::string | sdf_file_path |
| Store the file path of the sdf file. | |
Additional Inherited Members |
Implementation of SDFormatParserI.
|
private |
Finds the absolute pose (translation and rotation) of a given mesh/geometry-containing element.
| [in] | element | The element for which we want to find absolute position |
| [in] | previously_visited_elements | indicates elements that were previously visited as we are trying to compute absolute pose. Used to detect a reference cycle in "relative_to" mentions. |
|
private |
Finds the canonical link of a model and, if that doesn't exist, the first child nested model.
| [in] | element | we want to the "canonical" of, must be a model element |
|
overrideprivatevirtual |
Implementation of interface method.
| [in] | key | the string to search for |
Implements SDFormatParserI.
|
overrideprivatevirtual |
Implementation of interface method.
| [in] | key | the string to search for |
| [in] | element_to_exclude | the element to exclude in the search |
Implements SDFormatParserI.
|
overrideprivatevirtual |
Implementation of interface method.
| [in] | key | the string to search for |
| [in] | element_to_exclude | the element to exclude in the search; Can be nullptr |
| [in] | attribute_to_exclude | the attribute to exclude in the search; Can be nullptr |
Implements SDFormatParserI.
|
overrideprivatevirtual |
Implementation of interface method.
| [in] | key | the string to search for |
| [in] | attribute_to_exclude | the attribute to exclude in the search |
Implements SDFormatParserI.
|
private |
Finds the nearest world, model, or root element parent of the given element.
| [in] | element | we want to get the scope for |
|
overrideprivatevirtual |
Implementation of interface method.
| [in] | render_collisions | indicates if collision meshes and shapes are included as well |
Implements SDFormatParserI.
|
overrideprivatevirtual |
Implementation of interface method.
Implements SDFormatParserI.
|
overrideprivatevirtual |
Implementation of interface method.
| [in] | element | element that we want a tree path for |
Implements SDFormatParserI.
|
private |
Considers if this is a special case of "relative_to" and approperiately handles it.
| [in] | element | The element to consider |
| [out] | relative_to | The "relative_to" specification |
|
overrideprivatevirtual |
Implementation of interface method.
Implements SDFormatParserI.
|
overrideprivatevirtual |
Implementation of interface method.
| [in] | attribute_type | The attribute type to use for lookup |
Implements SDFormatParserI.
|
overrideprivatevirtual |
Implementation of interface method.
| [in] | attribute_type | The attribute type to use for lookup |
| [in] | attribute_value | The attribute type to use for lookup |
Implements SDFormatParserI.
|
overrideprivatevirtual |
Implementation of interface method.
| [in] | type | The type by which to lookup elements |
Implements SDFormatParserI.
|
private |
Attempts to find an element containing the given attribute type and attribute value within an inital scope. The method will continue expanding the scope until it reaches the root element.
| [in] | attribute_type | The attribute type to use for lookup |
| [in] | attribute_value | The attribute type to use for lookup |
| [in] | scope | The initial search scope. Must be a model or world element |
| [in] | scope_to_exclude | The scope to exclude. Must be a model or world element |
|
private |
Parses a given pose element to get the pose values, and also indicates if this pose is relative to anything else.
| [in] | element | The pose element which we want to parse |
| [out] | relative_to | The name of the element that the pose is given relative to |
|
private |
Given a string containing doubles seperated by spaces, this method returns a vector a doubles.
| [in] | string_of_doubles | a string of doubles (should be parsable by std::istringstream) |
| [out] | success | True if the string of doubles was sucessfully parsed |