DynamicLines.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 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 /* Desc: Dynamic line generator
18  * Author: Nate Koenig
19  * Date: 28 June 2007
20  */
21 
22 #ifndef DYNAMICLINES_HH
23 #define DYNAMICLINES_HH
24 
25 #include <vector>
26 #include <string>
27 
29 #include "gazebo/math/Vector3.hh"
32 #include "gazebo/util/system.hh"
33 
34 namespace gazebo
35 {
36  namespace rendering
37  {
40 
43  class GZ_RENDERING_VISIBLE DynamicLines : public DynamicRenderable
44  {
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 math::Vector3 &_pt,
65  const common::Color &_color = common::Color::White)
66  GAZEBO_DEPRECATED(7.0);
67 
71  public: void AddPoint(const ignition::math::Vector3d &_pt,
72  const common::Color &_color = common::Color::White);
73 
79  public: void AddPoint(double _x, double _y, double _z,
80  const common::Color &_color = common::Color::White);
81 
86  public: void SetPoint(unsigned int _index, const math::Vector3 &_value)
87  GAZEBO_DEPRECATED(7.0);
88 
92  public: void SetPoint(const unsigned int _index,
93  const ignition::math::Vector3d &_value);
94 
98  public: void SetColor(unsigned int _index, const common::Color &_color);
99 
106  public: math::Vector3 GetPoint(unsigned int _index) const
107  GAZEBO_DEPRECATED(7.0);
108 
115  public: ignition::math::Vector3d Point(const unsigned int _index) const;
116 
119  public: unsigned int GetPointCount() const;
120 
122  public: void Clear();
123 
125  public: void Update();
126 
129  private: virtual void CreateVertexDeclaration();
130 
133  private: virtual void FillHardwareBuffers();
134 
136  private: std::vector<ignition::math::Vector3d> points;
137 
139  private: bool dirty;
140 
142  private: std::vector<common::Color> colors;
143  };
145  }
146 }
147 #endif
Class for drawing lines that can change.
Definition: DynamicLines.hh:43
static const Color White
(1, 1, 1)
Definition: Color.hh:39
Forward declarations for the common classes.
Definition: Animation.hh:33
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:48
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:206
A strip of connected lines, 1 vertex per line plus 1 start vertex.
Definition: RenderTypes.hh:216
Defines a color.
Definition: Color.hh:36