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. | |
Public Member Functions | |
virtual PanelDockWidget * | addPane (const std::string &name, QWidget *panel, Qt::DockWidgetArea area=Qt::LeftDockWidgetArea, bool floating=true) |
VisualizationManager * | getManager () |
virtual QWidget * | getParentWindow () |
void | initialize (const std::string &display_config_file="", const std::string &fixed_frame="", const std::string &target_frame="", const std::string &splash_path="", const std::string &help_path="", bool verbose=false, bool show_choose_new_master_option=false) |
VisualizationFrame (QWidget *parent=0) | |
~VisualizationFrame () | |
Protected Types | |
typedef std::deque< std::string > | D_string |
typedef std::map< std::string, PanelRecord > | M_PanelRecord |
typedef std::set< std::string > | S_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 | indicateToolIsCurrent (Tool *tool) |
Mark the given tool as the current one. | |
void | markLoadingDone () |
Set loading_ to false. | |
void | onDeletePanel () |
Delete a panel widget. | |
void | onHelpWiki () |
void | onOpen () |
void | onPanelRemoved (QObject *panel) |
Remove the given panel's name from the list of current panel names. | |
void | onRecentConfigSelected () |
void | onSaveImage () |
void | onToolbarActionTriggered (QAction *action) |
Looks up the Tool for this action and calls VisualizationManager::setCurrentTool(). | |
void | openNewPanelDialog () |
void | save () |
void | saveAs () |
void | setImageSaveDirectory (const QString &directory) |
Set the default directory in which to save screenshot images. | |
void | showHelpPanel () |
Protected Member Functions | |
PanelDockWidget * | addCustomPanel (const std::string &name, const std::string &class_lookup_name, Qt::DockWidgetArea area=Qt::LeftDockWidgetArea, bool floating=true) |
virtual void | closeEvent (QCloseEvent *event) |
QString | getErrorMessage () const |
QRect | hackedFrameGeometry () |
void | initConfigs (const std::string &display_config_file_override) |
Initialize the default config directory (~/.rviz) and set up the general_config_file_ and display_config_file_ variables. | |
void | initMenus () |
void | loadCustomPanels (const boost::shared_ptr< Config > &config) |
void | loadDisplayConfig (const std::string &path) |
Load display and other settings from the given file. | |
void | loadGeneralConfig () |
Load the "general" config file, which has just the few things which should not be saved with a display config. | |
void | loadWindowGeometry (const boost::shared_ptr< Config > &config) |
void | markRecentConfig (const std::string &path) |
virtual void | moveEvent (QMoveEvent *event) |
bool | prepareToExit () |
Check for unsaved changes, prompt to save config, etc. | |
void | saveCustomPanels (const boost::shared_ptr< Config > &config) |
bool | saveDisplayConfig (const std::string &path) |
Save display and other settings to the given file. | |
void | saveGeneralConfig () |
Save the "general" config file, which has just the few things which should not be saved with a display config. | |
void | saveWindowGeometry (const boost::shared_ptr< Config > &config) |
void | setDisplayConfigFile (const std::string &path) |
Set the display config file path. | |
void | setSplashStatus (const std::string &status) |
void | updateRecentConfigMenu () |
Protected Attributes | |
std::map< QAction *, Tool * > | action_to_tool_map_ |
std::string | config_dir_ |
M_PanelRecord | custom_panels_ |
std::string | default_display_config_file_ |
QMenu * | delete_view_menu_ |
std::string | display_config_file_ |
DisplaysPanel * | displays_panel_ |
QString | error_message_ |
Error message (if any) from most recent saveDisplayConfig() call. | |
QMenu * | file_menu_ |
QPoint | first_position_ |
std::string | general_config_file_ |
WidgetGeometryChangeDetector * | geom_change_detector_ |
HelpPanel * | help_panel_ |
std::string | help_path_ |
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_ |
int | num_move_events_ |
std::string | package_path_ |
pluginlib::ClassLoader< Panel > * | panel_class_loader_ |
S_string | panel_names_ |
QMenu * | plugins_menu_ |
QPoint | position_correction_ |
QTimer * | post_load_timer_ |
Single-shot timer for calling postLoad() a short time after loadDisplayConfig() finishes. | |
D_string | recent_configs_ |
QMenu * | recent_configs_menu_ |
RenderPanel * | render_panel_ |
SelectionPanel * | selection_panel_ |
bool | show_choose_new_master_option_ |
QAction * | show_help_action_ |
QSplashScreen * | splash_ |
TimePanel * | time_panel_ |
ToolPropertiesPanel * | tool_properties_panel_ |
std::map< Tool *, QAction * > | tool_to_action_map_ |
QToolBar * | toolbar_ |
QActionGroup * | toolbar_actions_ |
QMenu * | view_menu_ |
QList< QAction * > | view_menu_actions_ |
ViewsPanel * | views_panel_ |
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 76 of file visualization_frame.h.
typedef std::deque<std::string> rviz::VisualizationFrame::D_string [protected] |
Definition at line 254 of file visualization_frame.h.
typedef std::map<std::string, PanelRecord> rviz::VisualizationFrame::M_PanelRecord [protected] |
Definition at line 277 of file visualization_frame.h.
typedef std::set<std::string> rviz::VisualizationFrame::S_string [protected] |
Definition at line 265 of file visualization_frame.h.
rviz::VisualizationFrame::VisualizationFrame | ( | QWidget * | parent = 0 | ) |
Definition at line 110 of file visualization_frame.cpp.
Definition at line 141 of file visualization_frame.cpp.
PanelDockWidget * rviz::VisualizationFrame::addCustomPanel | ( | const std::string & | name, |
const std::string & | class_lookup_name, | ||
Qt::DockWidgetArea | area = Qt::LeftDockWidgetArea , |
||
bool | floating = true |
||
) | [protected] |
Definition at line 917 of file visualization_frame.cpp.
PanelDockWidget * rviz::VisualizationFrame::addPane | ( | const std::string & | 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 947 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 839 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 172 of file visualization_frame.cpp.
void rviz::VisualizationFrame::closeEvent | ( | QCloseEvent * | event | ) | [protected, virtual] |
Definition at line 160 of file visualization_frame.cpp.
QString rviz::VisualizationFrame::getErrorMessage | ( | ) | const [inline, protected] |
Definition at line 212 of file visualization_frame.h.
VisualizationManager* rviz::VisualizationFrame::getManager | ( | ) | [inline] |
Definition at line 91 of file visualization_frame.h.
QWidget * rviz::VisualizationFrame::getParentWindow | ( | ) | [virtual] |
Implements rviz::WindowManagerInterface.
Definition at line 891 of file visualization_frame.cpp.
QRect rviz::VisualizationFrame::hackedFrameGeometry | ( | ) | [protected] |
Definition at line 661 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 858 of file visualization_frame.cpp.
void rviz::VisualizationFrame::initConfigs | ( | const std::string & | display_config_file_override | ) | [protected] |
Initialize the default config directory (~/.rviz) and set up the general_config_file_ and display_config_file_ variables.
display_config_file_override | The display config file passed in to initialize(). |
Definition at line 282 of file visualization_frame.cpp.
void rviz::VisualizationFrame::initialize | ( | const std::string & | display_config_file = "" , |
const std::string & | fixed_frame = "" , |
||
const std::string & | target_frame = "" , |
||
const std::string & | splash_path = "" , |
||
const std::string & | help_path = "" , |
||
bool | verbose = false , |
||
bool | show_choose_new_master_option = false |
||
) |
Definition at line 185 of file visualization_frame.cpp.
void rviz::VisualizationFrame::initMenus | ( | ) | [protected] |
Definition at line 359 of file visualization_frame.cpp.
void rviz::VisualizationFrame::loadCustomPanels | ( | const boost::shared_ptr< Config > & | config | ) | [protected] |
Definition at line 566 of file visualization_frame.cpp.
void rviz::VisualizationFrame::loadDisplayConfig | ( | const std::string & | path | ) | [protected] |
Load display and other settings from the given file.
path | The full path of the config file to load from. |
Definition at line 455 of file visualization_frame.cpp.
void rviz::VisualizationFrame::loadGeneralConfig | ( | ) | [protected] |
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 general_config_file_.
Definition at line 319 of file visualization_frame.cpp.
void rviz::VisualizationFrame::loadWindowGeometry | ( | const boost::shared_ptr< Config > & | config | ) | [protected] |
Definition at line 668 of file visualization_frame.cpp.
void rviz::VisualizationFrame::markLoadingDone | ( | ) | [protected, slot] |
Set loading_ to false.
Definition at line 509 of file visualization_frame.cpp.
void rviz::VisualizationFrame::markRecentConfig | ( | const std::string & | path | ) | [protected] |
Definition at line 437 of file visualization_frame.cpp.
void rviz::VisualizationFrame::moveEvent | ( | QMoveEvent * | event | ) | [protected, virtual] |
Definition at line 628 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 896 of file visualization_frame.cpp.
void rviz::VisualizationFrame::onHelpWiki | ( | ) | [protected, slot] |
Definition at line 886 of file visualization_frame.cpp.
void rviz::VisualizationFrame::onOpen | ( | ) | [protected, slot] |
Definition at line 755 of file visualization_frame.cpp.
void rviz::VisualizationFrame::onPanelRemoved | ( | QObject * | panel | ) | [protected, slot] |
Remove the given panel's name from the list of current panel names.
Definition at line 984 of file visualization_frame.cpp.
void rviz::VisualizationFrame::onRecentConfigSelected | ( | ) | [protected, slot] |
Definition at line 826 of file visualization_frame.cpp.
void rviz::VisualizationFrame::onSaveImage | ( | ) | [protected, slot] |
Definition at line 818 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 849 of file visualization_frame.cpp.
void rviz::VisualizationFrame::openNewPanelDialog | ( | ) | [protected, slot] |
Definition at line 392 of file visualization_frame.cpp.
bool rviz::VisualizationFrame::prepareToExit | ( | ) | [protected] |
Check for unsaved changes, prompt to save config, etc.
Definition at line 698 of file visualization_frame.cpp.
void rviz::VisualizationFrame::save | ( | ) | [protected, slot] |
Definition at line 768 of file visualization_frame.cpp.
void rviz::VisualizationFrame::saveAs | ( | ) | [protected, slot] |
Definition at line 792 of file visualization_frame.cpp.
void rviz::VisualizationFrame::saveCustomPanels | ( | const boost::shared_ptr< Config > & | config | ) | [protected] |
Definition at line 611 of file visualization_frame.cpp.
bool rviz::VisualizationFrame::saveDisplayConfig | ( | const std::string & | path | ) | [protected] |
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 543 of file visualization_frame.cpp.
void rviz::VisualizationFrame::saveGeneralConfig | ( | ) | [protected] |
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 general_config_file_.
Definition at line 336 of file visualization_frame.cpp.
void rviz::VisualizationFrame::saveWindowGeometry | ( | const boost::shared_ptr< Config > & | config | ) | [protected] |
Definition at line 686 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 527 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 519 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 514 of file visualization_frame.cpp.
void rviz::VisualizationFrame::setSplashStatus | ( | const std::string & | status | ) | [protected] |
Definition at line 180 of file visualization_frame.cpp.
void rviz::VisualizationFrame::showHelpPanel | ( | ) | [protected, slot] |
Definition at line 867 of file visualization_frame.cpp.
void rviz::VisualizationFrame::updateRecentConfigMenu | ( | ) | [protected] |
Definition at line 409 of file visualization_frame.cpp.
std::map<QAction*,Tool*> rviz::VisualizationFrame::action_to_tool_map_ [protected] |
Definition at line 261 of file visualization_frame.h.
std::string rviz::VisualizationFrame::config_dir_ [protected] |
Definition at line 230 of file visualization_frame.h.
Definition at line 278 of file visualization_frame.h.
std::string rviz::VisualizationFrame::default_display_config_file_ [protected] |
Definition at line 233 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::delete_view_menu_ [protected] |
Definition at line 241 of file visualization_frame.h.
std::string rviz::VisualizationFrame::display_config_file_ [protected] |
Definition at line 232 of file visualization_frame.h.
DisplaysPanel* rviz::VisualizationFrame::displays_panel_ [protected] |
Definition at line 221 of file visualization_frame.h.
QString rviz::VisualizationFrame::error_message_ [protected] |
Error message (if any) from most recent saveDisplayConfig() call.
Definition at line 284 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::file_menu_ [protected] |
Definition at line 238 of file visualization_frame.h.
QPoint rviz::VisualizationFrame::first_position_ [protected] |
Definition at line 257 of file visualization_frame.h.
std::string rviz::VisualizationFrame::general_config_file_ [protected] |
Definition at line 231 of file visualization_frame.h.
Definition at line 280 of file visualization_frame.h.
HelpPanel* rviz::VisualizationFrame::help_panel_ [protected] |
Definition at line 227 of file visualization_frame.h.
std::string rviz::VisualizationFrame::help_path_ [protected] |
Definition at line 250 of file visualization_frame.h.
std::string rviz::VisualizationFrame::home_dir_ [protected] |
Definition at line 236 of file visualization_frame.h.
bool rviz::VisualizationFrame::initialized_ [protected] |
Definition at line 279 of file visualization_frame.h.
std::string rviz::VisualizationFrame::last_config_dir_ [protected] |
Definition at line 234 of file visualization_frame.h.
std::string rviz::VisualizationFrame::last_image_dir_ [protected] |
Definition at line 235 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 281 of file visualization_frame.h.
VisualizationManager* rviz::VisualizationFrame::manager_ [protected] |
Definition at line 247 of file visualization_frame.h.
int rviz::VisualizationFrame::num_move_events_ [protected] |
Definition at line 259 of file visualization_frame.h.
std::string rviz::VisualizationFrame::package_path_ [protected] |
Definition at line 249 of file visualization_frame.h.
Definition at line 267 of file visualization_frame.h.
S_string rviz::VisualizationFrame::panel_names_ [protected] |
Definition at line 266 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::plugins_menu_ [protected] |
Definition at line 242 of file visualization_frame.h.
QPoint rviz::VisualizationFrame::position_correction_ [protected] |
Definition at line 258 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 282 of file visualization_frame.h.
D_string rviz::VisualizationFrame::recent_configs_ [protected] |
Definition at line 255 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::recent_configs_menu_ [protected] |
Definition at line 239 of file visualization_frame.h.
RenderPanel* rviz::VisualizationFrame::render_panel_ [protected] |
Definition at line 220 of file visualization_frame.h.
SelectionPanel* rviz::VisualizationFrame::selection_panel_ [protected] |
Definition at line 224 of file visualization_frame.h.
Definition at line 263 of file visualization_frame.h.
QAction* rviz::VisualizationFrame::show_help_action_ [protected] |
Definition at line 228 of file visualization_frame.h.
QSplashScreen* rviz::VisualizationFrame::splash_ [protected] |
Definition at line 252 of file visualization_frame.h.
TimePanel* rviz::VisualizationFrame::time_panel_ [protected] |
Definition at line 223 of file visualization_frame.h.
Definition at line 225 of file visualization_frame.h.
std::map<Tool*,QAction*> rviz::VisualizationFrame::tool_to_action_map_ [protected] |
Definition at line 262 of file visualization_frame.h.
QToolBar* rviz::VisualizationFrame::toolbar_ [protected] |
Definition at line 245 of file visualization_frame.h.
QActionGroup* rviz::VisualizationFrame::toolbar_actions_ [protected] |
Definition at line 260 of file visualization_frame.h.
QMenu* rviz::VisualizationFrame::view_menu_ [protected] |
Definition at line 240 of file visualization_frame.h.
QList<QAction*> rviz::VisualizationFrame::view_menu_actions_ [protected] |
Definition at line 243 of file visualization_frame.h.
ViewsPanel* rviz::VisualizationFrame::views_panel_ [protected] |
Definition at line 222 of file visualization_frame.h.