The main rviz window. More...
#include <visualization_frame.h>
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 PanelDockWidget * | addPane (const QString &name, QWidget *panel, Qt::DockWidgetArea area=Qt::LeftDockWidgetArea, bool floating=true) |
QString | getErrorMessage () const |
VisualizationManager * | getManager () |
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< PanelRecord > | custom_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_ |
WidgetGeometryChangeDetector * | geom_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. | |
VisualizationManager * | manager_ |
std::string | package_path_ |
PanelFactory * | panel_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_ |
RenderPanel * | render_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_ |
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.
typedef std::deque<std::string> rviz::VisualizationFrame::D_string [protected] |
Definition at line 300 of file visualization_frame.h.
rviz::VisualizationFrame::VisualizationFrame | ( | QWidget * | parent = 0 | ) |
Definition at line 107 of file visualization_frame.cpp.
Definition at line 150 of file visualization_frame.cpp.
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.
VisualizationManager* rviz::VisualizationFrame::getManager | ( | ) | [inline] |
Definition at line 100 of file visualization_frame.h.
QWidget * rviz::VisualizationFrame::getParentWindow | ( | ) | [virtual] |
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.
void rviz::VisualizationFrame::initConfigs | ( | ) | [protected] |
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.
void rviz::VisualizationFrame::initMenus | ( | ) | [protected] |
Definition at line 381 of file visualization_frame.cpp.
void rviz::VisualizationFrame::initToolbars | ( | ) | [protected] |
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().
config | Must have type Config::Map. |
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.
path | The 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.
void rviz::VisualizationFrame::onRecentConfigSelected | ( | ) | [protected, slot] |
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.
void rviz::VisualizationFrame::openNewPanelDialog | ( | ) | [protected, slot] |
Definition at line 505 of file visualization_frame.cpp.
void rviz::VisualizationFrame::openNewToolDialog | ( | ) | [protected, slot] |
Definition at line 526 of file visualization_frame.cpp.
bool rviz::VisualizationFrame::prepareToExit | ( | ) | [protected] |
Check for unsaved changes, prompt to save config, etc.
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().
config | The Config node to write into. |
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.
path | The full path of the config file to save into. |
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.
void rviz::VisualizationFrame::saveWindowGeometry | ( | Config | config | ) | [protected] |
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.
void rviz::VisualizationFrame::setDisplayConfigModified | ( | ) | [slot] |
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.
void rviz::VisualizationFrame::setHideButtonVisibility | ( | bool | visible | ) |
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.
void rviz::VisualizationFrame::setShowChooseNewMaster | ( | bool | show | ) |
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.
void rviz::VisualizationFrame::updateRecentConfigMenu | ( | ) | [protected] |
Definition at line 546 of file visualization_frame.cpp.
std::map<QAction*,Tool*> rviz::VisualizationFrame::action_to_tool_map_ [protected] |
Definition at line 304 of file visualization_frame.h.
QAction* rviz::VisualizationFrame::add_tool_action_ [protected] |
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.
QList<PanelRecord> rviz::VisualizationFrame::custom_panels_ [protected] |
Definition at line 321 of file visualization_frame.h.
std::string rviz::VisualizationFrame::default_display_config_file_ [protected] |
Definition at line 278 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::delete_view_menu_ [protected] |
Definition at line 286 of file visualization_frame.h.
std::string rviz::VisualizationFrame::display_config_file_ [protected] |
Definition at line 277 of file visualization_frame.h.
QString rviz::VisualizationFrame::error_message_ [protected] |
Error message (if any) from most recent saveDisplayConfig() call.
Definition at line 333 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::file_menu_ [protected] |
Definition at line 283 of file visualization_frame.h.
Definition at line 327 of file visualization_frame.h.
QString rviz::VisualizationFrame::help_path_ [protected] |
Definition at line 295 of file visualization_frame.h.
QToolButton* rviz::VisualizationFrame::hide_left_dock_button_ [protected] |
Definition at line 308 of file visualization_frame.h.
QToolButton* rviz::VisualizationFrame::hide_right_dock_button_ [protected] |
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.
bool rviz::VisualizationFrame::initialized_ [protected] |
Definition at line 326 of file visualization_frame.h.
std::string rviz::VisualizationFrame::last_config_dir_ [protected] |
Definition at line 279 of file visualization_frame.h.
std::string rviz::VisualizationFrame::last_image_dir_ [protected] |
Definition at line 280 of file visualization_frame.h.
bool rviz::VisualizationFrame::loading_ [protected] |
True just when loading a display config file, false all other times.
Definition at line 328 of file visualization_frame.h.
VisualizationManager* rviz::VisualizationFrame::manager_ [protected] |
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.
PanelFactory* rviz::VisualizationFrame::panel_factory_ [protected] |
Definition at line 311 of file visualization_frame.h.
std::string rviz::VisualizationFrame::persistent_settings_file_ [protected] |
Definition at line 276 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::plugins_menu_ [protected] |
Definition at line 287 of file visualization_frame.h.
QTimer* rviz::VisualizationFrame::post_load_timer_ [protected] |
Single-shot timer for calling postLoad() a short time after loadDisplayConfig() finishes.
Definition at line 329 of file visualization_frame.h.
D_string rviz::VisualizationFrame::recent_configs_ [protected] |
Definition at line 301 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::recent_configs_menu_ [protected] |
Definition at line 284 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::remove_tool_menu_ [protected] |
Definition at line 324 of file visualization_frame.h.
RenderPanel* rviz::VisualizationFrame::render_panel_ [protected] |
Definition at line 271 of file visualization_frame.h.
bool rviz::VisualizationFrame::show_choose_new_master_option_ [protected] |
Definition at line 306 of file visualization_frame.h.
QAction* rviz::VisualizationFrame::show_help_action_ [protected] |
Definition at line 273 of file visualization_frame.h.
QSplashScreen* rviz::VisualizationFrame::splash_ [protected] |
Definition at line 298 of file visualization_frame.h.
QString rviz::VisualizationFrame::splash_path_ [protected] |
Definition at line 296 of file visualization_frame.h.
QLabel* rviz::VisualizationFrame::status_label_ [protected] |
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.
QMenu* rviz::VisualizationFrame::view_menu_ [protected] |
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.