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 
83  public: VisualPtr GridVisual() const;
84 
87  public: void SetUserData(const Ogre::Any &_data);
88 
91  public: void SetColor(const common::Color &_color);
92 
95  public: common::Color Color() const;
96 
99  public: void SetCellCount(const uint32_t _count);
100 
103  public: uint32_t CellCount() const;
104 
107  public: void SetCellLength(const float _len);
108 
111  public: float CellLength() const;
112 
115  public: void SetLineWidth(const float _width);
116 
119  public: float LineWidth() const;
120 
123  public: void SetHeight(const uint32_t _count);
124 
127  public: uint32_t Height() const;
128 
131  public: void SetHeightOffset(const double _offset);
132 
135  public: double HeightOffset() const;
136 
138  private: void Create();
139 
142  private: std::unique_ptr<GridPrivate> dataPtr;
143  };
145  }
146 }
147 #endif
Forward declarations for the common classes.
Definition: Animation.hh:33
Displays a grid of cells, drawn with lines.
Definition: Grid.hh:56
Representation of an entire scene graph.
Definition: Scene.hh:100
Definition: JointMaker.hh:39
Defines a color.
Definition: Color.hh:35
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:113
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.