Gazebo Rendering

API Reference

6.6.3
gz/rendering/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/common/Time.hh>
21 #include <gz/math/Color.hh>
22 #include <gz/math/Vector3.hh>
23 #include "gz/rendering/config.hh"
24 #include "gz/rendering/Geometry.hh"
25 #include "gz/rendering/Object.hh"
27 
28 namespace ignition
29 {
30  namespace rendering
31  {
32  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
33  //
35  enum IGNITION_RENDERING_VISIBLE MarkerType
36  {
38  MT_NONE = 0,
39 
41  MT_BOX = 1,
42 
45 
48 
51 
53  MT_POINTS = 5,
54 
56  MT_SPHERE = 6,
57 
59  MT_TEXT = 7,
60 
63 
66 
69 
71  MT_CAPSULE = 11,
72  };
73 
77  class IGNITION_RENDERING_VISIBLE Marker :
78  public virtual Geometry
79  {
80  protected: Marker();
81 
83  public: virtual ~Marker();
84 
87  public: virtual void SetLifetime(
88  const std::chrono::steady_clock::duration &_lifetime) = 0;
89 
92  public: virtual std::chrono::steady_clock::duration Lifetime() const = 0;
93 
96  public: virtual void SetLayer(int32_t _layer) = 0;
97 
100  public: virtual int32_t Layer() const = 0;
101 
104  public: virtual void SetType(
105  const gz::rendering::MarkerType _markerType) = 0;
106 
109  public: virtual gz::rendering::MarkerType Type() const = 0;
110 
114  public: virtual void SetSize(double _size) = 0;
115 
119  public: virtual double Size() const = 0;
120 
122  public: virtual void ClearPoints() = 0;
123 
129  public: virtual void AddPoint(double _x,
130  double _y, double _z,
131  const gz::math::Color &_color) = 0;
132 
136  public: virtual void AddPoint(const gz::math::Vector3d &_pt,
137  const gz::math::Color &_color) = 0;
138 
142  public: virtual void SetPoint(unsigned int _index,
143  const gz::math::Vector3d &_value) = 0;
144  };
145  }
146  }
147 }
148 
149 #endif
virtual void SetLifetime(const std::chrono::steady_clock::duration &_lifetime)=0
Set the lifetime of this Marker.
@ MT_POINTS
Points primitive.
Definition: gz/rendering/Marker.hh:53
@ MT_SPHERE
Sphere geometry.
Definition: gz/rendering/Marker.hh:56
@ MT_TRIANGLE_LIST
Triangle list primitive.
Definition: gz/rendering/Marker.hh:65
@ MT_TRIANGLE_STRIP
Triangle strip primitive.
Definition: gz/rendering/Marker.hh:68
@ MT_NONE
No type.
Definition: gz/rendering/Marker.hh:38
@ MT_TEXT
Text geometry.
Definition: gz/rendering/Marker.hh:59
@ MT_LINE_STRIP
Line strip primitive.
Definition: gz/rendering/Marker.hh:47
@ MT_BOX
Box geometry.
Definition: gz/rendering/Marker.hh:41
@ MT_LINE_LIST
Line list primitive.
Definition: gz/rendering/Marker.hh:50
virtual void SetType(const MarkerType _markerType)=0
Set the render type of this Marker.
virtual void AddPoint(double _x, double _y, double _z, const gz::math::Color &_color)=0
Add a point with its respective color to the marker.
@ MT_TRIANGLE_FAN
Triangle fan primitive.
Definition: gz/rendering/Marker.hh:62
virtual void ClearPoints()=0
Clear the points of the marker, if applicable.
virtual std::chrono::steady_clock::duration Lifetime() const =0
Get the lifetime of this Marker.
virtual void SetLayer(int32_t _layer)=0
Set the layer of this Marker.
virtual ~Marker()
Destructor.
virtual void SetPoint(unsigned int _index, const gz::math::Vector3d &_value)=0
Set an existing point's vector.
A marker geometry class. The marker's visual appearance is based on the marker type specified.
Definition: gz/rendering/Marker.hh:77
virtual double Size() const =0
Get the size of the marker.
MarkerType
Enum for marker types.
Definition: gz/rendering/Marker.hh:35
virtual MarkerType Type() const =0
Get the render type of this Marker.
@ MT_CYLINDER
Cylinder geometry.
Definition: gz/rendering/Marker.hh:44
virtual void SetSize(double _size)=0
Set size of the marker. Only affects MT_POINTS. e.g. size of rasterized points in pixels.
Represents a geometric shape to be rendered.
Definition: gz/rendering/Geometry.hh:34
virtual int32_t Layer() const =0
Get the layer of this Marker.
@ MT_CAPSULE
Capsule geometry.
Definition: gz/rendering/Marker.hh:71