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 <vector>
21 #include <string>
22 
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
30  namespace rendering
31  {
34 
37  class GZ_RENDERING_VISIBLE DynamicLines : public DynamicRenderable
38  {
41  public: explicit DynamicLines(
43 
45  public: virtual ~DynamicLines();
46 
49  public: static std::string GetMovableType();
50 
53  public: virtual const Ogre::String &getMovableType() const;
54 
58  public: void AddPoint(const ignition::math::Vector3d &_pt,
59  const common::Color &_color = common::Color::White);
60 
66  public: void AddPoint(double _x, double _y, double _z,
67  const common::Color &_color = common::Color::White);
68 
72  public: void SetPoint(const unsigned int _index,
73  const ignition::math::Vector3d &_value);
74 
78  public: void SetColor(unsigned int _index, const common::Color &_color);
79 
86  public: ignition::math::Vector3d Point(const unsigned int _index) const;
87 
90  public: unsigned int GetPointCount() const;
91 
93  public: void Clear();
94 
96  public: void Update();
97 
100  private: virtual void CreateVertexDeclaration();
101 
104  private: virtual void FillHardwareBuffers();
105 
107  private: std::vector<ignition::math::Vector3d> points;
108 
110  private: bool dirty;
111 
113  private: std::vector<common::Color> colors;
114  };
116  }
117 }
118 #endif
Class for drawing lines that can change.
Definition: DynamicLines.hh:37
static const Color White
(1, 1, 1)
Definition: Color.hh:39
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:211
A strip of connected lines, 1 vertex per line plus 1 start vertex.
Definition: RenderTypes.hh:221
Defines a color.
Definition: Color.hh:36