Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
rviz::ToolManager Class Reference

#include <tool_manager.h>

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

Signals

void configChanged ()
 Emitted when anything changes which will change the saved config file contents. More...
 
void toolAdded (Tool *)
 Emitted by addTool() after the tool is added to the list of tools. More...
 
void toolChanged (Tool *)
 Emitted by setCurrentTool() after the newly chosen tool is activated. More...
 
void toolRefreshed (Tool *)
 Emitted by refreshTool() to gedraw the tool's icon in the toolbar'. More...
 
void toolRemoved (Tool *)
 

Public Member Functions

TooladdTool (const QString &tool_class_lookup_name)
 Create a tool by class lookup name, add it to the list, and return it. More...
 
ToolgetCurrentTool ()
 Return the tool currently in use. More...
 
ToolgetDefaultTool ()
 Get the default tool. More...
 
PluginlibFactory< Tool > * getFactory ()
 
PropertyTreeModelgetPropertyModel () const
 
ToolgetTool (int index)
 Return the tool at a given index in the Tool list. If index is less than 0 or greater than the number of tools, this will fail an assertion. More...
 
QStringList getToolClasses ()
 
void handleChar (QKeyEvent *event, RenderPanel *panel)
 
void initialize ()
 Initialization for after the DisplayContext is created. Loads standard RViz tools. More...
 
void load (const Config &config)
 
int numTools ()
 
void refreshTool (Tool *tool)
 Triggers redrawing the tool's icon/text in the toolbar. More...
 
void removeAll ()
 
void removeTool (int index)
 
void save (Config config) const
 
void setCurrentTool (Tool *tool)
 Set the current tool. The current tool is given all mouse and keyboard events which VisualizationManager receives via handleMouseEvent() and handleChar(). More...
 
void setDefaultTool (Tool *tool)
 Set the default tool. More...
 
 ToolManager (DisplayContext *context)
 
 ~ToolManager () override
 

Private Slots

void closeTool ()
 Deactivates the current tool and sets the default tool. More...
 
void updatePropertyVisibility (Property *property)
 If property has children, it is added to the tool property tree, and if it does not, it is removed. More...
 

Private Member Functions

bool toKey (QString const &str, uint &key_out)
 

Private Attributes

DisplayContextcontext_
 
Toolcurrent_tool_
 
Tooldefault_tool_
 
PluginlibFactory< Tool > * factory_
 
PropertyTreeModelproperty_tree_model_
 
std::map< int, Tool * > shortkey_to_tool_map_
 
QList< Tool * > tools_
 

Detailed Description

Definition at line 48 of file tool_manager.h.

Constructor & Destructor Documentation

◆ ToolManager()

rviz::ToolManager::ToolManager ( DisplayContext context)

Definition at line 50 of file tool_manager.cpp.

◆ ~ToolManager()

rviz::ToolManager::~ToolManager ( )
override

Definition at line 60 of file tool_manager.cpp.

Member Function Documentation

◆ addTool()

Tool * rviz::ToolManager::addTool ( const QString &  tool_class_lookup_name)

Create a tool by class lookup name, add it to the list, and return it.

Definition at line 223 of file tool_manager.cpp.

◆ closeTool

void rviz::ToolManager::closeTool ( )
privateslot

Deactivates the current tool and sets the default tool.

Definition at line 218 of file tool_manager.cpp.

◆ configChanged

void rviz::ToolManager::configChanged ( )
signal

Emitted when anything changes which will change the saved config file contents.

◆ getCurrentTool()

Tool* rviz::ToolManager::getCurrentTool ( )
inline

Return the tool currently in use.

See also
setCurrentTool()

Definition at line 73 of file tool_manager.h.

◆ getDefaultTool()

Tool* rviz::ToolManager::getDefaultTool ( )
inline

Get the default tool.

See also
setDefaultTool()

Definition at line 122 of file tool_manager.h.

◆ getFactory()

PluginlibFactory<Tool>* rviz::ToolManager::getFactory ( )
inline

Definition at line 131 of file tool_manager.h.

◆ getPropertyModel()

PropertyTreeModel* rviz::ToolManager::getPropertyModel ( ) const
inline

Definition at line 61 of file tool_manager.h.

◆ getTool()

Tool * rviz::ToolManager::getTool ( int  index)

