#include <tool.h>
Public Types | |
enum | { Render = 1, Finished = 2 } |
Public Member Functions | |
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 Property * | getPropertyContainer () 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 | |
DisplayContext * | context_ |
QCursor | cursor_ |
QIcon | icon_ |
Ogre::SceneManager * | scene_manager_ |
char | shortcut_key_ |
Private Attributes | |
QString | class_id_ |
QString | description_ |
QString | name_ |
Property * | property_container_ |
rviz::Tool::Tool | ( | ) |
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.
rviz::Tool::~Tool | ( | ) | [virtual] |
virtual void rviz::Tool::activate | ( | ) | [pure virtual] |
Implemented in rviz::PointTool, rviz::MeasureTool, rviz::SelectionTool, rviz::InteractionTool, rviz::PoseTool, rviz::FailedTool, rviz::FocusTool, and rviz::MoveTool.
virtual void rviz::Tool::deactivate | ( | ) | [pure virtual] |
Implemented in rviz::PointTool, rviz::MeasureTool, rviz::SelectionTool, rviz::InteractionTool, rviz::PoseTool, rviz::FailedTool, rviz::FocusTool, and rviz::MoveTool.
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().
const QCursor& rviz::Tool::getCursor | ( | ) | [inline] |
QString rviz::Tool::getDescription | ( | ) | const [inline] |
Set the description of the tool. This is called by ToolManager during tool initialization.
Reimplemented in rviz::FailedTool.
const QIcon& rviz::Tool::getIcon | ( | ) | [inline] |
QString rviz::Tool::getName | ( | void | ) | const [inline] |
virtual Property* rviz::Tool::getPropertyContainer | ( | ) | const [inline, virtual] |
char rviz::Tool::getShortcutKey | ( | ) | [inline] |
void rviz::Tool::initialize | ( | DisplayContext * | context | ) |
Initialize the tool. Sets the DisplayContext and calls onInitialize().
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.
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.
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.
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.
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.
virtual void rviz::Tool::setClassId | ( | const QString & | class_id | ) | [inline, virtual] |
void rviz::Tool::setCursor | ( | const QCursor & | cursor | ) |
void rviz::Tool::setDescription | ( | const QString & | description | ) |
void rviz::Tool::setIcon | ( | const QIcon & | icon | ) |
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).
void rviz::Tool::setStatus | ( | const QString & | message | ) |
virtual void rviz::Tool::update | ( | float | wall_dt, |
float | ros_dt | ||
) | [inline, virtual] |
Reimplemented in rviz::SelectionTool.
QString rviz::Tool::class_id_ [private] |
DisplayContext* rviz::Tool::context_ [protected] |
QCursor rviz::Tool::cursor_ [protected] |
QString rviz::Tool::description_ [private] |
QIcon rviz::Tool::icon_ [protected] |
QString rviz::Tool::name_ [private] |
Property* rviz::Tool::property_container_ [private] |
Ogre::SceneManager* rviz::Tool::scene_manager_ [protected] |
char rviz::Tool::shortcut_key_ [protected] |