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 <gz/math/Pose3.hh>
24 #include <gz/utils/ImplPtr.hh>
25 #include <gz/utils/SuppressWarning.hh>
26 
27 #include "sdf/Element.hh"
28 #include "sdf/InterfaceModel.hh"
29 #include "sdf/Types.hh"
30 
31 #include "sdf/sdf_config.h"
32 #include "sdf/system_util.hh"
33 
34 namespace sdf
35 {
36 inline namespace SDF_VERSION_NAMESPACE
37 {
38 #ifdef _WIN32
39 // Disable warning C4251 which is triggered by std::string
40 #pragma warning(push)
41 #pragma warning(disable: 4251)
42 #endif
43 class SDFORMAT_VISIBLE NestedInclude
46 {
48  public: NestedInclude();
49 
54  public: const std::string &Uri() const;
55 
58  public: void SetUri(const std::string &_uri);
59 
65  public: const std::string &ResolvedFileName() const;
66 
69  public: void SetResolvedFileName(const std::string &_resolvedFileName);
70 
77  public: const std::string &AbsoluteParentName() const;
78 
81  public: void SetAbsoluteParentName(const std::string &_absoluteparentname);
82 
89  public: const std::optional<std::string> &LocalModelName() const;
90 
94  public: void SetLocalModelName(const std::string &_localModelName);
95 
100  public: const std::optional<bool> &IsStatic() const;
101 
104  public: void SetIsStatic(bool _isStatic);
105 
109  public: const std::optional<gz::math::Pose3d> &IncludeRawPose() const;
110 
113  public: void SetIncludeRawPose(const gz::math::Pose3d &_includeRawPose);
114 
120  public: const std::optional<std::string> &IncludePoseRelativeTo() const;
121 
124  public: void SetIncludePoseRelativeTo(
125  const std::string &_includePoseRelativeTo);
126 
131  public: const std::optional<std::string> &PlacementFrame() const;
132 
135  public: void SetPlacementFrame(const std::string &_placementFrame);
136 
140  public: sdf::ElementPtr IncludeElement() const;
141 
144  public: void SetIncludeElement(sdf::ElementPtr _includeElement);
145 
146 
150  public: void SetIsMerge(bool _isMerge);
151 
155  public: const std::optional<bool> &IsMerge() const;
156 
158  GZ_UTILS_IMPL_PTR(dataPtr)
159 };
160 #ifdef _MSC_VER
161 #pragma warning(pop)
162 #endif
163 
197 using CustomModelParser =
199 }
200 }
201 
202 #endif
sdf
namespace for Simulation Description Format parser
Definition: Actor.hh:34
sdf::SDF_VERSION_NAMESPACE::InterfaceModelPtr
std::shared_ptr< InterfaceModel > InterfaceModelPtr
Definition: InterfaceModel.hh:49
Types.hh
sdf_config.h
SDFORMAT_VISIBLE
#define SDFORMAT_VISIBLE
Definition: system_util.hh:25
sdf::SDF_VERSION_NAMESPACE::Errors
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:80
sdf::SDF_VERSION_NAMESPACE::NestedInclude
Contains the necessary information about an included model file for custom model parsers to be able t...
Definition: InterfaceElements.hh:45
system_util.hh
sdf::SDF_VERSION_NAMESPACE::CustomModelParser
std::function< sdf::InterfaceModelPtr(const sdf::NestedInclude &, Errors &)> CustomModelParser
Defines a custom model parser.
Definition: InterfaceElements.hh:198
InterfaceModel.hh
sdf::SDF_VERSION_NAMESPACE::ElementPtr
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:55
Element.hh