DynamicLines.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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 GAZEBO_RENDERING_DYNAMICLINES_HH
18 #define GAZEBO_RENDERING_DYNAMICLINES_HH
19 
20 #include <memory>
21 #include <vector>
22 #include <string>
23 #include <ignition/math/Color.hh>
24 
28 #include "gazebo/util/system.hh"
29 
30 namespace gazebo
31 {
32  namespace rendering
33  {
36 
38  class DynamicLinesPrivate;
39 
42  class GZ_RENDERING_VISIBLE DynamicLines : public DynamicRenderable
43  {
46  public: explicit DynamicLines(
48 
50  public: virtual ~DynamicLines();
51 
54  public: static std::string GetMovableType();
55 
58  public: virtual const Ogre::String &getMovableType() const;
59 
64  public: void AddPoint(const ignition::math::Vector3d &_pt,
65  const common::Color &_color) GAZEBO_DEPRECATED(9.0);
66 
70  public: void AddPoint(const ignition::math::Vector3d &_pt,
71  const ignition::math::Color &_color = ignition::math::Color::White);
72 
79  public: void AddPoint(double _x, double _y, double _z,
80  const common::Color &_color) GAZEBO_DEPRECATED(9.0);
81 
87  public: void AddPoint(const double _x, const double _y, const double _z,
88  const ignition::math::Color &_color = ignition::math::Color::White);
89 
93  public: void SetPoint(const unsigned int _index,
94  const ignition::math::Vector3d &_value);
95 
100  public: void SetColor(unsigned int _index, const common::Color &_color)
101  GAZEBO_DEPRECATED(9.0);
102 
107  public: void SetColor(const unsigned int _index,
108  const ignition::math::Color &_color);
109 
116  public: ignition::math::Vector3d Point(const unsigned int _index) const;
117 
120  public: unsigned int GetPointCount() const;
121 
123  public: void Clear();
124 
126  public: void Update();
127 
130  private: virtual void CreateVertexDeclaration();
131 
134  private: virtual void FillHardwareBuffers();
135 
137  private: std::vector<ignition::math::Vector3d> points;
138 
140  private: bool dirty;
141 
143  private: std::unique_ptr<DynamicLinesPrivate> dataPtr;
144  };
146  }
147 }
148 #endif
Class for drawing lines that can change.
Definition: DynamicLines.hh:42
Abstract base class providing mechanisms for dynamically growing hardware buffers.
Definition: DynamicRenderable.hh:35
RenderOpType
Type of render operation for a drawable.
Definition: RenderTypes.hh:216
A strip of connected lines, 1 vertex per line plus 1 start vertex.
Definition: RenderTypes.hh:226
Defines a color.
Definition: Color.hh:36
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:328