Link.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_LINK_HH_
18 #define SDF_LINK_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 Collision;
35  class Light;
36  class LinkPrivate;
37  class Sensor;
38  class Visual;
39  class LinkPrivate;
40 
42  {
44  public: Link();
45 
48  public: Link(const Link &_link);
49 
52  public: Link(Link &&_link) noexcept;
53 
57  public: Link &operator=(Link &&_link);
58 
62  public: Link &operator=(const Link &_link);
63 
65  public: ~Link();
66 
73  public: Errors Load(ElementPtr _sdf);
74 
78  public: std::string Name() const;
79 
83  public: void SetName(const std::string &_name) const;
84 
87  public: uint64_t VisualCount() const;
88 
94  public: const Visual *VisualByIndex(const uint64_t _index) const;
95 
99  public: bool VisualNameExists(const std::string &_name) const;
100 
104  public: const Visual *VisualByName(const std::string &_name) const;
105 
108  public: uint64_t CollisionCount() const;
109 
115  public: const Collision *CollisionByIndex(const uint64_t _index) const;
116 
120  public: bool CollisionNameExists(const std::string &_name) const;
121 
125  public: const Collision *CollisionByName(const std::string &_name) const;
126 
129  public: uint64_t LightCount() const;
130 
136  public: const Light *LightByIndex(const uint64_t _index) const;
137 
141  public: bool LightNameExists(const std::string &_name) const;
142 
146  public: const Light *LightByName(const std::string &_name) const;
147 
150  public: uint64_t SensorCount() const;
151 
157  public: const Sensor *SensorByIndex(const uint64_t _index) const;
158 
162  public: bool SensorNameExists(const std::string &_name) const;
163 
169  public: const Sensor *SensorByName(const std::string &_name) const;
170 
184  public: const ignition::math::Inertiald &Inertial() const;
185 
190  public: bool SetInertial(const ignition::math::Inertiald &_inertial);
191 
195  public: const ignition::math::Pose3d &Pose() const;
196 
200  public: void SetPose(const ignition::math::Pose3d &_pose);
201 
206  public: const std::string &PoseFrame() const;
207 
212  public: void SetPoseFrame(const std::string &_frame);
213 
218  public: sdf::ElementPtr Element() const;
219 
224  public: bool EnableWind() const;
225 
230  public: void SetEnableWind(bool _enableWind);
231 
233  private: LinkPrivate *dataPtr = nullptr;
234  };
235  }
236 }
237 #endif
Provides a description of a light source.
Definition: Light.hh:59
class SDFORMAT_VISIBLE Element
Definition: Element.hh:47
Definition: Visual.hh:42
A collision element descibes the collison properties associated with a link.
Definition: Collision.hh:40
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
namespace for Simulation Description Format parser
Definition: AirPressure.hh:25