All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Grid.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2012 Nate Koenig
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 _GRID_HH_
20 #define _GRID_HH_
21 
22 #include <stdint.h>
23 #include <vector>
24 #include <string>
25 
26 // TODO: remove this line
27 #include "rendering/ogre_gazebo.h"
28 
29 #include "common/Color.hh"
30 
31 namespace Ogre
32 {
33  class ManualObject;
34  class SceneNode;
35  class Any;
36 }
37 
38 namespace gazebo
39 {
40  namespace rendering
41  {
42  class Scene;
43 
46 
52  class Grid
53  {
61  public: Grid(Scene *_scene, uint32_t _cellCount, float _cellLength,
62  float _lineWidth, const common::Color &_color);
63 
65  public: ~Grid();
66 
68  public: void Init();
69 
74  public: void Enable(bool _enable);
75 
78  public: Ogre::SceneNode *GetSceneNode() { return this->sceneNode; }
79 
82  public: void SetUserData(const Ogre::Any &_data);
83 
86  public: void SetColor(const common::Color &_color);
87 
90  public: common::Color GetColor() const {return this->color;}
91 
94  public: void SetCellCount(uint32_t _count);
95 
97  public: uint32_t GetCellCount() const {return this->cellCount;}
98 
101  public: void SetCellLength(float _len);
102 
105  public: float GetCellLength() const {return this->cellLength;}
106 
109  public: void SetLineWidth(float _width);
110 
113  public: float GetLineWidth() const {return this->lineWidth;}
114 
117  public: void SetHeight(uint32_t _count);
118 
121  public: uint32_t GetHeight() const {return this->height;}
122 
123  private: void Create();
124 
125  private: Ogre::SceneNode *sceneNode;
126  private: Ogre::ManualObject *manualObject;
127 
128  private: Ogre::MaterialPtr material;
129 
130  private: unsigned int cellCount;
131  private: float cellLength;
132  private: float lineWidth;
133  private: common::Color color;
134  private: float heightOffset;
135 
136  private: std::string name;
137  private: unsigned int height;
138 
139  private: Scene *scene;
140  };
142  }
143 }
144 #endif