Class Shape

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class Shape : public rviz_rendering::Object

Subclassed by rviz_rendering::MeshShape

Public Types

enum Type

Values:

enumerator Cone
enumerator Cube
enumerator Cylinder
enumerator Sphere
enumerator Mesh

Public Functions

RVIZ_RENDERING_PUBLIC Shape(Type shape_type, Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node = NULL)

Constructor.

Parameters:
  • scene_manager – The scene manager this object is associated with

  • parent_node – A scene node to use as the parent of this object. If NULL, uses the root scene node.

virtual RVIZ_RENDERING_PUBLIC ~Shape()
inline RVIZ_RENDERING_PUBLIC Type getType ()
RVIZ_RENDERING_PUBLIC void 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:

offset – Amount to offset the center of the object from the pivot point

virtual RVIZ_RENDERING_PUBLIC void setColor (float r, float g, float b, float a)

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

Parameters:
  • r – Red component

  • g – Green component

  • b – Blue component

RVIZ_RENDERING_PUBLIC void setColor (const Ogre::ColourValue &c)
virtual RVIZ_RENDERING_PUBLIC void setPosition (const Ogre::Vector3 &position)

Set the position of this object.

Parameters:

Position – vector position to set to.

virtual RVIZ_RENDERING_PUBLIC void setOrientation (const Ogre::Quaternion &orientation)

Set the orientation of the object.

Parameters:

Orientation – quaternion orientation to set to.

virtual RVIZ_RENDERING_PUBLIC void setScale (const Ogre::Vector3 &scale)

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

Parameters:

Scale – vector scale to set to.

virtual RVIZ_RENDERING_PUBLIC const Ogre::Vector3 & getPosition ()

Get the local position of this object.

Returns:

The position

virtual RVIZ_RENDERING_PUBLIC const Ogre::Quaternion & getOrientation ()

Get the local orientation of this object.

Returns:

The orientation

inline RVIZ_RENDERING_PUBLIC Ogre::SceneNode * getRootNode ()

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

Returns:

The root scene node of this object

virtual RVIZ_RENDERING_PUBLIC void setUserData (const Ogre::Any &data)

Sets user data on all ogre objects we own.

inline RVIZ_RENDERING_PUBLIC Ogre::Entity * getEntity ()
inline RVIZ_RENDERING_PUBLIC Ogre::MaterialPtr getMaterial ()

Public Static Functions

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

Protected Attributes

Ogre::SceneNode *scene_node_
Ogre::SceneNode *offset_node_
Ogre::Entity *entity_
Ogre::MaterialPtr material_
std::string material_name_
Type type_