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 ()
 

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

Constructor & Destructor Documentation

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 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
void rviz::Tool::close ( )
signal
virtual void rviz::Tool::deactivate ( )
pure virtual
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 130 of file tool.h.

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

Get current cursor of this tool.

Definition at line 160 of file tool.h.

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

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

Definition at line 124 of file tool.h.

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

Get the icon of this tool.

Definition at line 154 of file tool.h.

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

Definition at line 113 of file tool.h.

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

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.

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

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

Definition at line 172 of file tool.h.

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

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

Definition at line 97 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)
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 134 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 
)
inlinevirtual

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

QString rviz::Tool::class_id_
private

Definition at line 185 of file tool.h.

DisplayContext* rviz::Tool::context_
protected

Definition at line 175 of file tool.h.

QCursor rviz::Tool::cursor_
protected

Definition at line 182 of file tool.h.

QString rviz::Tool::description_
private

Definition at line 188 of file tool.h.

QIcon rviz::Tool::icon_
protected

Definition at line 180 of file tool.h.

QString rviz::Tool::name_
private

Definition at line 187 of file tool.h.

Property* rviz::Tool::property_container_
private

Definition at line 186 of file tool.h.

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

Definition at line 174 of file tool.h.

char rviz::Tool::shortcut_key_
protected

Definition at line 177 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 Apr 27 2019 02:33:44