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 }
46 
47 namespace rviz
48 {
49 
52 class Shape : public Object
53 {
54 public:
55  enum Type
56  {
62  };
63 
70  Shape(Type shape_type, Ogre::SceneManager* scene_manager, Ogre::SceneNode* parent_node = NULL);
71  virtual ~Shape();
72 
73  Type getType() { return type_; }
74 
82  void setOffset( const Ogre::Vector3& offset );
83 
84  virtual void setColor( float r, float g, float b, float a );
85  void setColor( const Ogre::ColourValue& c );
86  virtual void setPosition( const Ogre::Vector3& position );
87  virtual void setOrientation( const Ogre::Quaternion& orientation );
88  virtual void setScale( const Ogre::Vector3& scale );
89  virtual const Ogre::Vector3& getPosition();
90  virtual const Ogre::Quaternion& getOrientation();
91 
97  Ogre::SceneNode* getRootNode() { return scene_node_; }
98 
102  void setUserData( const Ogre::Any& data );
103 
104  Ogre::Entity* getEntity() { return entity_; }
105 
106  Ogre::MaterialPtr getMaterial() { return material_; }
107 
108  static Ogre::Entity* createEntity(const std::string& name, Type shape_type, Ogre::SceneManager* scene_manager);
109 
110 protected:
111  Ogre::SceneNode* scene_node_;
112  Ogre::SceneNode* offset_node_;
113  Ogre::Entity* entity_;
114  Ogre::MaterialPtr material_;
115  std::string material_name_;
116 
118 };
119 
120 } // namespace rviz
121 
122 #endif
123 
#define NULL
Definition: global.h:37
Ogre::SceneNode * offset_node_
Definition: shape.h:112
Ogre::Entity * entity_
Definition: shape.h:113
std::string material_name_
Definition: shape.h:115
Ogre::MaterialPtr material_
Definition: shape.h:114
Base class for visible objects, providing a minimal generic interface.
Definition: object.h:49
Ogre::SceneNode * scene_node_
Definition: shape.h:111
Ogre::MaterialPtr getMaterial()
Definition: shape.h:106
Type type_
Definition: shape.h:117
Ogre::SceneNode * getRootNode()
Get the root scene node (pivot node) for this object.
Definition: shape.h:97
r
Type getType()
Definition: shape.h:73
Ogre::Entity * getEntity()
Definition: shape.h:104


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Wed Aug 28 2019 04:01:51