Classes | Public Slots | Signals | Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | Protected Attributes
rviz::VisualizationFrame Class Reference

The main rviz window. More...

#include <visualization_frame.h>

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

List of all members.

Classes

struct  PanelRecord

Public Slots

void setDisplayConfigModified ()
 Call this to let the frame know that something that would get saved in the display config has changed.
virtual void setStatus (const QString &message)

Signals

void statusUpdate (const QString &message)
 Emitted during file-loading and initialization to indicate progress.

Public Member Functions

virtual PanelDockWidgetaddPane (const QString &name, QWidget *panel, Qt::DockWidgetArea area=Qt::LeftDockWidgetArea, bool floating=true)
QString getErrorMessage () const
VisualizationManagergetManager ()
virtual QWidget * getParentWindow ()
void initialize (const QString &display_config_file="")
 Initialize the visualizer. Creates the VisualizationManager.
virtual void load (const Config &config)
 Load the properties of all subsystems from the given Config.
void loadDisplayConfig (const QString &path)
 Load display and other settings from the given file.
void loadPersistentSettings ()
 Load the "general" config file, which has just the few things which should not be saved with a display config.
virtual void save (Config config)
 Save the properties of each subsystem and most editable rviz data.
bool saveDisplayConfig (const QString &path)
 Save display and other settings to the given file.
void savePersistentSettings ()
 Save the "general" config file, which has just the few things which should not be saved with a display config.
void setHelpPath (const QString &help_path)
 Set the path to the help file. Should contain HTML. Default is a file in the RViz package.
void setHideButtonVisibility (bool visible)
 Hide or show the hide-dock buttons.
void setShowChooseNewMaster (bool show)
 Call this before initialize() to have it take effect.
void setSplashPath (const QString &splash_path)
 Set the path to the "splash" image file. This image is shown during initialization and loading of the first config file. Default is a file in the RViz package. To prevent splash image from showing, set this to an empty string.
 VisualizationFrame (QWidget *parent=0)
 ~VisualizationFrame ()

Protected Types

typedef std::deque< std::string > D_string

Protected Slots

void addTool (Tool *tool)
 Add the given tool to this frame's toolbar.
void changeMaster ()
 Save the current state and quit with exit code 255 to signal the wrapper that we would like to restart with a different ROS master URI.
void hideLeftDock (bool hide)
void hideRightDock (bool hide)
void indicateToolIsCurrent (Tool *tool)
 Mark the given tool as the current one.
void markLoadingDone ()
 Set loading_ to false.
void onDeletePanel ()
 Delete a panel widget.
virtual void onDockPanelVisibilityChange (bool visible)
void onHelpDestroyed ()
void onHelpWiki ()
void onOpen ()
void onRecentConfigSelected ()
void onSave ()
void onSaveAs ()
void onSaveImage ()
void onToolbarActionTriggered (QAction *action)
 Looks up the Tool for this action and calls VisualizationManager::setCurrentTool().
void onToolbarRemoveTool (QAction *remove_tool_menu_action)
 Remove a the tool whose name is given by remove_tool_menu_action->text().
void openNewPanelDialog ()
void openNewToolDialog ()
void removeTool (Tool *tool)
 Remove the given tool from the frame's toolbar.
void reset ()
void setImageSaveDirectory (const QString &directory)
 Set the default directory in which to save screenshot images.
void showHelpPanel ()

Protected Member Functions

QDockWidget * addPanelByName (const QString &name, const QString &class_lookup_name, Qt::DockWidgetArea area=Qt::LeftDockWidgetArea, bool floating=true)
virtual void closeEvent (QCloseEvent *event)
void hideDockImpl (Qt::DockWidgetArea area, bool hide)
void initConfigs ()
 Initialize the default config directory (~/.rviz) and set up the persistent_settings_file_ and display_config_file_ variables.
