axes.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_AXES_H
31 #define OGRE_TOOLS_AXES_H
32 
33 #include "object.h"
34 #include <rviz/rviz_export.h>
35 
36 #include <stddef.h>
37 #include <stdint.h>
38 
39 #include <vector>
40 
41 #include <OgrePrerequisites.h>
42 #include <OgreColourValue.h>
43 
44 namespace Ogre
45 {
46 class Any;
47 } // namespace Ogre
48 
49 namespace rviz
50 {
51 class Shape;
52 
57 class RVIZ_EXPORT Axes : public Object
58 {
59 public:
69  Axes(Ogre::SceneManager* manager,
70  Ogre::SceneNode* parent_node = nullptr,
71  float length = 1.0f,
72  float radius = 0.1f,
73  float alpha = 1.0f);
74  ~Axes() override;
75 
83  void set(float length, float radius, float alpha = 1.0f);
84 
85  void setOrientation(const Ogre::Quaternion& orientation) override;
86  void setPosition(const Ogre::Vector3& position) override;
87  void setScale(const Ogre::Vector3& scale) override;
88  void setColor(float r, float g, float b, float a) override;
89  const Ogre::Vector3& getPosition() override;
90  const Ogre::Quaternion& getOrientation() override;
91 
96  Ogre::SceneNode* getSceneNode()
97  {
98  return scene_node_;
99  }
100 
104  void setUserData(const Ogre::Any& data) override;
105 
107  {
108  return x_axis_;
109  }
111  {
112  return y_axis_;
113  }
115  {
116  return z_axis_;
117  }
118 
119  void setXColor(const Ogre::ColourValue& col);
120  void setYColor(const Ogre::ColourValue& col);
121  void setZColor(const Ogre::ColourValue& col);
122  void updateAlpha(float alpha);
123  void setToDefaultColors();
124  const Ogre::ColourValue& getDefaultXColor();
125  const Ogre::ColourValue& getDefaultYColor();
126  const Ogre::ColourValue& getDefaultZColor();
127 
128 
129 private:
130  // prohibit copying
131  Axes(const Axes&) = delete;
132  Axes& operator=(const Axes&) = delete;
133 
134  Ogre::SceneNode* scene_node_;
135 
139 
140  Ogre::ColourValue default_x_color_;
141  Ogre::ColourValue default_y_color_;
142  Ogre::ColourValue default_z_color_;
143 };
144 
145 } // namespace rviz
146 
147 #endif
rviz::Axes::getSceneNode
Ogre::SceneNode * getSceneNode()
Get the scene node associated with this object.
Definition: axes.h:96
Ogre
Definition: axes_display.h:35
rviz::Axes::y_axis_
Shape * y_axis_
Cylinder for the Y-axis.
Definition: axes.h:137
rviz::Axes::getYShape
Shape * getYShape()
Definition: axes.h:110
rviz::Axes::x_axis_
Shape * x_axis_
Cylinder for the X-axis.
Definition: axes.h:136
f
f
rviz::Axes::getXShape
Shape * getXShape()
Definition: axes.h:106
rviz
Definition: add_display_dialog.cpp:54
rviz::Axes::z_axis_
Shape * z_axis_
Cylinder for the Z-axis.
Definition: axes.h:138
rviz::Axes::default_z_color_
Ogre::ColourValue default_z_color_
Definition: axes.h:142
rviz::Axes::default_y_color_
Ogre::ColourValue default_y_color_
Definition: axes.h:141
rviz::Axes
An object that displays a set of X/Y/Z axes, with X=Red, Y=Green, Z=Blue.
Definition: axes.h:57
rviz::Axes::default_x_color_
Ogre::ColourValue default_x_color_
Definition: axes.h:140
set
ROSCPP_DECL void set(const std::string &key, bool b)
length
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
rviz::Shape
Definition: shape.h:51
rviz::Object
Base class for visible objects, providing a minimal generic interface.
Definition: object.h:47
rviz::Axes::getZShape
Shape * getZShape()
Definition: axes.h:114
object.h
rviz::Axes::scene_node_
Ogre::SceneNode * scene_node_
Definition: axes.h:134


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Aug 2 2024 08:43:09