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
30namespace Ogre
31{
32 class SceneNode;
33 class Any;
34}
35
36namespace 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
rendering
Definition RenderEngine.hh:31
Displays a grid of cells, drawn with lines.
Definition Grid.hh:54
VisualPtr GridVisual() const
Get thevisual associated with this grid.
double HeightOffset() const
Get the height offset.
void SetUserData(const Ogre::Any &_data)
Sets user data on all ogre objects we own.
void Init()
Initialize the grid.
ignition::math::Color Color() const
Return the grid color.
void SetCellLength(const float _len)
Set the cell length.
void Enable(const bool _enable)
Enable or disable the grid.
void SetHeight(const uint32_t _count)
Set the height of the grid.
float CellLength() const
Get the cell length.
void SetColor(const ignition::math::Color &_color)
Sets the color of the grid.
void SetCellCount(const uint32_t _count)
Set the number of cells.
Grid(Scene *_scene, const uint32_t _cellCount, const float _cellLength, const ignition::math::Color &_color)
Constructor.
uint32_t CellCount() const
Get the number of cells.
void SetHeightOffset(const double _offset)
Set the height offset of the grid.
uint32_t Height() const
Get the number of cells in the normal direction of the grid.
Representation of an entire scene graph.
Definition Scene.hh:94
Definition JointMaker.hh:40
std::shared_ptr< Visual > VisualPtr
Definition RenderTypes.hh:114
Forward declarations for the common classes.
Definition Animation.hh:27