void initMenus ()
void initToolbars ()
virtual void leaveEvent (QEvent *event)
void loadPanels (const Config &config)
 Loads custom panels from the given config node.
void loadWindowGeometry (const Config &config)
void markRecentConfig (const std::string &path)
bool prepareToExit ()
 Check for unsaved changes, prompt to save config, etc.
void savePanels (Config config)
 Saves custom panels to the given config node.
void saveWindowGeometry (Config config)
void setDisplayConfigFile (const std::string &path)
 Set the display config file path.
void updateRecentConfigMenu ()

Protected Attributes

std::map< QAction *, Tool * > action_to_tool_map_
QAction * add_tool_action_
std::string config_dir_
QList< PanelRecordcustom_panels_
std::string default_display_config_file_
QMenu * delete_view_menu_
std::string display_config_file_
QString error_message_
 Error message (if any) from most recent saveDisplayConfig() call.
QMenu * file_menu_
WidgetGeometryChangeDetectorgeom_change_detector_
QString help_path_
QToolButton * hide_left_dock_button_
QToolButton * hide_right_dock_button_
std::string home_dir_
bool initialized_
std::string last_config_dir_
std::string last_image_dir_
bool loading_
 True just when loading a display config file, false all other times.
VisualizationManagermanager_
std::string package_path_
PanelFactorypanel_factory_
std::string persistent_settings_file_
QMenu * plugins_menu_
QTimer * post_load_timer_
 Single-shot timer for calling postLoad() a short time after loadDisplayConfig() finishes.
D_string recent_configs_
QMenu * recent_configs_menu_
QMenu * remove_tool_menu_
RenderPanelrender_panel_
bool show_choose_new_master_option_
QAction * show_help_action_
QSplashScreen * splash_
QString splash_path_
QLabel * status_label_
std::map< Tool *, QAction * > tool_to_action_map_
QToolBar * toolbar_
QActionGroup * toolbar_actions_
QMenu * view_menu_
QList< QAction * > view_menu_actions_

Detailed Description

The main rviz window.

VisualizationFrame is a QMainWindow, which means it has a center area and a bunch of dock areas around it. The central widget here is a RenderPanel, and around it (by default) are a DisplaysPanel, ViewsPanel, TimePanel, SelectionPanel, and ToolPropertiesPanel. At the top is a toolbar with "Move Camera", "Select", etc. There is also a menu bar with file/open, etc.

Definition at line 69 of file visualization_frame.h.


Member Typedef Documentation

typedef std::deque<std::string> rviz::VisualizationFrame::D_string [protected]

Definition at line 300 of file visualization_frame.h.


Constructor & Destructor Documentation

Definition at line 107 of file visualization_frame.cpp.

Definition at line 150 of file visualization_frame.cpp.


Member Function Documentation

PanelDockWidget * rviz::VisualizationFrame::addPane ( const QString &  name,
QWidget *  pane,
Qt::DockWidgetArea  area = Qt::LeftDockWidgetArea,
bool  floating = true 
) [virtual]

Add a pane to the visualizer. To remove a pane, just delete it. For example: "delete my_panel_dock_widget;". Other operations can also be done directly to the PanelDockWidget: show(), hide(), close(), etc.

Implements rviz::WindowManagerInterface.

Definition at line 1148 of file visualization_frame.cpp.

QDockWidget * rviz::VisualizationFrame::addPanelByName ( const QString &  name,
const QString &  class_lookup_name,
Qt::DockWidgetArea  area = Qt::LeftDockWidgetArea,
bool  floating = true 
) [protected]

Definition at line 1119 of file visualization_frame.cpp.

void rviz::VisualizationFrame::addTool ( Tool tool) [protected, slot]

Add the given tool to this frame's toolbar.

This creates a QAction internally which listens for the Tool's shortcut key. When the action is triggered by the toolbar or by the shortcut key, onToolbarActionTriggered() is called.

Definition at line 989 of file visualization_frame.cpp.