Return the tool at a given index in the Tool list. If index is less than 0 or greater than the number of tools, this will fail an assertion.

Definition at line 194 of file tool_manager.cpp.

◆ getToolClasses()

QStringList rviz::ToolManager::getToolClasses ( )

Definition at line 303 of file tool_manager.cpp.

◆ handleChar()

void rviz::ToolManager::handleChar ( QKeyEvent *  event,
RenderPanel panel 
)

Definition at line 129 of file tool_manager.cpp.

◆ initialize()

void rviz::ToolManager::initialize ( )

Initialization for after the DisplayContext is created. Loads standard RViz tools.

Definition at line 67 of file tool_manager.cpp.

◆ load()

void rviz::ToolManager::load ( const Config config)

Definition at line 87 of file tool_manager.cpp.

◆ numTools()

int rviz::ToolManager::numTools ( )
inline

Definition at line 85 of file tool_manager.h.

◆ refreshTool()

void rviz::ToolManager::refreshTool ( Tool tool)

Triggers redrawing the tool's icon/text in the toolbar.

Definition at line 298 of file tool_manager.cpp.

◆ removeAll()

void rviz::ToolManager::removeAll ( )

Definition at line 79 of file tool_manager.cpp.

◆ removeTool()

void rviz::ToolManager::removeTool ( int  index)

Definition at line 271 of file tool_manager.cpp.

◆ save()

void rviz::ToolManager::save ( Config  config) const

Definition at line 105 of file tool_manager.cpp.

◆ setCurrentTool()

void rviz::ToolManager::setCurrentTool ( Tool tool)

Set the current tool. The current tool is given all mouse and keyboard events which VisualizationManager receives via handleMouseEvent() and handleChar().

See also
getCurrentTool()

Definition at line 172 of file tool_manager.cpp.

◆ setDefaultTool()

void rviz::ToolManager::setDefaultTool ( Tool tool)

Set the default tool.

The default tool is selected directly by pressing the Escape key. The default tool is indirectly selected when a Tool returns Finished in the bit field result of Tool::processMouseEvent(). This is how control moves from the InitialPoseTool back to MoveCamera when InitialPoseTool receives a left mouse button release event.

See also
getDefaultTool()

Definition at line 189 of file tool_manager.cpp.

◆ toKey()

bool rviz::ToolManager::toKey ( QString const &  str,
uint &  key_out 
)
private

Definition at line 113 of file tool_manager.cpp.

◆ toolAdded

void rviz::ToolManager::toolAdded ( Tool )
signal

Emitted by addTool() after the tool is added to the list of tools.

◆ toolChanged

void rviz::ToolManager::toolChanged ( Tool )
signal

Emitted by setCurrentTool() after the newly chosen tool is activated.

◆ toolRefreshed

void rviz::ToolManager::toolRefreshed ( Tool )
signal

Emitted by refreshTool() to gedraw the tool's icon in the toolbar'.

◆ toolRemoved

void rviz::ToolManager::toolRemoved ( Tool )
signal

◆ updatePropertyVisibility

void rviz::ToolManager::updatePropertyVisibility ( Property property)
privateslot

If property has children, it is added to the tool property tree, and if it does not, it is removed.

Definition at line 202 of file tool_manager.cpp.

Member Data Documentation

◆ context_

DisplayContext* rviz::ToolManager::context_
private

Definition at line 165 of file tool_manager.h.

◆ current_tool_

Tool* rviz::ToolManager::current_tool_
private

Definition at line 166 of file tool_manager.h.

◆ default_tool_

Tool* rviz::ToolManager::default_tool_
private

Definition at line 167 of file tool_manager.h.

◆ factory_

PluginlibFactory<Tool>* rviz::ToolManager::factory_
private

Definition at line 162 of file tool_manager.h.

◆ property_tree_model_

PropertyTreeModel* rviz::ToolManager::property_tree_model_
private

Definition at line 163 of file tool_manager.h.

◆ shortkey_to_tool_map_

std::map<int, Tool*> rviz::ToolManager::shortkey_to_tool_map_
private

Definition at line 168 of file tool_manager.h.

◆ tools_

QList<Tool*> rviz::ToolManager::tools_
private

Definition at line 164 of file tool_manager.h.


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


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Aug 2 2024 08:43:11