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 () |
void | updateFps () |
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_ |
QLabel * | fps_label_ |
int | frame_count_ |
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_ |
ros::WallTime | last_fps_calc_time_ |
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 71 of file visualization_frame.h.
typedef std::deque<std::string> rviz::VisualizationFrame::D_string [protected] |
Definition at line 304 of file visualization_frame.h.
rviz::VisualizationFrame::VisualizationFrame | ( | QWidget * | parent = 0 | ) |
Definition at line 107 of file visualization_frame.cpp.
Definition at line 156 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 1170 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 1141 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 1011 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 211 of file visualization_frame.cpp.
void rviz::VisualizationFrame::closeEvent | ( | QCloseEvent * | event | ) | [protected, virtual] |
Definition at line 188 of file visualization_frame.cpp.
QString rviz::VisualizationFrame::getErrorMessage | ( | ) | const [inline] |
Definition at line 135 of file visualization_frame.h.
VisualizationManager* rviz::VisualizationFrame::getManager | ( | ) | [inline] |
Definition at line 102 of file visualization_frame.h.
QWidget * rviz::VisualizationFrame::getParentWindow | ( | ) | [virtual] |
Implements rviz::WindowManagerInterface.
Definition at line 1108 of file visualization_frame.cpp.
void rviz::VisualizationFrame::hideDockImpl | ( | Qt::DockWidgetArea | area, |
bool | hide | ||
) | [protected] |
Definition at line 463 of file visualization_frame.cpp.
void rviz::VisualizationFrame::hideLeftDock | ( | bool | hide | ) | [protected, slot] |
Definition at line 492 of file visualization_frame.cpp.
void rviz::VisualizationFrame::hideRightDock | ( | bool | hide | ) | [protected, slot] |
Definition at line 498 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 1071 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 332 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 235 of file visualization_frame.cpp.
void rviz::VisualizationFrame::initMenus | ( | ) | [protected] |
Definition at line 403 of file visualization_frame.cpp.
void rviz::VisualizationFrame::initToolbars | ( | ) | [protected] |
Definition at line 430 of file visualization_frame.cpp.
void rviz::VisualizationFrame::leaveEvent | ( | QEvent * | event | ) | [protected, virtual] |
Definition at line 200 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 728 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 614 of file visualization_frame.cpp.
void rviz::VisualizationFrame::loadPanels | ( | const Config & | config | ) | [protected] |
Loads custom panels from the given config node.
Definition at line 801 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 354 of file visualization_frame.cpp.
void rviz::VisualizationFrame::loadWindowGeometry | ( | const Config & | config | ) | [protected] |
Definition at line 735 of file visualization_frame.cpp.
void rviz::VisualizationFrame::markLoadingDone | ( | ) | [protected, slot] |
Set loading_ to false.
Definition at line 665 of file visualization_frame.cpp.
void rviz::VisualizationFrame::markRecentConfig | ( | const std::string & | path | ) | [protected] |
Definition at line 596 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 1113 of file visualization_frame.cpp.
void rviz::VisualizationFrame::onDockPanelVisibilityChange | ( | bool | visible | ) | [protected, virtual, slot] |
Definition at line 504 of file visualization_frame.cpp.
void rviz::VisualizationFrame::onHelpDestroyed | ( | ) | [protected, slot] |
Definition at line 1098 of file visualization_frame.cpp.
void rviz::VisualizationFrame::onHelpWiki | ( | ) | [protected, slot] |
Definition at line 1103 of file visualization_frame.cpp.
void rviz::VisualizationFrame::onOpen | ( | ) | [protected, slot] |
Definition at line 906 of file visualization_frame.cpp.
void rviz::VisualizationFrame::onRecentConfigSelected | ( | ) | [protected, slot] |
Definition at line 991 of file visualization_frame.cpp.
void rviz::VisualizationFrame::onSave | ( | ) | [protected, slot] |
Definition at line 929 of file visualization_frame.cpp.
void rviz::VisualizationFrame::onSaveAs | ( | ) | [protected, slot] |
Definition at line 955 of file visualization_frame.cpp.
void rviz::VisualizationFrame::onSaveImage | ( | ) | [protected, slot] |
Definition at line 983 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 1025 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 1034 of file visualization_frame.cpp.
void rviz::VisualizationFrame::openNewPanelDialog | ( | ) | [protected, slot] |
Definition at line 527 of file visualization_frame.cpp.
void rviz::VisualizationFrame::openNewToolDialog | ( | ) | [protected, slot] |
Definition at line 548 of file visualization_frame.cpp.
bool rviz::VisualizationFrame::prepareToExit | ( | ) | [protected] |
Check for unsaved changes, prompt to save config, etc.
Definition at line 847 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 1048 of file visualization_frame.cpp.
void rviz::VisualizationFrame::reset | ( | ) | [protected, slot] |
Definition at line 205 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 721 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 699 of file visualization_frame.cpp.
void rviz::VisualizationFrame::savePanels | ( | Config | config | ) | [protected] |
Saves custom panels to the given config node.
Definition at line 837 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 383 of file visualization_frame.cpp.
void rviz::VisualizationFrame::saveWindowGeometry | ( | Config | config | ) | [protected] |
Definition at line 779 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 683 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 675 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 224 of file visualization_frame.cpp.
void rviz::VisualizationFrame::setHideButtonVisibility | ( | bool | visible | ) |
Hide or show the hide-dock buttons.
Definition at line 486 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 670 of file visualization_frame.cpp.
void rviz::VisualizationFrame::setShowChooseNewMaster | ( | bool | show | ) |
Call this before initialize() to have it take effect.
Definition at line 219 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 230 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 169 of file visualization_frame.cpp.
void rviz::VisualizationFrame::showHelpPanel | ( | ) | [protected, slot] |
Definition at line 1080 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::updateFps | ( | ) | [protected, slot] |
Definition at line 174 of file visualization_frame.cpp.
void rviz::VisualizationFrame::updateRecentConfigMenu | ( | ) | [protected] |
Definition at line 568 of file visualization_frame.cpp.
std::map<QAction*,Tool*> rviz::VisualizationFrame::action_to_tool_map_ [protected] |
Definition at line 308 of file visualization_frame.h.
QAction* rviz::VisualizationFrame::add_tool_action_ [protected] |
Definition at line 327 of file visualization_frame.h.
std::string rviz::VisualizationFrame::config_dir_ [protected] |
Definition at line 279 of file visualization_frame.h.
QList<PanelRecord> rviz::VisualizationFrame::custom_panels_ [protected] |
Definition at line 325 of file visualization_frame.h.
std::string rviz::VisualizationFrame::default_display_config_file_ [protected] |
Definition at line 282 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::delete_view_menu_ [protected] |
Definition at line 290 of file visualization_frame.h.
std::string rviz::VisualizationFrame::display_config_file_ [protected] |
Definition at line 281 of file visualization_frame.h.
QString rviz::VisualizationFrame::error_message_ [protected] |
Error message (if any) from most recent saveDisplayConfig() call.
Definition at line 341 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::file_menu_ [protected] |
Definition at line 287 of file visualization_frame.h.
QLabel* rviz::VisualizationFrame::fps_label_ [protected] |
Definition at line 336 of file visualization_frame.h.
int rviz::VisualizationFrame::frame_count_ [protected] |
Definition at line 338 of file visualization_frame.h.
Definition at line 331 of file visualization_frame.h.
QString rviz::VisualizationFrame::help_path_ [protected] |
Definition at line 299 of file visualization_frame.h.
QToolButton* rviz::VisualizationFrame::hide_left_dock_button_ [protected] |
Definition at line 312 of file visualization_frame.h.
QToolButton* rviz::VisualizationFrame::hide_right_dock_button_ [protected] |
Definition at line 313 of file visualization_frame.h.
std::string rviz::VisualizationFrame::home_dir_ [protected] |
Definition at line 285 of file visualization_frame.h.
bool rviz::VisualizationFrame::initialized_ [protected] |
Definition at line 330 of file visualization_frame.h.
std::string rviz::VisualizationFrame::last_config_dir_ [protected] |
Definition at line 283 of file visualization_frame.h.
Definition at line 339 of file visualization_frame.h.
std::string rviz::VisualizationFrame::last_image_dir_ [protected] |
Definition at line 284 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 332 of file visualization_frame.h.
VisualizationManager* rviz::VisualizationFrame::manager_ [protected] |
Definition at line 296 of file visualization_frame.h.
std::string rviz::VisualizationFrame::package_path_ [protected] |
Definition at line 298 of file visualization_frame.h.
PanelFactory* rviz::VisualizationFrame::panel_factory_ [protected] |
Definition at line 315 of file visualization_frame.h.
std::string rviz::VisualizationFrame::persistent_settings_file_ [protected] |
Definition at line 280 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::plugins_menu_ [protected] |
Definition at line 291 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 333 of file visualization_frame.h.
D_string rviz::VisualizationFrame::recent_configs_ [protected] |
Definition at line 305 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::recent_configs_menu_ [protected] |
Definition at line 288 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::remove_tool_menu_ [protected] |
Definition at line 328 of file visualization_frame.h.
RenderPanel* rviz::VisualizationFrame::render_panel_ [protected] |
Definition at line 275 of file visualization_frame.h.
bool rviz::VisualizationFrame::show_choose_new_master_option_ [protected] |
Definition at line 310 of file visualization_frame.h.
QAction* rviz::VisualizationFrame::show_help_action_ [protected] |
Definition at line 277 of file visualization_frame.h.
QSplashScreen* rviz::VisualizationFrame::splash_ [protected] |
Definition at line 302 of file visualization_frame.h.
QString rviz::VisualizationFrame::splash_path_ [protected] |
Definition at line 300 of file visualization_frame.h.
QLabel* rviz::VisualizationFrame::status_label_ [protected] |
Definition at line 335 of file visualization_frame.h.
std::map<Tool*,QAction*> rviz::VisualizationFrame::tool_to_action_map_ [protected] |
Definition at line 309 of file visualization_frame.h.
QToolBar* rviz::VisualizationFrame::toolbar_ [protected] |
Definition at line 294 of file visualization_frame.h.
QActionGroup* rviz::VisualizationFrame::toolbar_actions_ [protected] |
Definition at line 307 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::view_menu_ [protected] |
Definition at line 289 of file visualization_frame.h.
QList<QAction*> rviz::VisualizationFrame::view_menu_actions_ [protected] |
Definition at line 292 of file visualization_frame.h.