void rviz::VisualizationFrame::changeMaster ( ) [protected, slot]

Save the current state and quit with exit code 255 to signal the wrapper that we would like to restart with a different ROS master URI.

Definition at line 190 of file visualization_frame.cpp.

void rviz::VisualizationFrame::closeEvent ( QCloseEvent *  event) [protected, virtual]

Definition at line 167 of file visualization_frame.cpp.

QString rviz::VisualizationFrame::getErrorMessage ( ) const [inline]

Definition at line 133 of file visualization_frame.h.

Definition at line 100 of file visualization_frame.h.

Implements rviz::WindowManagerInterface.

Definition at line 1086 of file visualization_frame.cpp.

void rviz::VisualizationFrame::hideDockImpl ( Qt::DockWidgetArea  area,
bool  hide 
) [protected]

Definition at line 441 of file visualization_frame.cpp.

void rviz::VisualizationFrame::hideLeftDock ( bool  hide) [protected, slot]

Definition at line 470 of file visualization_frame.cpp.

void rviz::VisualizationFrame::hideRightDock ( bool  hide) [protected, slot]

Definition at line 476 of file visualization_frame.cpp.

void rviz::VisualizationFrame::indicateToolIsCurrent ( Tool tool) [protected, slot]

Mark the given tool as the current one.

This is purely a visual change in the GUI, it does not call any tool functions.

Definition at line 1049 of file visualization_frame.cpp.

Initialize the default config directory (~/.rviz) and set up the persistent_settings_file_ and display_config_file_ variables.

Definition at line 310 of file visualization_frame.cpp.

void rviz::VisualizationFrame::initialize ( const QString &  display_config_file = "")

Initialize the visualizer. Creates the VisualizationManager.

This function must be called before load(), save(), getManager(), or addPanelByName(), since it creates the VisualizationManager instance which those calls depend on.

This function also calls VisualizationManager::initialize(), which means it will start the update timer and generally get things rolling.

Definition at line 214 of file visualization_frame.cpp.

Definition at line 381 of file visualization_frame.cpp.

Definition at line 408 of file visualization_frame.cpp.

void rviz::VisualizationFrame::leaveEvent ( QEvent *  event) [protected, virtual]

Definition at line 179 of file visualization_frame.cpp.

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

Load the properties of all subsystems from the given Config.

This is called by loadDisplayConfig().

Parameters:
configMust have type Config::Map.
See also:
save()

Definition at line 706 of file visualization_frame.cpp.

void rviz::VisualizationFrame::loadDisplayConfig ( const QString &  path)

Load display and other settings from the given file.

Parameters:
pathThe full path of the config file to load from.

Definition at line 592 of file visualization_frame.cpp.

void rviz::VisualizationFrame::loadPanels ( const Config config) [protected]

Loads custom panels from the given config node.

Definition at line 779 of file visualization_frame.cpp.

Load the "general" config file, which has just the few things which should not be saved with a display config.

Loads from the file named in persistent_settings_file_.

Definition at line 332 of file visualization_frame.cpp.

void rviz::VisualizationFrame::loadWindowGeometry ( const Config config) [protected]

Definition at line 713 of file visualization_frame.cpp.

void rviz::VisualizationFrame::markLoadingDone ( ) [protected, slot]

Set loading_ to false.

Definition at line 643 of file visualization_frame.cpp.

void rviz::VisualizationFrame::markRecentConfig ( const std::string &  path) [protected]

Definition at line 574 of file visualization_frame.cpp.

void rviz::VisualizationFrame::onDeletePanel ( ) [protected, slot]

Delete a panel widget.

The sender() of the signal should be a QAction whose text() is the name of the panel.

Definition at line 1091 of file visualization_frame.cpp.

void rviz::VisualizationFrame::onDockPanelVisibilityChange ( bool  visible) [protected, virtual, slot]

Definition at line 482 of file visualization_frame.cpp.

