forked from gazebosim/gz-rendering
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMarker.hh
151 lines (122 loc) · 4.76 KB
/
Marker.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*
* Copyright (C) 2019 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GZ_RENDERING_MARKER_HH_
#define GZ_RENDERING_MARKER_HH_
#include <gz/math/Color.hh>
#include <gz/math/Vector3.hh>
#include "gz/rendering/config.hh"
#include "gz/rendering/Geometry.hh"
#include "gz/rendering/Object.hh"
#include "gz/rendering/RenderTypes.hh"
namespace gz
{
namespace rendering
{
inline namespace GZ_RENDERING_VERSION_NAMESPACE {
//
/// \brief Enum for marker types
enum GZ_RENDERING_VISIBLE MarkerType
{
/// \brief No type
MT_NONE = 0,
/// \brief Box geometry
MT_BOX = 1,
/// \brief Cylinder geometry
MT_CYLINDER = 2,
/// \brief Line strip primitive
MT_LINE_STRIP = 3,
/// \brief Line list primitive
MT_LINE_LIST = 4,
/// \brief Points primitive
MT_POINTS = 5,
/// \brief Sphere geometry
MT_SPHERE = 6,
/// \brief Text geometry
MT_TEXT = 7,
/// \brief Triangle fan primitive
MT_TRIANGLE_FAN = 8,
/// \brief Triangle list primitive
MT_TRIANGLE_LIST = 9,
/// \brief Triangle strip primitive
MT_TRIANGLE_STRIP = 10,
/// \brief Capsule geometry
MT_CAPSULE = 11,
/// \brief Cone geometry
MT_CONE = 12,
};
/// \class Marker Marker.hh gz/rendering/Marker
/// \brief A marker geometry class. The marker's visual appearance is based
/// on the marker type specified.
class GZ_RENDERING_VISIBLE Marker :
public virtual Geometry
{
protected: Marker();
/// \brief Destructor
public: virtual ~Marker();
/// \brief Set the lifetime of this Marker
/// \param[in] _lifetime The time at which the marker will be removed
public: virtual void SetLifetime(
const std::chrono::steady_clock::duration &_lifetime) = 0;
/// \brief Get the lifetime of this Marker
/// \return The time at which the marker will be removed
public: virtual std::chrono::steady_clock::duration Lifetime() const = 0;
/// \brief Set the layer of this Marker
/// \param[in] _layer Layer at which the marker will reside
public: virtual void SetLayer(int32_t _layer) = 0;
/// \brief Get the layer of this Marker
/// \return The layer of the marker
public: virtual int32_t Layer() const = 0;
/// \brief Set the render type of this Marker
/// \param[in] _markerType The desired render type
public: virtual void SetType(
const gz::rendering::MarkerType _markerType) = 0;
/// \brief Get the render type of this Marker
/// \return The render type of the marker
public: virtual gz::rendering::MarkerType Type() const = 0;
/// \brief Set size of the marker. Only affects MT_POINTS.
/// e.g. size of rasterized points in pixels
/// \param[in] _size Size of the marker
public: virtual void SetSize(double _size) = 0;
/// \brief Get the size of the marker.
/// \return The size of the marker
/// \sa SetSize
public: virtual double Size() const = 0;
/// \brief Clear the points of the marker, if applicable
public: virtual void ClearPoints() = 0;
/// \brief Add a point with its respective color to the marker
/// \param[in] _x X coordinate
/// \param[in] _y Y coordinate
/// \param[in] _z Z coordinate
/// \param[in] _color The color the point is set to
public: virtual void AddPoint(double _x,
double _y, double _z,
const gz::math::Color &_color) = 0;
/// \brief Add a point with its respective color to the marker
/// \param[in] _pt A vector containing the position of the point
/// \param[in] _color The color the point is set to
public: virtual void AddPoint(const gz::math::Vector3d &_pt,
const gz::math::Color &_color) = 0;
/// \brief Set an existing point's vector
/// \param[in] _index The index of the point
/// \param[in] _value The new positional vector of the point
public: virtual void SetPoint(unsigned int _index,
const gz::math::Vector3d &_value) = 0;
};
}
}
}
#endif