InterfaceElements.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2021 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 #ifndef SDF_INTERFACE_ELEMENTS_HH_
18 #define SDF_INTERFACE_ELEMENTS_HH_
19 
20 #include <string>
21 #include <memory>
22 
23 #include <ignition/math/Pose3.hh>
24 
25 #include "sdf/Element.hh"
26 #include "sdf/InterfaceModel.hh"
27 #include "sdf/Types.hh"
28 
29 #include "sdf/sdf_config.h"
30 #include "sdf/system_util.hh"
31 
32 namespace sdf
33 {
34 inline namespace SDF_VERSION_NAMESPACE
35 {
36 #ifdef _WIN32
37 // Disable warning C4251 which is triggered by std::string
38 #pragma warning(push)
39 #pragma warning(disable: 4251)
40 #endif
41 struct SDFORMAT_VISIBLE NestedInclude
44 {
48  std::string uri;
49 
54  std::string resolvedFileName;
55 
61  std::string absoluteParentName;
62 
68  std::optional<std::string> localModelName;
69 
72  std::optional<bool> isStatic;
73 
76  std::optional<ignition::math::Pose3d> includeRawPose;
77 
81  std::optional<std::string> includePoseRelativeTo;
82 
85  std::optional<std::string> placementFrame;
86 
90 };
91 #ifdef _MSC_VER
92 #pragma warning(pop)
93 #endif
94 
128 using CustomModelParser =
129  std::function<sdf::InterfaceModelPtr(const sdf::NestedInclude &, Errors &)>;
130 }
131 }
132 
133 #endif
std::function< sdf::InterfaceModelPtr(const sdf::NestedInclude &, Errors &)> CustomModelParser
Defines a custom model parser.
Definition: InterfaceElements.hh:129
std::optional< bool > isStatic
Whether the model is static as defined by //include/static.
Definition: InterfaceElements.hh:72
std::string uri
Provides the URI as specified in //include/uri.
Definition: InterfaceElements.hh:48
std::string resolvedFileName
Provides the resolved absolute file path from the URI.
Definition: InterfaceElements.hh:54
std::optional< ignition::math::Pose3d > includeRawPose
The raw pose as specified in //include/pose.
Definition: InterfaceElements.hh:76
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:41
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:53
std::optional< std::string > localModelName
Name relative to immediate parent as specified in //include/name.
Definition: InterfaceElements.hh:68
std::optional< std::string > placementFrame
The placement frame as specified in //include/placement_frame.
Definition: InterfaceElements.hh:85
namespace for Simulation Description Format parser
Definition: Actor.hh:33
std::optional< std::string > includePoseRelativeTo
The relative-to frame of the pose as specified in //include/pose/@relative_to.
Definition: InterfaceElements.hh:81
std::string absoluteParentName
Name of the parent entity in absolute hierarchy.
Definition: InterfaceElements.hh:61
sdf::ElementPtr includeElement
This is the //include element.
Definition: InterfaceElements.hh:89