Gazebo Rendering

API Reference

8.2.0
Marker.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 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 GZ_RENDERING_MARKER_HH_
18 #define GZ_RENDERING_MARKER_HH_
19 
20 #include <gz/math/Color.hh>
21 #include <gz/math/Vector3.hh>
22 #include "gz/rendering/config.hh"
23 #include "gz/rendering/Geometry.hh"
24 #include "gz/rendering/Object.hh"
26 
27 namespace gz
28 {
29  namespace rendering
30  {
31  inline namespace GZ_RENDERING_VERSION_NAMESPACE {
32  //
34  enum GZ_RENDERING_VISIBLE MarkerType
35  {
37  MT_NONE = 0,
38 
40  MT_BOX = 1,
41 
44 
47 
50 
52  MT_POINTS = 5,
53 
55  MT_SPHERE = 6,
56 
58  MT_TEXT = 7,
59 
62 
65 
68 
70  MT_CAPSULE = 11,
71 
73  MT_CONE = 12,
74  };
75 
79  class GZ_RENDERING_VISIBLE Marker :
80  public virtual Geometry
81  {
82  protected: Marker();
83 
85  public: virtual ~Marker();
86 
89  public: virtual void SetLifetime(
90  const std::chrono::steady_clock::duration &_lifetime) = 0;
91 
94  public: virtual std::chrono::steady_clock::duration Lifetime() const = 0;
95 
98  public: virtual void SetLayer(int32_t _layer) = 0;
99 
102  public: virtual int32_t Layer() const = 0;
103 
106  public: virtual void SetType(
107  const gz::rendering::MarkerType _markerType) = 0;
108 
111  public: virtual gz::rendering::MarkerType Type() const = 0;
112 
116  public: virtual void SetSize(double _size) = 0;
117 
121  public: virtual double Size() const = 0;
122 
124  public: virtual void ClearPoints() = 0;
125 
131  public: virtual void AddPoint(double _x,
132  double _y, double _z,
133  const gz::math::Color &_color) = 0;
134 
138  public: virtual void AddPoint(const gz::math::Vector3d &_pt,
139  const gz::math::Color &_color) = 0;
140 
144  public: virtual void SetPoint(unsigned int _index,
145  const gz::math::Vector3d &_value) = 0;
146  };
147  }
148  }
149 }
150 
151 #endif