Public Types | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
rviz::Tool Class Referenceabstract

#include <tool.h>

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

Public Types

enum  { Render = 1, Finished = 2 }
 

Signals

void close ()
 
void nameChanged (const QString &name)
 

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(). More...
 
const QCursor & getCursor ()
 Get current cursor of this tool. More...
 
QString getDescription () const
 Set the description of the tool. This is called by ToolManager during tool initialization. More...
 
const QIcon & getIcon ()
 Get the icon of this tool. More...
 
QString getName () const
 
virtual PropertygetPropertyContainer () const
 Return the container for properties of this Tool. More...
 
char getShortcutKey ()
 
void initialize (DisplayContext *context)
 
virtual void load (const Config &config)
 Load properties from the given Config. More...
 
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. More...
 
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. More...
 
void setCursor (const QCursor &cursor)
 Set the cursor for this tool. More...
 
void setDescription (const QString &description)
 
void setIcon (const QIcon &icon)
 Set the toolbar icon for this tool (will also set its cursor). More...
 
void setName (const QString &name)
 Set the name of the tool. More...
 
void setStatus (const QString &message)
 
 Tool ()
 
virtual void update (float wall_dt, float ros_dt)
 
 ~Tool () override
 

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 56 of file tool.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Render 
Finished 

Definition at line 100 of file tool.h.

Constructor & Destructor Documentation

◆ Tool()

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.

Definition at line 41 of file tool.cpp.

◆ ~Tool()

rviz::Tool::~Tool ( )
override

Definition at line 47 of file tool.cpp.

Member Function Documentation

◆ accessAllKeys()

bool rviz::Tool::accessAllKeys ( )
inline

Definition at line 86 of file tool.h.

◆ activate()

virtual void rviz::Tool::activate ( )
pure virtual

◆ close

void rviz::Tool::close ( )
signal

◆ deactivate()

virtual void rviz::Tool::deactivate ( )
pure virtual

◆ getClassId()

virtual QString rviz::Tool::getClassId ( ) const
inlinevirtual

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

Definition at line 147 of file tool.h.

◆ getCursor()

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

Get current cursor of this tool.

Definition at line 186 of file tool.h.

◆ getDescription()

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

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

Definition at line 138 of file tool.h.

◆ getIcon()

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

Get the icon of this tool.

Definition at line 177 of file tool.h.

◆ getName()

QString rviz::Tool::getName ( ) const
inline

Definition at line 124 of file tool.h.

◆ getPropertyContainer()

virtual Property* rviz::Tool::getPropertyContainer ( ) const
inlinevirtual

Return the container for properties of this Tool.

Definition at line 76 of file tool.h.

◆ getShortcutKey()

char rviz::Tool::getShortcutKey ( )
inline

Definition at line 81 of file tool.h.

◆ initialize()

void rviz::Tool::initialize ( DisplayContext context)

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

Definition at line 52 of file tool.cpp.

◆ load()

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 90 of file tool.cpp.

◆ nameChanged

void rviz::Tool::nameChanged ( const QString &  name)
signal

◆ onInitialize()

virtual void rviz::Tool::onInitialize ( )
inlineprotectedvirtual

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::InitialPoseTool, rviz::GoalTool, rviz::MeasureTool, rviz::SelectionTool, rviz::InteractionTool, rviz::PoseTool, and rviz::FocusTool.

Definition at line 202 of file tool.h.

◆ processKeyEvent()

virtual int rviz::Tool::processKeyEvent ( QKeyEvent *  event,
RenderPanel panel 
)
inlinevirtual

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 117 of file tool.h.

◆ processMouseEvent()

virtual int rviz::Tool::processMouseEvent ( ViewportMouseEvent event)
inlinevirtual

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::FailedTool, rviz::InteractionTool, rviz::PoseTool, rviz::FocusTool, and rviz::MoveTool.

Definition at line 108 of file tool.h.

◆ save()

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 95 of file tool.cpp.

◆ setClassId()

virtual void rviz::Tool::setClassId ( const QString &  class_id)
inlinevirtual

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

Definition at line 154 of file tool.h.

◆ setCursor()

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

Set the cursor for this tool.

Definition at line 67 of file tool.cpp.

◆ setDescription()

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

Definition at line 84 of file tool.cpp.

◆ setIcon()

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

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

Definition at line 61 of file tool.cpp.

◆ setName()

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 72 of file tool.cpp.

◆ setStatus()

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

Definition at line 101 of file tool.cpp.

◆ update()

virtual void rviz::Tool::update ( float  wall_dt,
float  ros_dt 
)
inlinevirtual

Reimplemented in rviz::SelectionTool.

Definition at line 94 of file tool.h.

Member Data Documentation

◆ access_all_keys_

bool rviz::Tool::access_all_keys_
protected

Definition at line 210 of file tool.h.

◆ class_id_

QString rviz::Tool::class_id_
private

Definition at line 217 of file tool.h.

◆ context_

DisplayContext* rviz::Tool::context_
protected

Definition at line 207 of file tool.h.

◆ cursor_

QCursor rviz::Tool::cursor_
protected

Definition at line 214 of file tool.h.

◆ description_

QString rviz::Tool::description_
private

Definition at line 220 of file tool.h.

◆ icon_

QIcon rviz::Tool::icon_
protected

Definition at line 212 of file tool.h.

◆ name_

QString rviz::Tool::name_
private

Definition at line 219 of file tool.h.

◆ property_container_

Property* rviz::Tool::property_container_
private

Definition at line 218 of file tool.h.

◆ scene_manager_

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

Definition at line 206 of file tool.h.

◆ shortcut_key_

char rviz::Tool::shortcut_key_
protected

Definition at line 209 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 Sat May 27 2023 02:06:26