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
rviz::BillboardLine
An object that displays a multi-segment line strip rendered as billboards.
Definition: billboard_line.h:58
rviz::Grid::cell_length_
float cell_length_
Definition: grid.h:154
Ogre
Definition: axes_display.h:35
rviz::Grid::~Grid
~Grid()
Definition: grid.cpp:85
rviz::Grid::setLineWidth
void setLineWidth(float width)
Definition: grid.cpp:108
rviz::Grid::create
void create()
Definition: grid.cpp:147
rviz::Grid::Grid
Grid(Ogre::SceneManager *manager, Ogre::SceneNode *parent_node, Style style, uint32_t cell_count, float cell_length, float line_width, const Ogre::ColourValue &color)
Constructor.
Definition: grid.cpp:45
rviz::Grid::getStyle
Style getStyle()
Definition: grid.h:108
rviz::Grid::setUserData
void setUserData(const Ogre::Any &data)
Sets user data on all ogre objects we own.
Definition: grid.cpp:247
rviz::Grid::getCellCount
float getCellCount()
Definition: grid.h:120
rviz::Grid::scene_manager_
Ogre::SceneManager * scene_manager_
Definition: grid.h:144
rviz::Grid::cell_count_
uint32_t cell_count_
Definition: grid.h:153
rviz::Grid::scene_node_
Ogre::SceneNode * scene_node_
The scene node that this grid is attached to.
Definition: grid.h:145
rviz::Grid::setColor
void setColor(const Ogre::ColourValue &color)
Definition: grid.cpp:115
rviz::Grid::setHeight
void setHeight(uint32_t count)
Definition: grid.cpp:140
rviz
Definition: add_display_dialog.cpp:54
rviz::Grid::getCellLength
float getCellLength()
Definition: grid.h:126
rviz::Grid::getLineWidth
float getLineWidth()
Definition: grid.h:132
rviz::Grid::height_
uint32_t height_
Definition: grid.h:156
rviz::Grid::getSceneNode
Ogre::SceneNode * getSceneNode()
Get the Ogre scene node associated with this grid.
Definition: grid.h:97
rviz::Grid::Billboards
@ Billboards
Definition: grid.h:68
rviz::Grid::setCellCount
void setCellCount(uint32_t count)
Definition: grid.cpp:94
rviz::Grid::Style
Style
Definition: grid.h:65
rviz::Grid::getColor
Ogre::ColourValue getColor()
Definition: grid.h:114
rviz::Grid::style_
Style style_
Definition: grid.h:152
rviz::Grid
Displays a grid of cells, drawn with lines.
Definition: grid.h:62
rviz::Grid::manual_object_
Ogre::ManualObject * manual_object_
The manual object used to draw the grid.
Definition: grid.h:146
rviz::Grid::line_width_
float line_width_
Definition: grid.h:155
rviz::Grid::Lines
@ Lines
Definition: grid.h:67
rviz::Grid::setStyle
void setStyle(Style style)
Definition: grid.cpp:133
rviz::Grid::getHeight
uint32_t getHeight()
Definition: grid.h:138
rviz::Grid::material_
Ogre::MaterialPtr material_
Definition: grid.h:150
rviz::Grid::setCellLength
void setCellLength(float len)
Definition: grid.cpp:101
rviz::Grid::color_
Ogre::ColourValue color_
Definition: grid.h:157
rviz::Grid::billboard_line_
BillboardLine * billboard_line_
Definition: grid.h:148


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Dec 13 2024 03:31:02