Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
rviz::Shape Class Reference

#include <shape.h>

Inheritance diagram for rviz::Shape:
Inheritance graph
[legend]

Public Types

enum  Type {
  Cone, Cube, Cylinder, Sphere,
  Mesh
}
 

Public Member Functions

Ogre::Entity * getEntity ()
 
Ogre::MaterialPtr getMaterial ()
 
const Ogre::Quaternion & getOrientation () override
 Get the local orientation of this object. More...
 
const Ogre::Vector3 & getPosition () override
 Get the local position of this object. More...
 
Ogre::SceneNode * getRootNode ()
 Get the root scene node (pivot node) for this object. More...
 
Type getType ()
 
void setColor (float r, float g, float b, float a) override
 Set the color of the object. Values are in the range [0, 1]. More...
 
void setColor (const Ogre::ColourValue &c)
 
void setOffset (const Ogre::Vector3 &offset)
 Set the offset for this shape. More...
 
void setOrientation (const Ogre::Quaternion &orientation) override
 Set the orientation of the object. More...
 
void setPosition (const Ogre::Vector3 &position) override
 Set the position of this object. More...
 
void setScale (const Ogre::Vector3 &scale) override
 Set the scale of the object. Always relative to the identity orientation of the object. More...
 
void setUserData (const Ogre::Any &data) override
 Sets user data on all ogre objects we own. More...
 
 Shape (Type shape_type, Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node=nullptr)
 Constructor. More...
 
 ~Shape () override
 
- Public Member Functions inherited from rviz::Object
 Object (Ogre::SceneManager *scene_manager)
 
virtual ~Object ()
 

Static Public Member Functions

static Ogre::Entity * createEntity (const std::string &name, Type shape_type, Ogre::SceneManager *scene_manager)
 

Protected Attributes

Ogre::Entity * entity_
 
Ogre::MaterialPtr material_
 
std::string material_name_
 
Ogre::SceneNode * offset_node_
 
Ogre::SceneNode * scene_node_
 
Type type_
 
- Protected Attributes inherited from rviz::Object
Ogre::SceneManager * scene_manager_
 Ogre scene manager this object is part of. More...
 

Detailed Description

Definition at line 51 of file shape.h.

Member Enumeration Documentation

◆ Type

Enumerator
Cone 
Cube 
Cylinder 
Sphere 
Mesh 

Definition at line 54 of file shape.h.

Constructor & Destructor Documentation

◆ Shape()

rviz::Shape::Shape ( Type  shape_type,
Ogre::SceneManager *  scene_manager,
Ogre::SceneNode *  parent_node = nullptr 
)

Constructor.

Parameters
scene_managerThe scene manager this object is associated with
parent_nodeA scene node to use as the parent of this object. If NULL, uses the root scene node.

Definition at line 76 of file shape.cpp.

◆ ~Shape()

rviz::Shape::~Shape ( )
override

Definition at line 111 of file shape.cpp.

Member Function Documentation

◆ createEntity()

Ogre::Entity * rviz::Shape::createEntity ( const std::string &  name,
Type  shape_type,
Ogre::SceneManager *  scene_manager 
)
static

Definition at line 45 of file shape.cpp.

◆ getEntity()

Ogre::Entity* rviz::Shape::getEntity ( )
inline

Definition at line 110 of file shape.h.

◆ getMaterial()

Ogre::MaterialPtr rviz::Shape::getMaterial ( )
inline

Definition at line 115 of file shape.h.

◆ getOrientation()

const Ogre::Quaternion & rviz::Shape::getOrientation ( )
overridevirtual

Get the local orientation of this object.

Returns
The orientation

Implements rviz::Object.

Definition at line 170 of file shape.cpp.

◆ getPosition()

const Ogre::Vector3 & rviz::Shape::getPosition ( )
overridevirtual

Get the local position of this object.

Returns
The position

Implements rviz::Object.

Definition at line 165 of file shape.cpp.

◆ getRootNode()

Ogre::SceneNode* rviz::Shape::getRootNode ( )
inline

Get the root scene node (pivot node) for this object.

Returns
The root scene node of this object

Definition at line 100 of file shape.h.

◆ getType()

Type rviz::Shape::getType ( )
inline

Definition at line 73 of file shape.h.

◆ setColor() [1/2]

void rviz::Shape::setColor ( float  r,
float  g,
float  b,
float  a 
)
overridevirtual

Set the color of the object. Values are in the range [0, 1].

Parameters
rRed component
gGreen component
bBlue component

Implements rviz::Object.

Definition at line 140 of file shape.cpp.

◆ setColor() [2/2]

void rviz::Shape::setColor ( const Ogre::ColourValue &  c)

Definition at line 123 of file shape.cpp.

◆ setOffset()

void rviz::Shape::setOffset ( const Ogre::Vector3 &  offset)

Set the offset for this shape.

The default is no offset, which puts the pivot point directly in the center of the object.

Parameters
offsetAmount to offset the center of the object from the pivot point

Definition at line 145 of file shape.cpp.

◆ setOrientation()

void rviz::Shape::setOrientation ( const Ogre::Quaternion &  orientation)
overridevirtual

Set the orientation of the object.

Parameters
Orientationquaternion orientation to set to.

Implements rviz::Object.

Definition at line 155 of file shape.cpp.

◆ setPosition()

void rviz::Shape::setPosition ( const Ogre::Vector3 &  position)
overridevirtual

Set the position of this object.

Parameters
Positionvector position to set to.

Implements rviz::Object.

Definition at line 150 of file shape.cpp.

◆ setScale()

void rviz::Shape::setScale ( const Ogre::Vector3 &  scale)
overridevirtual

Set the scale of the object. Always relative to the identity orientation of the object.

Parameters
Scalevector scale to set to.

Implements rviz::Object.

Definition at line 160 of file shape.cpp.

◆ setUserData()

void rviz::Shape::setUserData ( const Ogre::Any &  data)
overridevirtual

Sets user data on all ogre objects we own.

Implements rviz::Object.

Definition at line 175 of file shape.cpp.

Member Data Documentation

◆ entity_

Ogre::Entity* rviz::Shape::entity_
protected

Definition at line 126 of file shape.h.

◆ material_

Ogre::MaterialPtr rviz::Shape::material_
protected

Definition at line 127 of file shape.h.

◆ material_name_

std::string rviz::Shape::material_name_
protected

Definition at line 128 of file shape.h.

◆ offset_node_

Ogre::SceneNode* rviz::Shape::offset_node_
protected

Definition at line 125 of file shape.h.

◆ scene_node_

Ogre::SceneNode* rviz::Shape::scene_node_
protected

Definition at line 124 of file shape.h.

◆ type_

Type rviz::Shape::type_
protected

Definition at line 130 of file shape.h.


The documentation for this class was generated from the following files:


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Sat May 27 2023 02:06:26