Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
rviz::Tool Class Reference

#include <tool.h>

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

List of all members.

Public Types

enum  { Render = 1, Finished = 2 }

Public Member Functions

bool accessAllKeys ()
virtual void activate ()=0
virtual void deactivate ()=0
virtual QString getClassId () const
 Return the class identifier which was used to create this instance. This version just returns whatever was set with setClassId().
const QCursor & getCursor ()
 Get current cursor of this tool.
QString getDescription () const
 Set the description of the tool. This is called by ToolManager during tool initialization.
const QIcon & getIcon ()
 Get the icon of this tool.
QString getName () const
virtual PropertygetPropertyContainer () const
 Return the container for properties of this Tool.
char getShortcutKey ()
void initialize (DisplayContext *context)
virtual void load (const Config &config)
 Load properties from the given Config.
virtual int processKeyEvent (QKeyEvent *event, RenderPanel *panel)
virtual int processMouseEvent (ViewportMouseEvent &event)
virtual void save (Config config) const
 Save this entire tool into the given Config node.
virtual void setClassId (const QString &class_id)
 Set the class identifier used to create this instance. Typically this will be set by the factory object which created it.
void setCursor (const QCursor &cursor)
 Set the cursor for this tool.
void setDescription (const QString &description)
void setIcon (const QIcon &icon)
 Set the toolbar icon for this tool (will also set its cursor).
void setName (const QString &name)
 Set the name of the tool.
void setStatus (const QString &message)
 Tool ()
virtual void update (float wall_dt, float ros_dt)
virtual ~Tool ()

Protected Member Functions

virtual void onInitialize ()

Protected Attributes

bool access_all_keys_
DisplayContextcontext_
QCursor cursor_
QIcon icon_
Ogre::SceneManager * scene_manager_
char shortcut_key_

Private Attributes

QString class_id_
QString description_
QString name_
Propertyproperty_container_

Detailed Description

Definition at line 55 of file tool.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
Render 
Finished 

Definition at line 86 of file tool.h.


Constructor & Destructor Documentation

Default constructor. Pluginlib only instantiates classes via default constructors. Subclasses of Tool should shortcut_key_ field in their constructors.

Properties to appear in the Tool Properties panel are typically created in the constructor, as children of the property from getPropertyContainer(), which is set up in this Tool constructor.

Definition at line 42 of file tool.cpp.

rviz::Tool::~Tool ( ) [virtual]

Definition at line 49 of file tool.cpp.


Member Function Documentation

bool rviz::Tool::accessAllKeys ( ) [inline]

Definition at line 79 of file tool.h.

virtual void rviz::Tool::activate ( ) [pure virtual]
virtual void rviz::Tool::deactivate ( ) [pure virtual]
virtual QString rviz::Tool::getClassId ( ) const [inline, virtual]

Return the class identifier which was used to create this instance. This version just returns whatever was set with setClassId().

Definition at line 117 of file tool.h.

const QCursor& rviz::Tool::getCursor ( ) [inline]

Get current cursor of this tool.

Definition at line 147 of file tool.h.

QString rviz::Tool::getDescription ( ) const [inline]

Set the description of the tool. This is called by ToolManager during tool initialization.

Reimplemented in rviz::FailedTool.

Definition at line 111 of file tool.h.

const QIcon& rviz::Tool::getIcon ( ) [inline]

Get the icon of this tool.

Definition at line 141 of file tool.h.

QString rviz::Tool::getName ( void  ) const [inline]

Definition at line 100 of file tool.h.

virtual Property* rviz::Tool::getPropertyContainer ( ) const [inline, virtual]

Return the container for properties of this Tool.

Definition at line 75 of file tool.h.

char rviz::Tool::getShortcutKey ( ) [inline]

Definition at line 77 of file tool.h.

Initialize the tool. Sets the DisplayContext and calls onInitialize().

Definition at line 54 of file tool.cpp.

