SDFormat Editor
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
SDFormatParserI Class Referenceabstract

Interface for the SDFormat Editor's Parser. More...

#include <sdformat_parser_interface.h>

Inheritance diagram for SDFormatParserI:
Inheritance graph
Collaboration diagram for SDFormatParserI:
Collaboration graph

Classes

struct  Mentions
 Struct to define a "mentions" object type. More...
 

Public Member Functions

virtual void Initialize (const std::string file_path, bool &success)=0
 Initialization of the Parser. Will re-initalize the parser if initalized already.
 
virtual sdf::SDFPtr GetSDFElement ()=0
 Returns the main sdfElement associated this this SDFormatParser instance.
 
virtual std::vector< sdf::ElementPtr > LookupElementsByAttributeType (const std::string &attribute_type)=0
 Provides a list of elements which have an attribute of the given attribute type.
 
virtual std::vector< sdf::ElementPtr > LookupElementsByAttributeTypeAndValue (const std::string &attribute_type, const std::string &attribute_value)=0
 Provides a list of elements which have an attribute of the given attribute type and the given attribute value.
 
virtual std::vector< sdf::ElementPtr > LookupElementsByType (const std::string &type)=0
 Provides a list of elements which are of a given type.
 
virtual Mentions FindMentions (std::string key)=0
 Finds the elements and attributes which mention a given key.
 
virtual Mentions FindMentions (std::string key, sdf::ElementPtr element_to_exclude)=0
 Finds the elements and attributes which mention a given key.
 
virtual Mentions FindMentions (std::string key, sdf::ParamPtr attribute_to_exclude)=0
 Finds the elements and attributes which mention a given key.
 
virtual Mentions FindMentions (std::string key, sdf::ElementPtr element_to_exclude, sdf::ParamPtr attribute_to_exclude)=0
 Finds the elements and attributes which mention a given key.
 
virtual std::string GetSDFTreePathToElement (sdf::ElementPtr element)=0
 Get the tree path to a given element.
 
virtual std::pair< std::vector< ModelViewerI::ModelInfo >, std::vector< ModelViewerI::PresetModelInfo > > GetModelsFromSDFTree (bool render_collisions=false)=0
 Gets information about all models in the sdf tree in a format that can be interperted by the model viewer.
 

Detailed Description

Interface for the SDFormat Editor's Parser.

Member Function Documentation

◆ FindMentions() [1/4]

virtual Mentions SDFormatParserI::FindMentions ( std::string  key)
pure virtual

Finds the elements and attributes which mention a given key.

Parameters
[in]keythe string to search for
Returns
The elements and attributes that mention the given key

Implemented in SDFormatParser.

◆ FindMentions() [2/4]

virtual Mentions SDFormatParserI::FindMentions ( std::string  key,
sdf::ElementPtr  element_to_exclude 
)
pure virtual

Finds the elements and attributes which mention a given key.

Parameters
[in]keythe string to search for
[in]element_to_excludethe element to exclude in the search
Returns
The elements and attributes that mention the given key

Implemented in SDFormatParser.

◆ FindMentions() [3/4]

virtual Mentions SDFormatParserI::FindMentions ( std::string  key,
sdf::ElementPtr  element_to_exclude,
sdf::ParamPtr  attribute_to_exclude 
)
pure virtual

Finds the elements and attributes which mention a given key.

Parameters
[in]keythe string to search for
[in]element_to_excludethe element to exclude in the search
[in]attribute_to_excludethe attribute to exclude in the search
Returns
The elements and attributes that mention the given key

Implemented in SDFormatParser.

◆ FindMentions() [4/4]

virtual Mentions SDFormatParserI::FindMentions ( std::string  key,
sdf::ParamPtr  attribute_to_exclude 
)
pure virtual

Finds the elements and attributes which mention a given key.

Parameters
[in]keythe string to search for
[in]attribute_to_excludethe attribute to exclude in the search
Returns
The elements and attributes that mention the given key

Implemented in SDFormatParser.

◆ GetModelsFromSDFTree()

virtual std::pair< std::vector< ModelViewerI::ModelInfo >, std::vector< ModelViewerI::PresetModelInfo > > SDFormatParserI::GetModelsFromSDFTree ( bool  render_collisions = false)
pure virtual

Gets information about all models in the sdf tree in a format that can be interperted by the model viewer.

Parameters
[in]render_collisionsindicates if collision meshes and shapes are included as well
Returns
A pair of vectors condaining structs of the model viewer interfaces's ModelInfo and Preset Model Info, which in turn contain the necessary information to render models

Implemented in SDFormatParser.

◆ GetSDFElement()

virtual sdf::SDFPtr SDFormatParserI::GetSDFElement ( )
pure virtual

Returns the main sdfElement associated this this SDFormatParser instance.

Returns
the main sdfElement associated this this SDFormatParser instance

Implemented in SDFormatParser.

◆ GetSDFTreePathToElement()

virtual std::string SDFormatParserI::GetSDFTreePathToElement ( sdf::ElementPtr  element)
pure virtual

Get the tree path to a given element.

Parameters
[in]elementelement that we want a tree path for
Returns
Tree path as a string

Implemented in SDFormatParser.

◆ Initialize()

virtual void SDFormatParserI::Initialize ( const std::string  file_path,
bool &  success 
)
pure virtual

Initialization of the Parser. Will re-initalize the parser if initalized already.

Parameters
[in]file_pathThe relative or absolute filepath to the SDF model. If relative, a relative_to path must be specified.
[out]successTrue if SDFParser initalization is successful

Implemented in SDFormatParser.

◆ LookupElementsByAttributeType()

virtual std::vector< sdf::ElementPtr > SDFormatParserI::LookupElementsByAttributeType ( const std::string &  attribute_type)
pure virtual

Provides a list of elements which have an attribute of the given attribute type.

Parameters
[in]attribute_typeThe attribute type to use for lookup
Returns
A list of elements with a given attribute type

Implemented in SDFormatParser.

◆ LookupElementsByAttributeTypeAndValue()

virtual std::vector< sdf::ElementPtr > SDFormatParserI::LookupElementsByAttributeTypeAndValue ( const std::string &  attribute_type,
const std::string &  attribute_value 
)
pure virtual

Provides a list of elements which have an attribute of the given attribute type and the given attribute value.

Parameters
[in]attribute_typeThe attribute type to use for lookup
[in]attribute_valueThe attribute type to use for lookup
Returns
A list of elements with the given attribute type and the given attribute value

Implemented in SDFormatParser.

◆ LookupElementsByType()

virtual std::vector< sdf::ElementPtr > SDFormatParserI::LookupElementsByType ( const std::string &  type)
pure virtual

Provides a list of elements which are of a given type.

Parameters
[in]typeThe type by which to lookup elements
Returns
A list of elements with a given attribute type

Implemented in SDFormatParser.


The documentation for this class was generated from the following file: