Contains the necessary information about an included model file for custom model parsers to be able to find the file and parse it. More...
#include <InterfaceElements.hh>
Public Member Functions | |
NestedInclude () | |
Constructor. | |
const std::string & | AbsoluteParentName () const |
Name of the parent entity in absolute hierarchy. | |
sdf::ElementPtr | IncludeElement () const |
This is the //include element. | |
const std::optional< std::string > & | IncludePoseRelativeTo () const |
The relative-to frame of the pose as specified in //include/pose/@relative_to . | |
const std::optional< gz::math::Pose3d > & | IncludeRawPose () const |
The raw pose as specified in //include/pose . | |
const std::optional< bool > & | IsMerge () const |
Whether the interface model is to be merge-included. | |
const std::optional< bool > & | IsStatic () const |
Whether the model is static as defined by //include/static . | |
const std::optional< std::string > & | LocalModelName () const |
Name relative to immediate parent as specified in //include/name . | |
const std::optional< std::string > & | PlacementFrame () const |
The placement frame as specified in //include/placement_frame . | |
const std::string & | ResolvedFileName () const |
Provides the resolved absolute file path from the URI. | |
void | SetAbsoluteParentName (const std::string &_absoluteparentname) |
Set the absolute name of parent entity. | |
void | SetIncludeElement (sdf::ElementPtr _includeElement) |
Set the //include element. | |
void | SetIncludePoseRelativeTo (const std::string &_includePoseRelativeTo) |
Set the relative-to frame of the pose. | |
void | SetIncludeRawPose (const gz::math::Pose3d &_includeRawPose) |
Set the raw pose as specified in //include/pose . | |
void | SetIsMerge (bool _isMerge) |
Set whether the interface model is to be merge-included (i.e set the value of //include/[@merge] ) | |
void | SetIsStatic (bool _isStatic) |
Set whether the model is static. | |
void | SetLocalModelName (const std::string &_localModelName) |
Set the name relative to immediate parent as specified in //include/name | |
void | SetPlacementFrame (const std::string &_placementFrame) |
Set the placement frame. | |
void | SetResolvedFileName (const std::string &_resolvedFileName) |
Set the resolved absolute file path. | |
void | SetUri (const std::string &_uri) |
Set the URI of the included model. | |
const std::string & | Uri () const |
Provides the URI as specified in //include/uri . | |
Contains the necessary information about an included model file for custom model parsers to be able to find the file and parse it.
sdf::SDF_VERSION_NAMESPACE::NestedInclude::NestedInclude | ( | ) |
Constructor.
const std::string & sdf::SDF_VERSION_NAMESPACE::NestedInclude::AbsoluteParentName | ( | ) | const |
Name of the parent entity in absolute hierarchy.
Example: if the interface model's name is top_model::middle_model::my_new_model
, the absoluteParentName would be top_model::middle_model
. If the parent entity is the world, this would be an empty string.
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::NestedInclude::IncludeElement | ( | ) | const |
This is the //include
element.
This can be used to pass custom elements and attributes to the custom model parser.
//include
element const std::optional< std::string > & sdf::SDF_VERSION_NAMESPACE::NestedInclude::IncludePoseRelativeTo | ( | ) | const |
The relative-to frame of the pose as specified in //include/pose/@relative_to
.
This is nullopt if //include/pose/@relative_to
is not set.
//include/pose/@relative_to
is not set. const std::optional< gz::math::Pose3d > & sdf::SDF_VERSION_NAMESPACE::NestedInclude::IncludeRawPose | ( | ) | const |
The raw pose as specified in //include/pose
.
This is nullopt if //include/pose
is not set.
//include/pose
is not set. const std::optional< bool > & sdf::SDF_VERSION_NAMESPACE::NestedInclude::IsMerge | ( | ) | const |
Whether the interface model is to be merge-included.
//include/[@merge]
is set, this returns the value of the attribute, otherwise, nullopt. const std::optional< bool > & sdf::SDF_VERSION_NAMESPACE::NestedInclude::IsStatic | ( | ) | const |
Whether the model is static as defined by //include/static
.
This is nullopt if //include/static
is not set.
//include/static
is not set. const std::optional< std::string > & sdf::SDF_VERSION_NAMESPACE::NestedInclude::LocalModelName | ( | ) | const |
Name relative to immediate parent as specified in //include/name
.
This is nullopt if //include/name
is not set. Then the name of the model must be determined by the custom model parser from the included model file. Example: my_new_model
//include/name
is not set const std::optional< std::string > & sdf::SDF_VERSION_NAMESPACE::NestedInclude::PlacementFrame | ( | ) | const |
The placement frame as specified in //include/placement_frame
.
This is nullopt if //include/placement_frame
is is not set.
//include/placement_frame
is is not set. const std::string & sdf::SDF_VERSION_NAMESPACE::NestedInclude::ResolvedFileName | ( | ) | const |
Provides the resolved absolute file path from the URI.
It is recommended to use this in CustomModelParser
when checking predicates on filenames – however, the predicates should generally only check the file extension.
void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetAbsoluteParentName | ( | const std::string & | _absoluteparentname | ) |
Set the absolute name of parent entity.
[in] | _absoluteparentname | Absolute name of parent entity |
void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetIncludeElement | ( | sdf::ElementPtr | _includeElement | ) |
Set the //include
element.
[in] | _includeElement | The include element |
void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetIncludePoseRelativeTo | ( | const std::string & | _includePoseRelativeTo | ) |
Set the relative-to frame of the pose.
[in] | _includePoseRelativeTo | The relative-to frame. |
void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetIncludeRawPose | ( | const gz::math::Pose3d & | _includeRawPose | ) |
Set the raw pose as specified in //include/pose
.
[in] | _includeRawPose | The raw pose |
void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetIsMerge | ( | bool | _isMerge | ) |
Set whether the interface model is to be merge-included (i.e set the value of //include/[@merge]
)
[in] | _isMerge | True if the interface model is to be merge included |
void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetIsStatic | ( | bool | _isStatic | ) |
Set whether the model is static.
[in] | _isStatic | True if the model is static. |
void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetLocalModelName | ( | const std::string & | _localModelName | ) |
Set the name relative to immediate parent as specified in //include/name
[in] | _localModelName | The local name |
void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetPlacementFrame | ( | const std::string & | _placementFrame | ) |
Set the placement frame.
[in] | _placementFrame | The placement frame. |
void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetResolvedFileName | ( | const std::string & | _resolvedFileName | ) |
Set the resolved absolute file path.
[in] | _resolvedFileName | The resolved absolute file path |
void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetUri | ( | const std::string & | _uri | ) |
Set the URI of the included model.
[in] | _uri | URI of the included model |
const std::string & sdf::SDF_VERSION_NAMESPACE::NestedInclude::Uri | ( | ) | const |
Provides the URI as specified in //include/uri
.
This may or may not end with a file extension (it will not end with an extension if it refers to a model package).