Public Member Functions | Private Attributes | List of all members
rviz::Arrow Class Reference

An arrow consisting of a cylinder and a cone. More...

#include <arrow.h>

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

Public Member Functions

 Arrow (Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node=nullptr, float shaft_length=1.0f, float shaft_diameter=0.1f, float head_length=0.3f, float head_diameter=0.2f)
 Constructor. More...
 
ShapegetHead ()
 
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 * getSceneNode ()
 Get the scene node associated with this arrow. More...
 
ShapegetShaft ()
 
void set (float shaft_length, float shaft_diameter, float head_length, float head_diameter)
 Set the parameters for this arrow. More...
 
void setColor (float r, float g, float b, float a) override
 Set the color of this arrow. Sets both the head and shaft color to the same value. Values are in the range [0, 1]. More...
 
void setColor (const Ogre::ColourValue &color)
 
void setDirection (const Ogre::Vector3 &direction)
 Set the direction of the arrow. More...
 
void setHeadColor (float r, float g, float b, float a=1.0f)
 Set the color of the arrow's head. Values are in the range [0, 1]. More...
 
void setHeadColor (const Ogre::ColourValue &color)
 
void setOrientation (const Ogre::Quaternion &orientation) override
 Set the orientation. More...
 
void setPosition (const Ogre::Vector3 &position) override
 Set the position of the base of the arrow. 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 setShaftColor (float r, float g, float b, float a=1.0f)
 Set the color of the arrow's shaft. Values are in the range [0, 1]. More...
 
void setShaftColor (const Ogre::ColourValue &color)
 
void setUserData (const Ogre::Any &data) override
 Sets user data on all ogre objects we own. More...
 
 ~Arrow () override
 
- Public Member Functions inherited from rviz::Object
 Object (Ogre::SceneManager *scene_manager)
 
virtual ~Object ()
 

Private Attributes

Shapehead_
 Cone used for the head of the arrow. More...
 
Ogre::SceneNode * scene_node_
 
Shapeshaft_
 Cylinder used for the shaft of the arrow. More...
 

Additional Inherited Members

- Protected Attributes inherited from rviz::Object
Ogre::SceneManager * scene_manager_
 Ogre scene manager this object is part of. More...
 

Detailed Description

An arrow consisting of a cylinder and a cone.

The base of the arrow is at the position sent to setPosition(). The arrow points in the direction of the negative Z axis by default, and -Z is the identity direction of it. To set a different direction, call setOrientation() with a rotation from -Z to the desired vector.

Definition at line 59 of file arrow.h.

Constructor & Destructor Documentation

◆ Arrow()

rviz::Arrow::Arrow ( Ogre::SceneManager *  scene_manager,
Ogre::SceneNode *  parent_node = nullptr,
float  shaft_length = 1.0f,
float  shaft_diameter = 0.1f,
float  head_length = 0.3f,
float  head_diameter = 0.2f 
)

Constructor.

Parameters
scene_managerThe scene manager to use to construct any necessary objects
parent_nodeA scene node to use as the parent of this object. If NULL, uses the root scene node.
shaft_lengthLength of the arrow's shaft
shaft_diameterDiameter of the arrow's shaft
head_lengthLength of the arrow's head
head_diameterDiameter of the arrow's head

Definition at line 42 of file arrow.cpp.

◆ ~Arrow()

rviz::Arrow::~Arrow ( )
override

Definition at line 66 of file arrow.cpp.

Member Function Documentation

◆ getHead()

Shape* rviz::Arrow::getHead ( )
inline

Definition at line 163 of file arrow.h.

◆ getOrientation()

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

Get the local orientation of this object.

Returns
The orientation

Implements rviz::Object.

Definition at line 145 of file arrow.cpp.

◆ getPosition()

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

Get the local position of this object.

Returns
The position

Implements rviz::Object.

Definition at line 140 of file arrow.cpp.

◆ getSceneNode()

Ogre::SceneNode* rviz::Arrow::getSceneNode ( )
inline

Get the scene node associated with this arrow.

Returns
the scene node associated with this arrow

Definition at line 149 of file arrow.h.

◆ getShaft()

Shape* rviz::Arrow::getShaft ( )
inline

Definition at line 159 of file arrow.h.

◆ set()

void rviz::Arrow::set ( float  shaft_length,
float  shaft_diameter,
float  head_length,
float  head_diameter 
)

Set the parameters for this arrow.

Parameters
shaft_lengthLength of the arrow's shaft
shaft_diameterDiameter of the arrow's shaft
head_lengthLength of the arrow's head
head_diameterDiameter of the arrow's head

Definition at line 74 of file arrow.cpp.

◆ setColor() [1/2]

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

Set the color of this arrow. Sets both the head and shaft color to the same value. Values are in the range [0, 1].

Parameters
rRed component
gGreen component
bBlue component

Implements rviz::Object.

Definition at line 89 of file arrow.cpp.

◆ setColor() [2/2]

void rviz::Arrow::setColor ( const Ogre::ColourValue &  color)

Definition at line 83 of file arrow.cpp.

◆ setDirection()

void rviz::Arrow::setDirection ( const Ogre::Vector3 &  direction)

Set the direction of the arrow.

Parameters
directionThe direction the arrow should point, in the coordinate frame of the parent Ogre::SceneNode.

If direction is zero, this does not change the arrow.

Both setOrientation() and setDirection() change the direction the arrow points.

Definition at line 126 of file arrow.cpp.

◆ setHeadColor() [1/2]

void rviz::Arrow::setHeadColor ( float  r,
float  g,
float  b,
float  a = 1.0f 
)

Set the color of the arrow's head. Values are in the range [0, 1].

Parameters
rRed component
gGreen component
bBlue component

Definition at line 109 of file arrow.cpp.

◆ setHeadColor() [2/2]

void rviz::Arrow::setHeadColor ( const Ogre::ColourValue &  color)

Definition at line 99 of file arrow.cpp.

◆ setOrientation()

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

Set the orientation.

Note that negative Z is the identity orientation.

Both setOrientation() and setDirection() change the direction the arrow points.

Implements rviz::Object.

Definition at line 119 of file arrow.cpp.

◆ setPosition()

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

Set the position of the base of the arrow.

Implements rviz::Object.

Definition at line 114 of file arrow.cpp.

◆ setScale()

void rviz::Arrow::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 134 of file arrow.cpp.

◆ setShaftColor() [1/2]

void rviz::Arrow::setShaftColor ( float  r,
float  g,
float  b,
float  a = 1.0f 
)

Set the color of the arrow's shaft. Values are in the range [0, 1].

Parameters
rRed component
gGreen component
bBlue component

Definition at line 104 of file arrow.cpp.

◆ setShaftColor() [2/2]

void rviz::Arrow::setShaftColor ( const Ogre::ColourValue &  color)

Definition at line 94 of file arrow.cpp.

◆ setUserData()

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

Sets user data on all ogre objects we own.

Implements rviz::Object.

Definition at line 150 of file arrow.cpp.

Member Data Documentation

◆ head_

Shape* rviz::Arrow::head_
private

Cone used for the head of the arrow.

Definition at line 172 of file arrow.h.

◆ scene_node_

Ogre::SceneNode* rviz::Arrow::scene_node_
private

Definition at line 169 of file arrow.h.

◆ shaft_

Shape* rviz::Arrow::shaft_
private

Cylinder used for the shaft of the arrow.

Definition at line 171 of file arrow.h.


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


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