Public Member Functions | Public Attributes | List of all members
sdf::v12::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...
 
 NestedInclude (const NestedInclude &)=default
 
 NestedInclude (NestedInclude &&)=default
 
 ~NestedInclude ()=default
 
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< ignition::math::Pose3d > & IncludeRawPose () const
 The raw pose as specified in //include/pose. 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...
 
NestedIncludeoperator= (const NestedInclude &)=default
 
NestedIncludeoperator= (NestedInclude &&)=default
 
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 ignition::math::Pose3d &_includeRawPose)
 Set the raw pose as specified in //include/pose. 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...
 

Public Attributes

std::string absoluteParentName
 Name of the parent entity in absolute hierarchy. More...
 
sdf::ElementPtr includeElement
 This is the //include element. More...
 
std::optional< std::string > includePoseRelativeTo
 The relative-to frame of the pose as specified in //include/pose/@relative_to. More...
 
std::optional< ignition::math::Pose3d > includeRawPose
 The raw pose as specified in //include/pose. More...
 
std::optional< bool > isStatic
 Whether the model is static as defined by //include/static. More...
 
std::optional< std::string > localModelName
 Name relative to immediate parent as specified in //include/name. More...
 
std::optional< std::string > placementFrame
 The placement frame as specified in //include/placement_frame. More...
 
std::string resolvedFileName
 Provides the resolved absolute file path from the URI. More...
 
std::string uri
 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() [1/3]

sdf::v12::NestedInclude::NestedInclude ( )

Constructor.

◆ NestedInclude() [2/3]

sdf::v12::NestedInclude::NestedInclude ( const NestedInclude )
default

◆ NestedInclude() [3/3]

sdf::v12::NestedInclude::NestedInclude ( NestedInclude &&  )
default

◆ ~NestedInclude()

sdf::v12::NestedInclude::~NestedInclude ( )
default

Member Function Documentation

◆ AbsoluteParentName()

const std::string& sdf::v12::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::v12::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::v12::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<ignition::math::Pose3d>& sdf::v12::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.

◆ IsStatic()

const std::optional<bool>& sdf::v12::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::v12::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

◆ operator=() [1/2]

NestedInclude& sdf::v12::NestedInclude::operator= ( const NestedInclude )
default

◆ operator=() [2/2]

NestedInclude& sdf::v12::NestedInclude::operator= ( NestedInclude &&  )
default

◆ PlacementFrame()

const std::optional<std::string>& sdf::v12::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::v12::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::v12::NestedInclude::SetAbsoluteParentName ( const std::string &  _absoluteparentname)

Set the absolute name of parent entity.

Parameters
[in]_absoluteparentnameAbsolute name of parent entity

◆ SetIncludeElement()

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

Set the //include element.

Parameters
[in]_includeElementThe include element

◆ SetIncludePoseRelativeTo()

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

Set the relative-to frame of the pose.

Parameters
[in]_includePoseRelativeToThe relative-to frame.

◆ SetIncludeRawPose()

void sdf::v12::NestedInclude::SetIncludeRawPose ( const ignition::math::Pose3d &  _includeRawPose)

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

Parameters
[in]_includeRawPoseThe raw pose

◆ SetIsStatic()

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

Set whether the model is static.

Parameters
[in]_isStaticTrue if the model is static.

◆ SetLocalModelName()

void sdf::v12::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::v12::NestedInclude::SetPlacementFrame ( const std::string &  _placementFrame)

Set the placement frame.

Parameters
[in]_placementFrameThe placement frame.

◆ SetResolvedFileName()

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

Set the resolved absolute file path.

Parameters
[in]_resolvedFileNameThe resolved absolute file path

◆ SetUri()

void sdf::v12::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::v12::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

Member Data Documentation

◆ absoluteParentName

std::string sdf::v12::NestedInclude::absoluteParentName

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.

Deprecated:
Use NestedInclude::AbsoluteParentName() instead

◆ includeElement

sdf::ElementPtr sdf::v12::NestedInclude::includeElement

This is the //include element.

This can be used to pass custom elements and attributes to the custom model parser.

Deprecated:
Use NestedInclude::IncludeElement() instead

◆ includePoseRelativeTo

std::optional<std::string> sdf::v12::NestedInclude::includePoseRelativeTo

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.

Deprecated:
Use NestedInclude::IncludePoseRelativeTo() instead

◆ includeRawPose

std::optional<ignition::math::Pose3d> sdf::v12::NestedInclude::includeRawPose

The raw pose as specified in //include/pose.

This is nullopt if //include/pose is not set.

Deprecated:
Use NestedInclude::IncludeRawPose() instead

◆ isStatic

std::optional<bool> sdf::v12::NestedInclude::isStatic

Whether the model is static as defined by //include/static.

This is nullopt if //include/static is not set.

Deprecated:
Use NestedInclude::IsStatic() instead

◆ localModelName

std::optional<std::string> sdf::v12::NestedInclude::localModelName

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

Deprecated:
Use NestedInclude::LocalModelName() instead

◆ placementFrame

std::optional<std::string> sdf::v12::NestedInclude::placementFrame

The placement frame as specified in //include/placement_frame.

This is nullopt if //include/placement_frame is is not set.

Deprecated:
Use NestedInclude::PlacementFrame() instead

◆ resolvedFileName

std::string sdf::v12::NestedInclude::resolvedFileName

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.

Deprecated:
Use NestedInclude::ResolvedFileName() instead

◆ uri

std::string sdf::v12::NestedInclude::uri

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

Deprecated:
Use NestedInclude::Uri() instead

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