Model.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2018 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_MODEL_HH_
18 #define SDF_MODEL_HH_
19 
20 #include <string>
21 #include <ignition/math/Pose3.hh>
22 #include "sdf/Element.hh"
23 #include "sdf/Types.hh"
24 #include "sdf/sdf_config.h"
25 #include "sdf/system_util.hh"
26 
27 namespace sdf
28 {
29  // Inline bracket to help doxygen filtering.
30  inline namespace SDF_VERSION_NAMESPACE {
31  //
32 
33  // Forward declarations.
34  class Joint;
35  class Link;
36  class ModelPrivate;
37 
39  {
41  public: Model();
42 
45  public: Model(const Model &_model);
46 
49  public: Model(Model &&_model) noexcept;
50 
54  public: Model &operator=(Model &&_model);
55 
59  public: Model &operator=(const Model &_model);
60 
62  public: ~Model();
63 
70  public: Errors Load(ElementPtr _sdf);
71 
75  public: std::string Name() const;
76 
80  public: void SetName(const std::string &_name);
81 
86  public: bool Static() const;
87 
92  public: void SetStatic(bool _static);
93 
99  public: bool SelfCollide() const;
100 
105  public: void SetSelfCollide(bool _selfCollide);
106 
111  public: bool AllowAutoDisable() const;
112 
117  public: void SetAllowAutoDisable(bool _allowAutoDisable);
118 
123  public: bool EnableWind() const;
124 
128  public: void SetEnableWind(bool _enableWind);
129 
132  public: uint64_t LinkCount() const;
133 
139  public: const Link *LinkByIndex(const uint64_t _index) const;
140 
144  public: const Link *LinkByName(const std::string &_name) const;
145 
149  public: bool LinkNameExists(const std::string &_name) const;
150 
153  public: uint64_t JointCount() const;
154 
160  public: const Joint *JointByIndex(const uint64_t _index) const;
161 
165  public: bool JointNameExists(const std::string &_name) const;
166 
172  public: const Joint *JointByName(const std::string &_name) const;
173 
179  public: const ignition::math::Pose3d &Pose() const;
180 
184  public: void SetPose(const ignition::math::Pose3d &_pose);
185 
190  public: const std::string &PoseFrame() const;
191 
196  public: void SetPoseFrame(const std::string &_frame);
197 
202  public: sdf::ElementPtr Element() const;
203 
205  private: ModelPrivate *dataPtr = nullptr;
206  };
207  }
208 }
209 #endif
class SDFORMAT_VISIBLE Element
Definition: Element.hh:47
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:51
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:74
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:48
Definition: Joint.hh:79
namespace for Simulation Description Format parser
Definition: AirPressure.hh:25
Definition: Model.hh:38