void rviz::VisualizationFrame::onHelpDestroyed ( ) [protected, slot]

Definition at line 1076 of file visualization_frame.cpp.

void rviz::VisualizationFrame::onHelpWiki ( ) [protected, slot]

Definition at line 1081 of file visualization_frame.cpp.

void rviz::VisualizationFrame::onOpen ( ) [protected, slot]

Definition at line 884 of file visualization_frame.cpp.

Definition at line 969 of file visualization_frame.cpp.

void rviz::VisualizationFrame::onSave ( ) [protected, slot]

Definition at line 907 of file visualization_frame.cpp.

void rviz::VisualizationFrame::onSaveAs ( ) [protected, slot]

Definition at line 933 of file visualization_frame.cpp.

void rviz::VisualizationFrame::onSaveImage ( ) [protected, slot]

Definition at line 961 of file visualization_frame.cpp.

void rviz::VisualizationFrame::onToolbarActionTriggered ( QAction *  action) [protected, slot]

Looks up the Tool for this action and calls VisualizationManager::setCurrentTool().

Definition at line 1003 of file visualization_frame.cpp.

void rviz::VisualizationFrame::onToolbarRemoveTool ( QAction *  remove_tool_menu_action) [protected, slot]

Remove a the tool whose name is given by remove_tool_menu_action->text().

Definition at line 1012 of file visualization_frame.cpp.

Definition at line 505 of file visualization_frame.cpp.

void rviz::VisualizationFrame::openNewToolDialog ( ) [protected, slot]

Definition at line 526 of file visualization_frame.cpp.

Check for unsaved changes, prompt to save config, etc.

Returns:
true if it is OK to exit, false if not.

Definition at line 825 of file visualization_frame.cpp.

void rviz::VisualizationFrame::removeTool ( Tool tool) [protected, slot]

Remove the given tool from the frame's toolbar.

Definition at line 1026 of file visualization_frame.cpp.

void rviz::VisualizationFrame::reset ( ) [protected, slot]

Definition at line 184 of file visualization_frame.cpp.

void rviz::VisualizationFrame::save ( Config  config) [virtual]

Save the properties of each subsystem and most editable rviz data.

This is called by saveDisplayConfig().

Parameters:
configThe Config node to write into.
See also:
load()

Definition at line 699 of file visualization_frame.cpp.

bool rviz::VisualizationFrame::saveDisplayConfig ( const QString &  path)

Save display and other settings to the given file.

Parameters:
pathThe full path of the config file to save into.
Returns:
True on success, False on failure.

On failure, also sets error_message_ with information about the problem. Can be retrieved with getErrorMessage().

Definition at line 677 of file visualization_frame.cpp.

void rviz::VisualizationFrame::savePanels ( Config  config) [protected]

Saves custom panels to the given config node.

Definition at line 815 of file visualization_frame.cpp.

Save the "general" config file, which has just the few things which should not be saved with a display config.

Saves to the file named in persistent_settings_file_.

Definition at line 361 of file visualization_frame.cpp.

Definition at line 757 of file visualization_frame.cpp.

void rviz::VisualizationFrame::setDisplayConfigFile ( const std::string &  path) [protected]

Set the display config file path.

This does not load the given file, it just sets the member variable and updates the window title.

Definition at line 661 of file visualization_frame.cpp.

Call this to let the frame know that something that would get saved in the display config has changed.

Definition at line 653 of file visualization_frame.cpp.

void rviz::VisualizationFrame::setHelpPath ( const QString &  help_path)

Set the path to the help file. Should contain HTML. Default is a file in the RViz package.

Definition at line 203 of file visualization_frame.cpp.

Hide or show the hide-dock buttons.

Definition at line 464 of file visualization_frame.cpp.

void rviz::VisualizationFrame::setImageSaveDirectory ( const QString &  directory) [protected, slot]

Set the default directory in which to save screenshot images.