void rviz::Tool::load ( const Config config) [virtual]

Load properties from the given Config.

Most tools won't need to override this, because any child Properties of property_container_ are automatically loaded by this function.

Reimplemented in rviz::FailedTool.

Definition at line 86 of file tool.cpp.

virtual void rviz::Tool::onInitialize ( ) [inline, protected, virtual]

Override onInitialize to do any setup needed after the DisplayContext has been set. This is called by Tool::initialize(). The base implementation here does nothing.

Reimplemented in rviz::PointTool, rviz::MeasureTool, rviz::SelectionTool, rviz::GoalTool, rviz::InitialPoseTool, rviz::InteractionTool, rviz::PoseTool, and rviz::FocusTool.

Definition at line 156 of file tool.h.

virtual int rviz::Tool::processKeyEvent ( QKeyEvent *  event,
RenderPanel panel 
) [inline, virtual]

Process a key event. Override if your tool should handle any other keypresses than the tool shortcuts, which are handled separately.

Reimplemented in rviz::SelectionTool, rviz::InteractionTool, and rviz::MoveTool.

Definition at line 98 of file tool.h.

virtual int rviz::Tool::processMouseEvent ( ViewportMouseEvent event) [inline, virtual]

Process a mouse event. This is the central function of all the tools, as it defines how the mouse is used.

Reimplemented in rviz::PointTool, rviz::MeasureTool, rviz::SelectionTool, rviz::InteractionTool, rviz::PoseTool, rviz::FailedTool, rviz::FocusTool, and rviz::MoveTool.

Definition at line 93 of file tool.h.

void rviz::Tool::save ( Config  config) const [virtual]

Save this entire tool into the given Config node.

Most tools won't need to override this, because any child Properties of property_container_ are automatically saved by this function.

Reimplemented in rviz::FailedTool.

Definition at line 91 of file tool.cpp.

virtual void rviz::Tool::setClassId ( const QString &  class_id) [inline, virtual]

Set the class identifier used to create this instance. Typically this will be set by the factory object which created it.

Definition at line 121 of file tool.h.

void rviz::Tool::setCursor ( const QCursor &  cursor)

Set the cursor for this tool.

Definition at line 69 of file tool.cpp.

void rviz::Tool::setDescription ( const QString &  description)

Definition at line 80 of file tool.cpp.

void rviz::Tool::setIcon ( const QIcon &  icon)

Set the toolbar icon for this tool (will also set its cursor).

Definition at line 63 of file tool.cpp.

void rviz::Tool::setName ( const QString &  name)

Set the name of the tool.

This is called by ToolManager during tool initialization. If you want a different name than it gives you, call this from onInitialize() (or thereafter).

Definition at line 74 of file tool.cpp.

void rviz::Tool::setStatus ( const QString &  message)

Definition at line 97 of file tool.cpp.

virtual void rviz::Tool::update ( float  wall_dt,
float  ros_dt 
) [inline, virtual]

Reimplemented in rviz::SelectionTool.

Definition at line 84 of file tool.h.


Member Data Documentation

bool rviz::Tool::access_all_keys_ [protected]

Definition at line 162 of file tool.h.

QString rviz::Tool::class_id_ [private]

Definition at line 169 of file tool.h.

Definition at line 159 of file tool.h.

QCursor rviz::Tool::cursor_ [protected]

Definition at line 166 of file tool.h.

QString rviz::Tool::description_ [private]

Definition at line 172 of file tool.h.

QIcon rviz::Tool::icon_ [protected]

Definition at line 164 of file tool.h.

QString rviz::Tool::name_ [private]

Definition at line 171 of file tool.h.

Definition at line 170 of file tool.h.

Ogre::SceneManager* rviz::Tool::scene_manager_ [protected]

Definition at line 158 of file tool.h.

char rviz::Tool::shortcut_key_ [protected]

Definition at line 161 of file tool.h.


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


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Tue Oct 3 2017 03:19:32