grid.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef OGRE_TOOLS_GRID_H
31 #define OGRE_TOOLS_GRID_H
32 
33 #include <stdint.h>
34 
35 #include <vector>
36 
37 #include <OgreColourValue.h>
38 #include <OgreMaterial.h>
39 #include <OgreSharedPtr.h>
40 
41 namespace Ogre
42 {
43 class SceneManager;
44 
45 class ManualObject;
46 class SceneNode;
47 
48 class Any;
49 } // namespace Ogre
50 
51 namespace rviz
52 {
53 class BillboardLine;
54 
62 class Grid
63 {
64 public:
65  enum Style
66  {
69  };
70 
81  Grid(Ogre::SceneManager* manager,
82  Ogre::SceneNode* parent_node,
83  Style style,
84  uint32_t cell_count,
85  float cell_length,
86  float line_width,
87  const Ogre::ColourValue& color);
88  ~Grid();
89 
90  void create();
91 
97  Ogre::SceneNode* getSceneNode()
98  {
99  return scene_node_;
100  }
101 
105  void setUserData(const Ogre::Any& data);
106 
107  void setStyle(Style style);
109  {
110  return style_;
111  }
112 
113  void setColor(const Ogre::ColourValue& color);
114  Ogre::ColourValue getColor()
115  {
116  return color_;
117  }
118 
119  void setCellCount(uint32_t count);
120  float getCellCount()
121  {
122  return cell_count_;
123  }
124 
125  void setCellLength(float len);
127  {
128  return cell_length_;
129  }
130 
131  void setLineWidth(float width);
132  float getLineWidth()
133  {
134  return line_width_;
135  }
136 
137  void setHeight(uint32_t count);
138  uint32_t getHeight()
139  {
140  return height_;
141  }
142 
143 private:
144  Ogre::SceneManager* scene_manager_;
145  Ogre::SceneNode* scene_node_;
146  Ogre::ManualObject* manual_object_;
147 
149 
150  Ogre::MaterialPtr material_;
151 
153  uint32_t cell_count_;
155  float line_width_;
156  uint32_t height_;
157  Ogre::ColourValue color_;
158 };
159 
160 } // namespace rviz
161 
162 #endif
Ogre::SceneNode * getSceneNode()
Get the Ogre scene node associated with this grid.
Definition: grid.h:97
Ogre::ColourValue getColor()
Definition: grid.h:114
An object that displays a multi-segment line strip rendered as billboards.
float getCellCount()
Definition: grid.h:120
uint32_t cell_count_
Definition: grid.h:153
Ogre::MaterialPtr material_
Definition: grid.h:150
uint32_t getHeight()
Definition: grid.h:138
float getCellLength()
Definition: grid.h:126
Ogre::ColourValue color_
Definition: grid.h:157
Style getStyle()
Definition: grid.h:108
BillboardLine * billboard_line_
Definition: grid.h:148
Ogre::SceneNode * scene_node_
The scene node that this grid is attached to.
Definition: grid.h:145
Displays a grid of cells, drawn with lines.
Definition: grid.h:62
float getLineWidth()
Definition: grid.h:132
uint32_t height_
Definition: grid.h:156
Style style_
Definition: grid.h:152
Ogre::ManualObject * manual_object_
The manual object used to draw the grid.
Definition: grid.h:146
float line_width_
Definition: grid.h:155
float cell_length_
Definition: grid.h:154
Ogre::SceneManager * scene_manager_
Definition: grid.h:144


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Mon Aug 15 2022 02:05:16