Gazebo Rendering

API Reference

3.7.2
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  };
70 
74  class IGNITION_RENDERING_VISIBLE Marker :
75  public virtual Geometry
76  {
77  protected: Marker();
78 
80  public: virtual ~Marker();
81 
84  public: virtual void SetLifetime(
85  const std::chrono::steady_clock::duration &_lifetime) = 0;
86 
89  public: virtual std::chrono::steady_clock::duration Lifetime() const = 0;
90 
93  public: virtual void SetLayer(int32_t _layer) = 0;
94 
97  public: virtual int32_t Layer() const = 0;
98 
101  public: virtual void SetType(
102  const gz::rendering::MarkerType _markerType) = 0;
103 
106  public: virtual gz::rendering::MarkerType Type() const = 0;
107 
109  public: virtual void ClearPoints() = 0;
110 
116  public: virtual void AddPoint(double _x,
117  double _y, double _z,
118  const gz::math::Color &_color) = 0;
119 
123  public: virtual void AddPoint(const gz::math::Vector3d &_pt,
124  const gz::math::Color &_color) = 0;
125 
129  public: virtual void SetPoint(unsigned int _index,
130  const gz::math::Vector3d &_value) = 0;
131  };
132  }
133  }
134 }
135 
136 #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:74
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
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.