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 rendering
39  {
40  class Scene;
41 
42  // Forward declare provate data
43  class GridPrivate;
44 
47 
53  class GZ_RENDERING_VISIBLE Grid
54  {
61  public: Grid(Scene *_scene, const uint32_t _cellCount,
62  const float _cellLength, const ignition::math::Color &_color);
63 
65  public: ~Grid();
66 
68  public: void Init();
69 
74  public: void Enable(const bool _enable);
75 
78  public: VisualPtr GridVisual() const;
79 
82  public: void SetUserData(const Ogre::Any &_data);
83 
86  public: void SetColor(const ignition::math::Color &_color);
87 
90  public: ignition::math::Color Color() const;
91 
94  public: void SetCellCount(const uint32_t _count);
95 
98  public: uint32_t CellCount() const;
99 
102  public: void SetCellLength(const float _len);
103 
106  public: float CellLength() const;
107 
110  public: void SetHeight(const uint32_t _count);
111 
114  public: uint32_t Height() const;
115 
118  public: void SetHeightOffset(const double _offset);
119 
122  public: double HeightOffset() const;
123 
125  private: void Create();
126 
129  private: std::unique_ptr<GridPrivate> dataPtr;
130  };
132  }
133 }
134 #endif
Forward declarations for the common classes.
Definition: Animation.hh:26
Displays a grid of cells, drawn with lines.
Definition: Grid.hh:53
Representation of an entire scene graph.
Definition: Scene.hh:100
Definition: JointMaker.hh:39
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:114
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.