Public Member Functions | List of all members
sdf::SDF_VERSION_NAMESPACE::NestedInclude Class Reference

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. More...
 
const std::string & AbsoluteParentName () const
 Name of the parent entity in absolute hierarchy. More...
 
sdf::ElementPtr IncludeElement () const
 This is the //include element. More...
 
const std::optional< std::string > & IncludePoseRelativeTo () const
 The relative-to frame of the pose as specified in //include/pose/@relative_to. More...
 
const std::optional< gz::math::Pose3d > & IncludeRawPose () const
 The raw pose as specified in //include/pose. More...
 
const std::optional< bool > & IsMerge () const
 Whether the interface model is to be merge-included. More...
 
const std::optional< bool > & IsStatic () const
 Whether the model is static as defined by //include/static. More...
 
const std::optional< std::string > & LocalModelName () const
 Name relative to immediate parent as specified in //include/name. More...
 
const std::optional< std::string > & PlacementFrame () const
 The placement frame as specified in //include/placement_frame. More...
 
const std::string & ResolvedFileName () const
 Provides the resolved absolute file path from the URI. More...
 
void SetAbsoluteParentName (const std::string &_absoluteparentname)
 Set the absolute name of parent entity. More...
 
void SetIncludeElement (sdf::ElementPtr _includeElement)
 Set the //include element. More...
 
void SetIncludePoseRelativeTo (const std::string &_includePoseRelativeTo)
 Set the relative-to frame of the pose. More...
 
void SetIncludeRawPose (const gz::math::Pose3d &_includeRawPose)
 Set the raw pose as specified in //include/pose. More...
 
void SetIsMerge (bool _isMerge)
 Set whether the interface model is to be merge-included (i.e set the value of //include/[@merge]) More...
 
void SetIsStatic (bool _isStatic)
 Set whether the model is static. More...
 
void SetLocalModelName (const std::string &_localModelName)
 Set the name relative to immediate parent as specified in //include/name More...
 
void SetPlacementFrame (const std::string &_placementFrame)
 Set the placement frame. More...
 
void SetResolvedFileName (const std::string &_resolvedFileName)
 Set the resolved absolute file path. More...
 
void SetUri (const std::string &_uri)
 Set the URI of the included model. More...
 
const std::string & Uri () const
 Provides the URI as specified in //include/uri. More...
 

Detailed Description

Contains the necessary information about an included model file for custom model parsers to be able to find the file and parse it.

Constructor & Destructor Documentation

◆ NestedInclude()

sdf::SDF_VERSION_NAMESPACE::NestedInclude::NestedInclude ( )

Constructor.

Member Function Documentation

◆ AbsoluteParentName()

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.

Returns
Absolute name of parent entity

◆ IncludeElement()

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.

Returns
The //include element

◆ IncludePoseRelativeTo()

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.

Returns
The relative-to frame of the pose. nullopt if //include/pose/@relative_to is not set.

◆ IncludeRawPose()

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.

Returns
The raw pose. nullopt if //include/pose is not set.

◆ IsMerge()

const std::optional<bool>& sdf::SDF_VERSION_NAMESPACE::NestedInclude::IsMerge ( ) const

Whether the interface model is to be merge-included.

Returns
If //include/[@merge] is set, this returns the value of the attribute, otherwise, nullopt.

◆ IsStatic()

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.

Returns
Whether the model is static. nullopt if //include/static is not set.

◆ LocalModelName()

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

Returns
The local name. nullopt if //include/name is not set

◆ PlacementFrame()

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.

Returns
The placement frame. nullopt if //include/placement_frame is is not set.

◆ ResolvedFileName()

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.

Returns
The resolved absolute file path from the URI.

◆ SetAbsoluteParentName()

void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetAbsoluteParentName ( const std::string &  _absoluteparentname)

Set the absolute name of parent entity.

Parameters
[in]_absoluteparentnameAbsolute name of parent entity

◆ SetIncludeElement()

void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetIncludeElement ( sdf::ElementPtr  _includeElement)

Set the //include element.

Parameters
[in]_includeElementThe include element

◆ SetIncludePoseRelativeTo()

void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetIncludePoseRelativeTo ( const std::string &  _includePoseRelativeTo)

Set the relative-to frame of the pose.

Parameters
[in]_includePoseRelativeToThe relative-to frame.

◆ SetIncludeRawPose()

void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetIncludeRawPose ( const gz::math::Pose3d &  _includeRawPose)

Set the raw pose as specified in //include/pose.

Parameters
[in]_includeRawPoseThe raw pose

◆ SetIsMerge()

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])

Parameters
[in]_isMergeTrue if the interface model is to be merge included

◆ SetIsStatic()

void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetIsStatic ( bool  _isStatic)

Set whether the model is static.

Parameters
[in]_isStaticTrue if the model is static.

◆ SetLocalModelName()

void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetLocalModelName ( const std::string &  _localModelName)

Set the name relative to immediate parent as specified in //include/name

Parameters
[in]_localModelNameThe local name

◆ SetPlacementFrame()

void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetPlacementFrame ( const std::string &  _placementFrame)

Set the placement frame.

Parameters
[in]_placementFrameThe placement frame.

◆ SetResolvedFileName()

void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetResolvedFileName ( const std::string &  _resolvedFileName)

Set the resolved absolute file path.

Parameters
[in]_resolvedFileNameThe resolved absolute file path

◆ SetUri()

void sdf::SDF_VERSION_NAMESPACE::NestedInclude::SetUri ( const std::string &  _uri)

Set the URI of the included model.

Parameters
[in]_uriURI of the included model

◆ Uri()

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).

Returns
URI of the included model

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