shape.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_SHAPE_H
31 #define OGRE_TOOLS_SHAPE_H
32 
33 #include "object.h"
34 
35 #include <OgreMaterial.h>
36 #include <OgreVector3.h>
37 #include <OgreSharedPtr.h>
38 
39 namespace Ogre
40 {
41 class SceneManager;
42 class SceneNode;
43 class Any;
44 class Entity;
45 } // namespace Ogre
46 
47 namespace rviz
48 {
51 class Shape : public Object
52 {
53 public:
54  enum Type
55  {
61  };
62 
70  Shape(Type shape_type, Ogre::SceneManager* scene_manager, Ogre::SceneNode* parent_node = nullptr);
71  ~Shape() override;
72 
74  {
75  return type_;
76  }
77 
85  void setOffset(const Ogre::Vector3& offset);
86 
87  void setColor(float r, float g, float b, float a) override;
88  void setColor(const Ogre::ColourValue& c);
89  void setPosition(const Ogre::Vector3& position) override;
90  void setOrientation(const Ogre::Quaternion& orientation) override;
91  void setScale(const Ogre::Vector3& scale) override;
92  const Ogre::Vector3& getPosition() override;
93  const Ogre::Quaternion& getOrientation() override;
94 
100  Ogre::SceneNode* getRootNode()
101  {
102  return scene_node_;
103  }
104 
108  void setUserData(const Ogre::Any& data) override;
109 
110  Ogre::Entity* getEntity()
111  {
112  return entity_;
113  }
114 
115  Ogre::MaterialPtr getMaterial()
116  {
117  return material_;
118  }
119 
120  static Ogre::Entity*
121  createEntity(const std::string& name, Type shape_type, Ogre::SceneManager* scene_manager);
122 
123 protected:
124  Ogre::SceneNode* scene_node_;
125  Ogre::SceneNode* offset_node_;
126  Ogre::Entity* entity_;
127  Ogre::MaterialPtr material_;
128  std::string material_name_;
129 
131 };
132 
133 } // namespace rviz
134 
135 #endif
Ogre::SceneNode * offset_node_
Definition: shape.h:125
Ogre::Entity * entity_
Definition: shape.h:126
std::string material_name_
Definition: shape.h:128
Ogre::MaterialPtr material_
Definition: shape.h:127
Base class for visible objects, providing a minimal generic interface.
Definition: object.h:50
Ogre::SceneNode * scene_node_
Definition: shape.h:124
Ogre::MaterialPtr getMaterial()
Definition: shape.h:115
Type type_
Definition: shape.h:130
Ogre::SceneNode * getRootNode()
Get the root scene node (pivot node) for this object.
Definition: shape.h:100
r
Type getType()
Definition: shape.h:73
Ogre::Entity * getEntity()
Definition: shape.h:110


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Fri Aug 12 2022 02:06:09