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 "gazebo/util/system.hh"
27 
28 namespace Ogre
29 {
30  class SceneNode;
31  class Any;
32 }
33 
34 namespace gazebo
35 {
36  namespace common
37  {
38  class Color;
39  }
40 
41  namespace rendering
42  {
43  class Scene;
44 
45  // Forward declare provate data
46  class GridPrivate;
47 
50 
56  class GZ_RENDERING_VISIBLE Grid
57  {
65  public: Grid(Scene *_scene, const uint32_t _cellCount,
66  const float _cellLength, const float _lineWidth,
67  const common::Color &_color);
68 
70  public: ~Grid();
71 
73  public: void Init();
74 
79  public: void Enable(const bool _enable);
80 
84  public: Ogre::SceneNode *GetSceneNode() GAZEBO_DEPRECATED(8.0);
85 
88  public: VisualPtr GridVisual() const;
89 
92  public: void SetUserData(const Ogre::Any &_data);
93 
96  public: void SetColor(const common::Color &_color);
97 
101  public: common::Color GetColor() const GAZEBO_DEPRECATED(8.0);
102 
105  public: common::Color Color() const;
106 
109  public: void SetCellCount(const uint32_t _count);
110 
114  public: uint32_t GetCellCount() const GAZEBO_DEPRECATED(8.0);
115 
118  public: uint32_t CellCount() const;
119 
122  public: void SetCellLength(const float _len);
123 
127  public: float GetCellLength() const GAZEBO_DEPRECATED(8.0);
128 
131  public: float CellLength() const;
132 
135  public: void SetLineWidth(const float _width);
136 
140  public: float GetLineWidth() const GAZEBO_DEPRECATED(8.0);
141 
144  public: float LineWidth() const;
145 
148  public: void SetHeight(const uint32_t _count);
149 
153  public: uint32_t GetHeight() const GAZEBO_DEPRECATED(8.0);
154 
157  public: uint32_t Height() const;
158 
161  public: void SetHeightOffset(const double _offset);
162 
165  public: double HeightOffset() const;
166 
168  private: void Create();
169 
172  private: std::unique_ptr<GridPrivate> dataPtr;
173  };
175  }
176 }
177 #endif
Displays a grid of cells, drawn with lines.
Definition: Grid.hh:56
Representation of an entire scene graph.
Definition: Scene.hh:100
Defines a color.
Definition: Color.hh:36
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:113
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.