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


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