Definition at line 648 of file visualization_frame.cpp.

Call this before initialize() to have it take effect.

Definition at line 198 of file visualization_frame.cpp.

void rviz::VisualizationFrame::setSplashPath ( const QString &  splash_path)

Set the path to the "splash" image file. This image is shown during initialization and loading of the first config file. Default is a file in the RViz package. To prevent splash image from showing, set this to an empty string.

Definition at line 209 of file visualization_frame.cpp.

void rviz::VisualizationFrame::setStatus ( const QString &  message) [virtual, slot]

Set the message displayed in the status bar

Implements rviz::WindowManagerInterface.

Definition at line 162 of file visualization_frame.cpp.

void rviz::VisualizationFrame::showHelpPanel ( ) [protected, slot]

Definition at line 1058 of file visualization_frame.cpp.

void rviz::VisualizationFrame::statusUpdate ( const QString &  message) [signal]

Emitted during file-loading and initialization to indicate progress.

Definition at line 546 of file visualization_frame.cpp.


Member Data Documentation

std::map<QAction*,Tool*> rviz::VisualizationFrame::action_to_tool_map_ [protected]

Definition at line 304 of file visualization_frame.h.

Definition at line 323 of file visualization_frame.h.

std::string rviz::VisualizationFrame::config_dir_ [protected]

Definition at line 275 of file visualization_frame.h.

Definition at line 321 of file visualization_frame.h.

Definition at line 278 of file visualization_frame.h.

Definition at line 286 of file visualization_frame.h.

Definition at line 277 of file visualization_frame.h.

Error message (if any) from most recent saveDisplayConfig() call.

Definition at line 333 of file visualization_frame.h.

Definition at line 283 of file visualization_frame.h.

Definition at line 327 of file visualization_frame.h.

Definition at line 295 of file visualization_frame.h.

Definition at line 308 of file visualization_frame.h.

Definition at line 309 of file visualization_frame.h.

std::string rviz::VisualizationFrame::home_dir_ [protected]

Definition at line 281 of file visualization_frame.h.

Definition at line 326 of file visualization_frame.h.

Definition at line 279 of file visualization_frame.h.

Definition at line 280 of file visualization_frame.h.

True just when loading a display config file, false all other times.

Definition at line 328 of file visualization_frame.h.

Definition at line 292 of file visualization_frame.h.

std::string rviz::VisualizationFrame::package_path_ [protected]

Definition at line 294 of file visualization_frame.h.

Definition at line 311 of file visualization_frame.h.

Definition at line 276 of file visualization_frame.h.

Definition at line 287 of file visualization_frame.h.

Single-shot timer for calling postLoad() a short time after loadDisplayConfig() finishes.

Definition at line 329 of file visualization_frame.h.

Definition at line 301 of file visualization_frame.h.

Definition at line 284 of file visualization_frame.h.

Definition at line 324 of file visualization_frame.h.

Definition at line 271 of file visualization_frame.h.

Definition at line 306 of file visualization_frame.h.

Definition at line 273 of file visualization_frame.h.

QSplashScreen* rviz::VisualizationFrame::splash_ [protected]

Definition at line 298 of file visualization_frame.h.

Definition at line 296 of file visualization_frame.h.

Definition at line 331 of file visualization_frame.h.

std::map<Tool*,QAction*> rviz::VisualizationFrame::tool_to_action_map_ [protected]

Definition at line 305 of file visualization_frame.h.

QToolBar* rviz::VisualizationFrame::toolbar_ [protected]

Definition at line 290 of file visualization_frame.h.

QActionGroup* rviz::VisualizationFrame::toolbar_actions_ [protected]

Definition at line 303 of file visualization_frame.h.

Definition at line 285 of file visualization_frame.h.

QList<QAction*> rviz::VisualizationFrame::view_menu_actions_ [protected]

Definition at line 288 of file visualization_frame.h.


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


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Mon Oct 6 2014 07:26:37