Grid.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 // This was leveraged from rviz.
18 
19 #ifndef GAZEBO_RENDERING_GRID_HH_
20 #define GAZEBO_RENDERING_GRID_HH_
21 
22 #include <memory>
23 #include <string>
24 #include <vector>
25 
26 #include <ignition/math/Color.hh>
27 
28 #include "gazebo/util/system.hh"
29 
30 namespace Ogre
31 {
32  class SceneNode;
33  class Any;
34 }
35 
36 namespace gazebo
37 {
38  namespace common
39  {
40  class Color;
41  }
42 
43  namespace rendering
44  {
45  class Scene;
46 
47  // Forward declare provate data
48  class GridPrivate;
49 
52 
58  class GZ_RENDERING_VISIBLE Grid
59  {
68  public: Grid(Scene *_scene, const uint32_t _cellCount,
69  const float _cellLength, const float _lineWidth,
70  const common::Color &_color) GAZEBO_DEPRECATED(9.0);
71 
78  public: Grid(Scene *_scene, const uint32_t _cellCount,
79  const float _cellLength, const ignition::math::Color &_color);
80 
82  public: ~Grid();
83 
85  public: void Init();
86 
91  public: void Enable(const bool _enable);
92 
95  public: VisualPtr GridVisual() const;
96 
99  public: void SetUserData(const Ogre::Any &_data);
100 
104  public: void SetColor(const common::Color &_color) GAZEBO_DEPRECATED(9.0);
105 
108  public: void SetColor(const ignition::math::Color &_color);
109 
112  public: ignition::math::Color Color() const;
113 
116  public: void SetCellCount(const uint32_t _count);
117 
120  public: uint32_t CellCount() const;
121 
124  public: void SetCellLength(const float _len);
125 
128  public: float CellLength() const;
129 
133  public: void SetLineWidth(const float _width) GAZEBO_DEPRECATED(9.0);
134 
138  public: float LineWidth() const GAZEBO_DEPRECATED(9.0);
139 
142  public: void SetHeight(const uint32_t _count);
143 
146  public: uint32_t Height() const;
147 
150  public: void SetHeightOffset(const double _offset);
151 
154  public: double HeightOffset() const;
155 
157  private: void Create();
158 
161  private: std::unique_ptr<GridPrivate> dataPtr;
162  };
164  }
165 }
166 #endif
Displays a grid of cells, drawn with lines.
Definition: Grid.hh:58
Representation of an entire scene graph.
Definition: Scene.hh:101
Defines a color.
Definition: Color.hh:36
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:328
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:114
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.