visualization_frame.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #include <fstream>
31 #include <memory>
32 
33 #include <QAction>
34 #include <QActionGroup>
35 #include <QShortcut>
36 #include <QApplication>
37 #include <QCoreApplication>
38 #include <QCloseEvent>
39 #include <QDesktopServices>
40 #include <QDockWidget>
41 #include <QDir>
42 #include <QFileDialog>
43 #include <QMenu>
44 #include <QMenuBar>
45 #include <QMessageBox>
46 #include <QTimer>
47 #include <QToolBar>
48 #include <QToolButton>
49 #include <QUrl>
50 #include <QStatusBar>
51 #include <QLabel>
52 #include <QToolButton>
53 #include <QHBoxLayout>
54 #include <QTabBar>
55 
56 #include <boost/algorithm/string/split.hpp>
57 #include <boost/algorithm/string/trim.hpp>
58 #include <boost/bind/bind.hpp>
59 #include <boost/filesystem.hpp>
60 
61 #include <ros/console.h>
62 #include <ros/package.h>
63 #include <ros/init.h>
64 
65 #include <OgreRenderWindow.h>
66 #include <OgreMeshManager.h>
67 
69 
70 #include <rviz/displays_panel.h>
71 #include <rviz/env_config.h>
72 #include <rviz/failed_panel.h>
73 #include <rviz/help_panel.h>
74 #include <rviz/loading_dialog.h>
75 #include <rviz/new_object_dialog.h>
76 #include <rviz/preferences.h>
78 #include <rviz/panel_dock_widget.h>
79 #include <rviz/panel_factory.h>
80 #include <rviz/render_panel.h>
81 #include <rviz/screenshot_dialog.h>
83 #include <rviz/selection_panel.h>
84 #include <rviz/splash_screen.h>
85 #include <rviz/time_panel.h>
86 #include <rviz/tool.h>
87 #include <rviz/tool_manager.h>
89 #include <rviz/views_panel.h>
92 #include <rviz/load_resource.h>
95 
97 
98 namespace fs = boost::filesystem;
99 
100 #define CONFIG_EXTENSION "rviz"
101 #define CONFIG_EXTENSION_WILDCARD "*." CONFIG_EXTENSION
102 #define RECENT_CONFIG_COUNT 10
103 
104 namespace rviz
105 {
107  : QMainWindow(parent)
108  , render_panel_(nullptr)
109  , show_help_action_(nullptr)
110  , preferences_(new Preferences())
111  , file_menu_(nullptr)
112  , recent_configs_menu_(nullptr)
113  , toolbar_(nullptr)
114  , manager_(nullptr)
115  , splash_(nullptr)
116  , toolbar_actions_(nullptr)
117  , show_choose_new_master_option_(false)
118  , toolbar_separator_(nullptr)
119  , remove_tool_menu_(nullptr)
120  , initialized_(false)
121  , geom_change_detector_(new WidgetGeometryChangeDetector(this))
122  , loading_(false)
123  , post_load_timer_(new QTimer(this))
124  , frame_count_(0)
125  , toolbar_visible_(true)
126 {
128 
129  installEventFilter(geom_change_detector_);
132 
133  post_load_timer_->setSingleShot(true);
134  connect(post_load_timer_, &QTimer::timeout, this, &VisualizationFrame::markLoadingDone);
135 
137  help_path_ = QString::fromStdString((fs::path(package_path_) / "help/help.html").string());
138  splash_path_ = QString::fromStdString((fs::path(package_path_) / "images/splash.png").string());
139 
140  QToolButton* reset_button = new QToolButton();
141  reset_button->setText("Reset");
142  reset_button->setContentsMargins(0, 0, 0, 0);
143  statusBar()->addPermanentWidget(reset_button, 0);
144  connect(reset_button, &QToolButton::clicked, this, &VisualizationFrame::VisualizationFrame::reset);
145 
146  status_label_ = new QLabel("");
147  statusBar()->addPermanentWidget(status_label_, 1);
148  connect(this, &VisualizationFrame::VisualizationFrame::statusUpdate, status_label_, &QLabel::setText);
149 
150  fps_label_ = new QLabel("");
151  fps_label_->setMinimumWidth(40);
152  fps_label_->setAlignment(Qt::AlignRight);
153  statusBar()->addPermanentWidget(fps_label_, 0);
154  original_status_bar_ = statusBar();
155 
156  setWindowTitle("RViz[*]");
157 }
158 
160 {
161  for (int i = custom_panels_.size() - 1; i >= 0; --i)
162  delete custom_panels_[i].dock;
163 
164  delete panel_factory_;
165  delete render_panel_;
166  delete manager_;
167 }
168 
169 void VisualizationFrame::setApp(QApplication* app)
170 {
171  Q_UNUSED(app);
172 }
173 
174 void VisualizationFrame::setStatus(const QString& message)
175 {
176  Q_EMIT statusUpdate(message);
177 }
178 
180 {
181  frame_count_++;
183 
184  if (wall_diff.toSec() > 1.0)
185  {
186  float fps = frame_count_ / wall_diff.toSec();
187  frame_count_ = 0;
189  if (original_status_bar_ == statusBar())
190  {
191  fps_label_->setText(QString::number(int(fps)) + QString(" fps"));
192  }
193  }
194 }
195 
196 void VisualizationFrame::closeEvent(QCloseEvent* event)
197 {
198  if (prepareToExit())
199  {
200  event->accept();
201  }
202  else
203  {
204  event->ignore();
205  }
206 }
207 
208 void VisualizationFrame::leaveEvent(QEvent* /*event*/)
209 {
210  setStatus("");
211 }
212 
214 {
215  Ogre::MeshManager::getSingleton().removeAll();
216  manager_->resetTime();
217 }
218 
220 {
221  if (prepareToExit())
222  {
223  QApplication::exit(255);
224  }
225 }
226 
228 {
230 }
231 
232 void VisualizationFrame::setHelpPath(const QString& help_path)
233 {
234  help_path_ = help_path;
236 }
237 
238 void VisualizationFrame::setSplashPath(const QString& splash_path)
239 {
240  splash_path_ = splash_path;
241 }
242 
243 void VisualizationFrame::initialize(const QString& display_config_file)
244 {
245  initConfigs();
246 
248 
249  QIcon app_icon(QString::fromStdString((fs::path(package_path_) / "icons/package.png").string()));
250  setWindowIcon(app_icon);
251 
252  if (splash_path_ != "")
253  {
254  QPixmap splash_image(splash_path_);
255  splash_ = new SplashScreen(splash_image);
256  splash_->show();
257  connect(this, &VisualizationFrame::VisualizationFrame::statusUpdate, splash_,
258  [this](const QString& message) { splash_->showMessage(message); });
259  }
260  Q_EMIT statusUpdate("Initializing");
261 
262  // Periodically process events for the splash screen.
263  // See: http://doc.qt.io/qt-5/qsplashscreen.html#details
264  QCoreApplication::processEvents();
265 
266  if (!ros::isInitialized())
267  {
268  int argc = 0;
269  ros::init(argc, nullptr, "rviz", ros::init_options::AnonymousName);
270  }
271 
272  // Periodically process events for the splash screen.
273  QCoreApplication::processEvents();
274 
275  QWidget* central_widget = new QWidget(this);
276  QHBoxLayout* central_layout = new QHBoxLayout;
277  central_layout->setSpacing(0);
278  central_layout->setContentsMargins(0, 0, 0, 0);
279 
280  render_panel_ = new RenderPanel(central_widget);
281 
282  hide_left_dock_button_ = new QToolButton();
283  hide_left_dock_button_->setContentsMargins(0, 0, 0, 0);
284  hide_left_dock_button_->setArrowType(Qt::LeftArrow);
285  hide_left_dock_button_->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding));
286  hide_left_dock_button_->setFixedWidth(16);
287  hide_left_dock_button_->setAutoRaise(true);
288  hide_left_dock_button_->setCheckable(true);
289 
290  connect(hide_left_dock_button_, &QToolButton::toggled, this,
291  &VisualizationFrame::VisualizationFrame::hideLeftDock);
292 
293  hide_right_dock_button_ = new QToolButton();
294  hide_right_dock_button_->setContentsMargins(0, 0, 0, 0);
295  hide_right_dock_button_->setArrowType(Qt::RightArrow);
296  hide_right_dock_button_->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding));
297  hide_right_dock_button_->setFixedWidth(16);
298  hide_right_dock_button_->setAutoRaise(true);
299  hide_right_dock_button_->setCheckable(true);
300 
301  connect(hide_right_dock_button_, &QToolButton::toggled, this,
302  &VisualizationFrame::VisualizationFrame::hideRightDock);
303 
304  central_layout->addWidget(hide_left_dock_button_, 0);
305  central_layout->addWidget(render_panel_, 1);
306  central_layout->addWidget(hide_right_dock_button_, 0);
307 
308  central_widget->setLayout(central_layout);
309 
310  // Periodically process events for the splash screen.
311  QCoreApplication::processEvents();
312 
313  initMenus();
314 
315  // Periodically process events for the splash screen.
316  QCoreApplication::processEvents();
317 
318  initToolbars();
319 
320  // Periodically process events for the splash screen.
321  QCoreApplication::processEvents();
322 
323  setCentralWidget(central_widget);
324 
325  // Periodically process events for the splash screen.
326  QCoreApplication::processEvents();
327 
331  &VisualizationFrame::VisualizationFrame::exitFullScreen);
332 
333  // Periodically process events for the splash screen.
334  QCoreApplication::processEvents();
335 
337 
338  // Periodically process events for the splash screen.
339  QCoreApplication::processEvents();
340 
341  ToolManager* tool_man = manager_->getToolManager();
342 
345  connect(tool_man, &ToolManager::toolAdded, this, &VisualizationFrame::VisualizationFrame::addTool);
346  connect(tool_man, &ToolManager::toolRemoved, this, &VisualizationFrame::VisualizationFrame::removeTool);
347  connect(tool_man, &ToolManager::toolRefreshed, this,
348  &VisualizationFrame::VisualizationFrame::refreshTool);
349  connect(tool_man, &ToolManager::toolChanged, this,
350  &VisualizationFrame::VisualizationFrame::indicateToolIsCurrent);
351 
352  manager_->initialize();
353 
354  // Periodically process events for the splash screen.
355  QCoreApplication::processEvents();
356 
357  if (display_config_file != "")
358  {
359  loadDisplayConfig(display_config_file);
360  }
361  else
362  {
363  loadDisplayConfig(QString::fromStdString(default_display_config_file_));
364  }
365 
366  // Periodically process events for the splash screen.
367  QCoreApplication::processEvents();
368 
369  delete splash_;
370  splash_ = nullptr;
371 
373  initialized_ = true;
374  Q_EMIT statusUpdate("RViz is ready.");
375 
377  &VisualizationFrame::VisualizationFrame::updateFps);
379  &VisualizationFrame::VisualizationFrame::statusUpdate);
380 }
381 
383 {
384  home_dir_ = QDir::toNativeSeparators(QDir::homePath()).toStdString();
385 
386  config_dir_ = (fs::path(home_dir_) / ".rviz").string();
387  persistent_settings_file_ = (fs::path(config_dir_) / "persistent_settings").string();
388  default_display_config_file_ = (fs::path(config_dir_) / "default." CONFIG_EXTENSION).string();
389 
390  if (fs::is_regular_file(config_dir_))
391  {
392  ROS_ERROR("Moving file [%s] out of the way to recreate it as a directory.", config_dir_.c_str());
393  std::string backup_file = config_dir_ + ".bak";
394 
395  fs::rename(config_dir_, backup_file);
396  fs::create_directory(config_dir_);
397  }
398  else if (!fs::exists(config_dir_))
399  {
400  fs::create_directory(config_dir_);
401  }
402 }
403 
405 {
406  YamlConfigReader reader;
407  Config config;
408  reader.readFile(config, QString::fromStdString(persistent_settings_file_));
409  if (!reader.error())
410  {
411  QString last_config_dir, last_image_dir;
412  if (config.mapGetString("Last Config Dir", &last_config_dir) &&
413  config.mapGetString("Last Image Dir", &last_image_dir))
414  {
415  last_config_dir_ = last_config_dir.toStdString();
416  last_image_dir_ = last_image_dir.toStdString();
417  }
418 
419  Config recent_configs_list = config.mapGetChild("Recent Configs");
420  recent_configs_.clear();
421  int num_recent = recent_configs_list.listLength();
422  for (int i = 0; i < num_recent; i++)
423  {
424  recent_configs_.push_back(recent_configs_list.listChildAt(i).getValue().toString().toStdString());
425  }
426  }
427  else
428  {
429  ROS_ERROR("%s", qPrintable(reader.errorMessage()));
430  }
431 }
432 
434 {
435  Config config;
436  config.mapSetValue("Last Config Dir", QString::fromStdString(last_config_dir_));
437  config.mapSetValue("Last Image Dir", QString::fromStdString(last_image_dir_));
438  Config recent_configs_list = config.mapMakeChild("Recent Configs");
439  for (D_string::iterator it = recent_configs_.begin(); it != recent_configs_.end(); ++it)
440  {
441  recent_configs_list.listAppendNew().setValue(QString::fromStdString(*it));
442  }
443 
444  YamlConfigWriter writer;
445  writer.writeFile(config, QString::fromStdString(persistent_settings_file_));
446 
447  if (writer.error())
448  {
449  ROS_ERROR("%s", qPrintable(writer.errorMessage()));
450  }
451 }
452 
454 {
455  file_menu_ = menuBar()->addMenu("&File");
456 
457  QAction* file_menu_open_action =
458  file_menu_->addAction("&Open Config", this, &VisualizationFrame::onOpen, QKeySequence("Ctrl+O"));
459  this->addAction(file_menu_open_action);
460  QAction* file_menu_save_action =
461  file_menu_->addAction("&Save Config", this, &VisualizationFrame::onSave, QKeySequence("Ctrl+S"));
462  this->addAction(file_menu_save_action);
463  QAction* file_menu_save_as_action = file_menu_->addAction(
464  "Save Config &As", this, &VisualizationFrame::onSaveAs, QKeySequence("Ctrl+Shift+S"));
465  this->addAction(file_menu_save_as_action);
466 
467  recent_configs_menu_ = file_menu_->addMenu("&Recent Configs");
468  file_menu_->addAction("Save &Image", this, &VisualizationFrame::onSaveImage);
470  {
471  file_menu_->addSeparator();
472  file_menu_->addAction("Change &Master", this, &VisualizationFrame::changeMaster);
473  }
474  file_menu_->addSeparator();
475  file_menu_->addAction("&Preferences", this, &VisualizationFrame::openPreferencesDialog,
476  QKeySequence("Ctrl+P"));
477 
478  QAction* file_menu_quit_action =
479  file_menu_->addAction("&Quit", this, &VisualizationFrame::close, QKeySequence("Ctrl+Q"));
480  file_menu_quit_action->setObjectName("actQuit");
481  this->addAction(file_menu_quit_action);
482 
483  view_menu_ = menuBar()->addMenu("&Panels");
484  view_menu_->addAction("Add &New Panel", this, &VisualizationFrame::openNewPanelDialog);
485  delete_view_menu_ = view_menu_->addMenu("&Delete Panel");
486  delete_view_menu_->setEnabled(false);
487 
488  QAction* fullscreen_action =
489  view_menu_->addAction("&Fullscreen", this, SLOT(setFullScreen(bool)), Qt::Key_F11);
490  fullscreen_action->setCheckable(true);
491  this->addAction(
492  fullscreen_action); // Also add to window, or the shortcut doest work when the menu is hidden.
493  connect(this, &VisualizationFrame::fullScreenChange, fullscreen_action, &QAction::setChecked);
494  view_menu_->addSeparator();
495 
496  QMenu* help_menu = menuBar()->addMenu("&Help");
497  help_menu->addAction("Show &Help panel", this, &VisualizationFrame::showHelpPanel);
498  help_menu->addAction("Open rviz wiki in browser", this, &VisualizationFrame::onHelpWiki);
499  help_menu->addSeparator();
500  help_menu->addAction("&About", this, &VisualizationFrame::onHelpAbout);
501 }
502 
504 {
505  QFont font;
506  font.setPointSize(font.pointSizeF() * 0.9);
507 
508  // make toolbar with plugin tools
509 
510  toolbar_ = addToolBar("Tools");
511  toolbar_->setFont(font);
512  toolbar_->setContentsMargins(0, 0, 0, 0);
513  toolbar_->setObjectName("Tools");
514  toolbar_->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
515  toolbar_actions_ = new QActionGroup(this);
516  connect(toolbar_actions_, &QActionGroup::triggered, this,
518  view_menu_->addAction(toolbar_->toggleViewAction());
519 
520  toolbar_separator_ = toolbar_->addSeparator();
521 
522  QToolButton* add_tool_button = new QToolButton();
523  add_tool_button->setToolTip("Add a new tool");
524  add_tool_button->setIcon(loadPixmap("package://rviz/icons/plus.png"));
525  toolbar_->addWidget(add_tool_button);
526  connect(add_tool_button, &QToolButton::clicked, this,
527  &VisualizationFrame::VisualizationFrame::openNewToolDialog);
528 
529  remove_tool_menu_ = new QMenu(toolbar_);
530  QToolButton* remove_tool_button = new QToolButton();
531  remove_tool_button->setMenu(remove_tool_menu_);
532  remove_tool_button->setPopupMode(QToolButton::InstantPopup);
533  remove_tool_button->setToolTip("Remove a tool from the toolbar");
534  remove_tool_button->setIcon(loadPixmap("package://rviz/icons/minus.png"));
535  toolbar_->addWidget(remove_tool_button);
536  connect(remove_tool_menu_, &QMenu::triggered, this,
537  &VisualizationFrame::VisualizationFrame::onToolbarRemoveTool);
538 
539  QMenu* button_style_menu = new QMenu(toolbar_);
540  QAction* action_tool_button_icon_only = new QAction("Icon only", toolbar_actions_);
541  action_tool_button_icon_only->setData(Qt::ToolButtonIconOnly);
542  button_style_menu->addAction(action_tool_button_icon_only);
543  QAction* action_tool_button_text_only = new QAction("Text only", toolbar_actions_);
544  action_tool_button_text_only->setData(Qt::ToolButtonTextOnly);
545  button_style_menu->addAction(action_tool_button_text_only);
546  QAction* action_tool_button_text_beside_icon = new QAction("Text beside icon", toolbar_actions_);
547  action_tool_button_text_beside_icon->setData(Qt::ToolButtonTextBesideIcon);
548  button_style_menu->addAction(action_tool_button_text_beside_icon);
549  QAction* action_tool_button_text_under_icon = new QAction("Text under icon", toolbar_actions_);
550  action_tool_button_text_under_icon->setData(Qt::ToolButtonTextUnderIcon);
551  button_style_menu->addAction(action_tool_button_text_under_icon);
552 
553  QToolButton* button_style_button = new QToolButton();
554  button_style_button->setMenu(button_style_menu);
555  button_style_button->setPopupMode(QToolButton::InstantPopup);
556  button_style_button->setToolTip("Set toolbar style");
557  button_style_button->setIcon(loadPixmap("package://rviz/icons/visibility.svg"));
558  toolbar_->addWidget(button_style_button);
559  connect(button_style_menu, &QMenu::triggered, this,
560  &VisualizationFrame::VisualizationFrame::onButtonStyleTool);
561 }
562 
563 void VisualizationFrame::hideDockImpl(Qt::DockWidgetArea area, bool hide)
564 {
565  QList<PanelDockWidget*> dock_widgets = findChildren<PanelDockWidget*>();
566 
567  for (QList<PanelDockWidget*>::iterator it = dock_widgets.begin(); it != dock_widgets.end(); it++)
568  {
569  Qt::DockWidgetArea curr_area = dockWidgetArea(*it);
570  if (area == curr_area)
571  {
572  (*it)->setCollapsed(hide);
573  }
574  // allow/disallow docking to this area for all widgets
575  if (hide)
576  {
577  (*it)->setAllowedAreas((*it)->allowedAreas() & ~area);
578  }
579  else
580  {
581  (*it)->setAllowedAreas((*it)->allowedAreas() | area);
582  }
583  }
584 }
585 
587 {
588  hide_left_dock_button_->setVisible(visible);
589  hide_right_dock_button_->setVisible(visible);
590 }
591 
593 {
594  hideDockImpl(Qt::LeftDockWidgetArea, hide);
595  hide_left_dock_button_->setArrowType(hide ? Qt::RightArrow : Qt::LeftArrow);
596 }
597 
599 {
600  hideDockImpl(Qt::RightDockWidgetArea, hide);
601  hide_right_dock_button_->setArrowType(hide ? Qt::LeftArrow : Qt::RightArrow);
602 }
603 
605 {
606  // if a dock widget becomes visible and is resting inside the
607  // left or right dock area, we want to unhide the whole area
608  if (visible)
609  {
610  QDockWidget* dock_widget = dynamic_cast<QDockWidget*>(sender());
611  if (dock_widget)
612  {
613  Qt::DockWidgetArea area = dockWidgetArea(dock_widget);
614  if (area == Qt::LeftDockWidgetArea)
615  {
616  hide_left_dock_button_->setChecked(false);
617  }
618  if (area == Qt::RightDockWidgetArea)
619  {
620  hide_right_dock_button_->setChecked(false);
621  }
622  }
623  }
624 }
625 
627 {
628  Preferences temp_preferences(*preferences_);
629  PreferencesDialog dialog(panel_factory_, &temp_preferences, this);
630  manager_->stopUpdate();
631  if (dialog.exec() == QDialog::Accepted)
632  {
633  // Apply preferences.
634  preferences_ = boost::make_shared<Preferences>(temp_preferences);
635  }
637 }
638 
640 {
641  QString class_id;
642  QString display_name;
643  QStringList empty;
644 
645  NewObjectDialog* dialog =
646  new NewObjectDialog(panel_factory_, "Panel", empty, empty, &class_id, &display_name, this);
647  manager_->stopUpdate();
648  if (dialog->exec() == QDialog::Accepted)
649  {
650  QDockWidget* dock = addPanelByName(display_name, class_id);
651  if (dock)
652  {
653  connect(dock, &QDockWidget::dockLocationChanged, this,
654  &VisualizationFrame::VisualizationFrame::onDockPanelChange);
655  }
656  }
658 }
659 
661 {
662  QString class_id;
663  QStringList empty;
664  ToolManager* tool_man = manager_->getToolManager();
665 
666  NewObjectDialog* dialog =
667  new NewObjectDialog(tool_man->getFactory(), "Tool", empty, tool_man->getToolClasses(), &class_id);
668  manager_->stopUpdate();
669  if (dialog->exec() == QDialog::Accepted)
670  {
671  tool_man->addTool(class_id);
672  }
674  activateWindow(); // Force keyboard focus back on main window.
675 }
676 
678 {
679  recent_configs_menu_->clear();
680 
681  D_string::iterator it = recent_configs_.begin();
682  D_string::iterator end = recent_configs_.end();
683  for (; it != end; ++it)
684  {
685  if (!it->empty())
686  {
687  std::string display_name = *it;
688  if (display_name == default_display_config_file_)
689  {
690  display_name += " (default)";
691  }
692  if (display_name.find(home_dir_) == 0)
693  {
694  display_name = ("~" / fs::path(display_name.substr(home_dir_.size()))).string();
695  }
696  QString qdisplay_name = QString::fromStdString(display_name);
697  QAction* action = new QAction(qdisplay_name, this);
698  action->setData(QString::fromStdString(*it));
699  connect(action, &QAction::triggered, this,
700  &VisualizationFrame::VisualizationFrame::onRecentConfigSelected);
701  recent_configs_menu_->addAction(action);
702  }
703  }
704 }
705 
706 void VisualizationFrame::markRecentConfig(const std::string& path)
707 {
708  D_string::iterator it = std::find(recent_configs_.begin(), recent_configs_.end(), path);
709  if (it != recent_configs_.end())
710  {
711  recent_configs_.erase(it);
712  }
713 
714  recent_configs_.push_front(path);
715 
717  {
718  recent_configs_.pop_back();
719  }
720 
722 }
723 
724 void VisualizationFrame::loadDisplayConfig(const QString& qpath)
725 {
726  std::string path = qpath.toStdString();
727  fs::path actual_load_path = path;
728  bool valid_load_path = fs::is_regular_file(actual_load_path);
729 
730  if (!valid_load_path && fs::portable_posix_name(path))
731  {
732  if (actual_load_path.extension() != "." CONFIG_EXTENSION)
733  actual_load_path += "." CONFIG_EXTENSION;
734  actual_load_path = fs::path(config_dir_) / actual_load_path;
735  if ((valid_load_path = fs::is_regular_file(actual_load_path)))
736  path = actual_load_path.string();
737  }
738 
739  if (!valid_load_path)
740  {
741  actual_load_path = (fs::path(package_path_) / "default.rviz");
742  if (!fs::is_regular_file(actual_load_path))
743  {
744  ROS_ERROR("Default display config '%s' not found. RViz will be very empty at first.",
745  actual_load_path.c_str());
746  return;
747  }
748  }
749  loadDisplayConfigHelper(actual_load_path.string());
750 }
751 
752 bool VisualizationFrame::loadDisplayConfigHelper(const std::string& full_path, const bool discard_changes)
753 {
754  // Check if we have unsaved changes to the current config the same
755  // as we do during exit, with the same option to cancel.
756  if (!discard_changes && !prepareToExit())
757  {
758  return false;
759  }
760 
761  setWindowModified(false);
762  loading_ = true;
763 
764  std::unique_ptr<LoadingDialog> dialog;
765  if (initialized_)
766  {
767  dialog.reset(new LoadingDialog(this));
768  dialog->show();
769  connect(this, &VisualizationFrame::VisualizationFrame::statusUpdate, dialog.get(),
771 
772  // make the window correctly appear although running a long-term function
773  QCoreApplication::processEvents();
774  }
775 
776  YamlConfigReader reader;
777  Config config;
778  reader.readFile(config, QString::fromStdString(full_path));
779  if (reader.error())
780  return false;
781 
782  load(config);
783 
784  markRecentConfig(full_path);
785 
786  setDisplayConfigFile(full_path);
787 
788  last_config_dir_ = fs::path(full_path).parent_path().string();
789 
790  post_load_timer_->start(1000);
791 
792  return true;
793 }
794 
796 {
797  loading_ = false;
798 }
799 
800 void VisualizationFrame::setImageSaveDirectory(const QString& directory)
801 {
802  last_image_dir_ = directory.toStdString();
803 }
804 
806 {
807  if (!loading_)
808  {
809  if (!isWindowModified())
810  {
811  setWindowModified(true);
812  }
813  }
814 }
815 
816 void VisualizationFrame::setDisplayConfigFile(const std::string& path)
817 {
818  display_config_file_ = path;
819 
820  std::string title;
821  if (path == default_display_config_file_)
822  {
823  title = "RViz[*]";
824  }
825  else
826  {
827  title = fs::path(path).filename().string() + "[*] - RViz";
828  }
829  setWindowTitle(QString::fromStdString(title));
830  Q_EMIT displayConfigFileChanged(QString::fromStdString(path));
831 }
832 
833 bool VisualizationFrame::saveDisplayConfig(const QString& path)
834 {
835  Config config;
836  save(config);
837 
838  YamlConfigWriter writer;
839  writer.writeFile(config, path);
840 
841  if (writer.error())
842  {
843  ROS_ERROR("%s", qPrintable(writer.errorMessage()));
844  error_message_ = writer.errorMessage();
845  return false;
846  }
847  else
848  {
849  setWindowModified(false);
850  error_message_ = "";
851  return true;
852  }
853 }
854 
856 {
857  manager_->save(config.mapMakeChild("Visualization Manager"));
858  savePanels(config.mapMakeChild("Panels"));
859  saveWindowGeometry(config.mapMakeChild("Window Geometry"));
860  savePreferences(config.mapMakeChild("Preferences"));
861  saveToolbars(config.mapMakeChild("Toolbars"));
862 }
863 
864 void VisualizationFrame::load(const Config& config)
865 {
866  manager_->load(config.mapGetChild("Visualization Manager"));
867  loadPanels(config.mapGetChild("Panels"));
868  loadWindowGeometry(config.mapGetChild("Window Geometry"));
869  loadPreferences(config.mapGetChild("Preferences"));
870  configureToolbars(config.mapGetChild("Toolbars"));
871 }
872 
874 {
875  int x, y;
876  if (config.mapGetInt("X", &x) && config.mapGetInt("Y", &y))
877  {
878  move(x, y);
879  }
880 
881  int width, height;
882  if (config.mapGetInt("Width", &width) && config.mapGetInt("Height", &height))
883  {
884  resize(width, height);
885  }
886 
887  QString main_window_config;
888  if (config.mapGetString("QMainWindow State", &main_window_config))
889  {
890  restoreState(QByteArray::fromHex(qPrintable(main_window_config)));
891  }
892 
893  // load panel dock widget states (collapsed or not)
894  QList<PanelDockWidget*> dock_widgets = findChildren<PanelDockWidget*>();
895 
896  for (QList<PanelDockWidget*>::iterator it = dock_widgets.begin(); it != dock_widgets.end(); it++)
897  {
898  Config itConfig = config.mapGetChild((*it)->windowTitle());
899 
900  if (itConfig.isValid())
901  {
902  (*it)->load(itConfig);
903  }
904  }
905 
906  bool b = false;
907  config.mapGetBool("Hide Left Dock", &b);
908  hide_left_dock_button_->setChecked(b);
909  hideLeftDock(b);
910  config.mapGetBool("Hide Right Dock", &b);
911  hideRightDock(b);
912  hide_right_dock_button_->setChecked(b);
913 }
914 
916 {
917  int tool_button_style;
918  if (config.mapGetInt("toolButtonStyle", &tool_button_style))
919  {
920  toolbar_->setToolButtonStyle(static_cast<Qt::ToolButtonStyle>(tool_button_style));
921  }
922 }
923 
925 {
926  config.mapSetValue("toolButtonStyle", static_cast<int>(toolbar_->toolButtonStyle()));
927 }
928 
930 {
931  config.mapSetValue("X", x());
932  config.mapSetValue("Y", y());
933  config.mapSetValue("Width", width());
934  config.mapSetValue("Height", height());
935 
936  QByteArray window_state = saveState().toHex();
937  config.mapSetValue("QMainWindow State", window_state.constData());
938 
939  config.mapSetValue("Hide Left Dock", hide_left_dock_button_->isChecked());
940  config.mapSetValue("Hide Right Dock", hide_right_dock_button_->isChecked());
941 
942  // save panel dock widget states (collapsed or not)
943  QList<PanelDockWidget*> dock_widgets = findChildren<PanelDockWidget*>();
944 
945  for (QList<PanelDockWidget*>::iterator it = dock_widgets.begin(); it != dock_widgets.end(); it++)
946  {
947  (*it)->save(config.mapMakeChild((*it)->windowTitle()));
948  }
949 }
950 
952 {
953  // First destroy any existing custom panels.
954  for (int i = custom_panels_.size() - 1; i >= 0; --i)
955  delete custom_panels_[i].dock;
956  custom_panels_.clear();
957 
958  // Then load the ones in the config.
959  int num_custom_panels = config.listLength();
960  for (int i = 0; i < num_custom_panels; i++)
961  {
962  Config panel_config = config.listChildAt(i);
963 
964  QString class_id, name;
965  if (panel_config.mapGetString("Class", &class_id) && panel_config.mapGetString("Name", &name))
966  {
967  QDockWidget* dock = addPanelByName(name, class_id);
968  // This is kind of ridiculous - should just be something like
969  // createPanel() and addPanel() so I can do load() without this
970  // qobject_cast.
971  if (dock)
972  {
973  connect(dock, &QDockWidget::dockLocationChanged, this,
974  &VisualizationFrame::VisualizationFrame::onDockPanelChange);
975  Panel* panel = qobject_cast<Panel*>(dock->widget());
976  if (panel)
977  {
978  panel->load(panel_config);
979  }
980  }
981  }
982  }
983 
985 }
986 
988 {
989  config.setType(Config::List); // Not really necessary, but gives an empty list if there are no entries,
990  // instead of an Empty config node.
991 
992  for (int i = 0; i < custom_panels_.size(); i++)
993  {
994  custom_panels_[i].panel->save(config.listAppendNew());
995  }
996 }
997 
999 {
1000  config.mapGetBool("PromptSaveOnExit", &(preferences_->prompt_save_on_exit));
1001 }
1002 
1004 {
1005  config.mapSetValue("PromptSaveOnExit", preferences_->prompt_save_on_exit);
1006 }
1007 
1009 {
1010  if (!initialized_)
1011  {
1012  return true;
1013  }
1014 
1016 
1017  if (isWindowModified() && preferences_->prompt_save_on_exit)
1018  {
1019  QMessageBox box(this);
1020  box.setText("There are unsaved changes.");
1021  box.setInformativeText(QString::fromStdString("Save changes to " + display_config_file_ + "?"));
1022  box.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
1023  box.setDefaultButton(QMessageBox::Save);
1024  manager_->stopUpdate();
1025  int result = box.exec();
1026  manager_->startUpdate();
1027  switch (result)
1028  {
1029  case QMessageBox::Save:
1030  if (saveDisplayConfig(QString::fromStdString(display_config_file_)))
1031  {
1032  return true;
1033  }
1034  else
1035  {
1036  QMessageBox box(this);
1037  box.setWindowTitle("Failed to save.");
1038  box.setText(getErrorMessage());
1039  box.setInformativeText(
1040  QString::fromStdString("Save copy of " + display_config_file_ + " to another file?"));
1041  box.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
1042  box.setDefaultButton(QMessageBox::Save);
1043  int result = box.exec();
1044  switch (result)
1045  {
1046  case QMessageBox::Save:
1047  onSaveAs();
1048  return true;
1049  case QMessageBox::Discard:
1050  return true;
1051  default:
1052  return false;
1053  }
1054  }
1055  case QMessageBox::Discard:
1056  return true;
1057  default:
1058  return false;
1059  }
1060  }
1061  else
1062  {
1063  return true;
1064  }
1065 }
1066 
1068 {
1069  manager_->stopUpdate();
1070  QString filename = QFileDialog::getOpenFileName(this, "Choose a file to open",
1071  QString::fromStdString(last_config_dir_),
1072  "RViz config files (" CONFIG_EXTENSION_WILDCARD ")");
1073  manager_->startUpdate();
1074 
1075  if (!filename.isEmpty())
1076  {
1077  std::string path = filename.toStdString();
1078 
1079  if (!fs::exists(path))
1080  {
1081  QString message = filename + " does not exist!";
1082  QMessageBox::critical(this, "Config file does not exist", message);
1083  return;
1084  }
1085 
1086  loadDisplayConfig(filename);
1087  }
1088 }
1089 
1091 {
1092  if (!initialized_)
1093  {
1094  return;
1095  }
1096 
1098 
1099  if (!saveDisplayConfig(QString::fromStdString(display_config_file_)))
1100  {
1101  manager_->stopUpdate();
1102  QMessageBox box(this);
1103  box.setWindowTitle("Failed to save.");
1104  box.setText(getErrorMessage());
1105  box.setInformativeText(
1106  QString::fromStdString("Save copy of " + display_config_file_ + " to another file?"));
1107  box.setStandardButtons(QMessageBox::Save | QMessageBox::Cancel);
1108  box.setDefaultButton(QMessageBox::Save);
1109  if (box.exec() == QMessageBox::Save)
1110  {
1111  onSaveAs();
1112  }
1113  manager_->startUpdate();
1114  }
1115 }
1116 
1118 {
1119  manager_->stopUpdate();
1120  QString q_filename = QFileDialog::getSaveFileName(this, "Choose a file to save to",
1121  QString::fromStdString(last_config_dir_),
1122  "RViz config files (" CONFIG_EXTENSION_WILDCARD ")");
1123  manager_->startUpdate();
1124 
1125  if (!q_filename.isEmpty())
1126  {
1127  std::string filename = q_filename.toStdString();
1128  fs::path path(filename);
1129  if (path.extension() != "." CONFIG_EXTENSION)
1130  {
1131  filename += "." CONFIG_EXTENSION;
1132  }
1133 
1134  if (!saveDisplayConfig(QString::fromStdString(filename)))
1135  {
1136  QMessageBox::critical(this, "Failed to save.", getErrorMessage());
1137  }
1138 
1139  markRecentConfig(filename);
1140  last_config_dir_ = fs::path(filename).parent_path().string();
1141  setDisplayConfigFile(filename);
1142  }
1143 }
1144 
1146 {
1147  ScreenshotDialog* dialog =
1148  new ScreenshotDialog(this, render_panel_, QString::fromStdString(last_image_dir_));
1149  connect(dialog, &ScreenshotDialog::savedInDirectory, this,
1150  &VisualizationFrame::VisualizationFrame::setImageSaveDirectory);
1151  dialog->show();
1152 }
1153 
1155 {
1156  QAction* action = dynamic_cast<QAction*>(sender());
1157  if (action)
1158  {
1159  std::string path = action->data().toString().toStdString();
1160  if (!path.empty())
1161  {
1162  if (!fs::exists(path))
1163  {
1164  QString message = QString::fromStdString(path) + " does not exist!";
1165  QMessageBox::critical(this, "Config file does not exist", message);
1166  return;
1167  }
1168 
1169  loadDisplayConfig(QString::fromStdString(path));
1170  }
1171  }
1172 }
1173 
1175 {
1176  QAction* action = new QAction(tool->getName(), toolbar_actions_);
1177  action->setIcon(tool->getIcon());
1178  action->setIconText(tool->getName());
1179  action->setCheckable(true);
1180  toolbar_->insertAction(toolbar_separator_, action);
1181  action_to_tool_map_[action] = tool;
1182  tool_to_action_map_[tool] = action;
1183 
1184  remove_tool_menu_->addAction(tool->getName());
1185 
1186  QObject::connect(tool, &Tool::nameChanged, this,
1187  &VisualizationFrame::VisualizationFrame::onToolNameChanged);
1188 }
1189 
1190 void VisualizationFrame::onToolNameChanged(const QString& name)
1191 {
1192  // Early return if the tool is not present
1193  auto it = tool_to_action_map_.find(qobject_cast<Tool*>(sender()));
1194  if (it == tool_to_action_map_.end())
1195  return;
1196 
1197  // Change the name of the action
1198  it->second->setIconText(name);
1199 }
1200 
1202 {
1203  Tool* tool = action_to_tool_map_[action];
1204 
1205  if (tool)
1206  {
1208  }
1209 }
1210 
1211 void VisualizationFrame::onToolbarRemoveTool(QAction* remove_tool_menu_action)
1212 {
1213  QString name = remove_tool_menu_action->text();
1214  for (int i = 0; i < manager_->getToolManager()->numTools(); i++)
1215  {
1216  Tool* tool = manager_->getToolManager()->getTool(i);
1217  if (tool->getName() == name)
1218  {
1220  return;
1221  }
1222  }
1223 }
1224 
1225 void VisualizationFrame::onButtonStyleTool(QAction* button_style_tool_menu_action)
1226 {
1227  toolbar_->setToolButtonStyle(
1228  static_cast<Qt::ToolButtonStyle>(button_style_tool_menu_action->data().toInt()));
1229 }
1230 
1232 {
1233  QAction* action = tool_to_action_map_[tool];
1234  if (action)
1235  {
1236  toolbar_actions_->removeAction(action);
1237  toolbar_->removeAction(action);
1238  tool_to_action_map_.erase(tool);
1239  action_to_tool_map_.erase(action);
1240  }
1241  QString tool_name = tool->getName();
1242  QList<QAction*> remove_tool_actions = remove_tool_menu_->actions();
1243  for (int i = 0; i < remove_tool_actions.size(); i++)
1244  {
1245  QAction* removal_action = remove_tool_actions.at(i);
1246  if (removal_action->text() == tool_name)
1247  {
1248  remove_tool_menu_->removeAction(removal_action);
1249  break;
1250  }
1251  }
1252 }
1253 
1255 {
1256  QAction* action = tool_to_action_map_[tool];
1257  action->setIcon(tool->getIcon());
1258  action->setIconText(tool->getName());
1259 }
1260 
1262 {
1263  QAction* action = tool_to_action_map_[tool];
1264  if (action)
1265  {
1266  action->setChecked(true);
1267  }
1268 }
1269 
1271 {
1272  if (!show_help_action_)
1273  {
1274  QDockWidget* dock = addPanelByName("Help", "rviz/Help");
1275  show_help_action_ = dock->toggleViewAction();
1276  connect(dock, &QObject::destroyed, this, &VisualizationFrame::VisualizationFrame::onHelpDestroyed);
1277  }
1278  else
1279  {
1280  // show_help_action_ is a toggle action, so trigger() changes its
1281  // state. Therefore we must force it to the opposite state from
1282  // what we want before we call trigger(). (I think.)
1283  show_help_action_->setChecked(false);
1284  show_help_action_->trigger();
1285  }
1286 }
1287 
1289 {
1290  show_help_action_ = nullptr;
1291 }
1292 
1294 {
1295  QDesktopServices::openUrl(QUrl("http://wiki.ros.org/rviz"));
1296 }
1297 
1299 {
1300  QString about_text = QString("This is RViz version %1 (%2).\n"
1301  "\n"
1302  "Compiled against Qt version %3."
1303  "\n"
1304  "Compiled against OGRE version %4.%5.%6%7 (%8).")
1305  .arg(get_version().c_str())
1306  .arg(get_distro().c_str())
1307  .arg(QT_VERSION_STR)
1308  .arg(OGRE_VERSION_MAJOR)
1309  .arg(OGRE_VERSION_MINOR)
1310  .arg(OGRE_VERSION_PATCH)
1311  .arg(OGRE_VERSION_SUFFIX)
1312  .arg(OGRE_VERSION_NAME);
1313 
1314  QMessageBox::about(QApplication::activeWindow(), "About", about_text);
1315 }
1316 
1318 {
1319  QList<QTabBar*> tab_bars = findChildren<QTabBar*>(QString(), Qt::FindDirectChildrenOnly);
1320  for (QList<QTabBar*>::iterator it = tab_bars.begin(); it != tab_bars.end(); it++)
1321  {
1322  (*it)->setElideMode(Qt::ElideNone);
1323  }
1324 }
1325 
1327 {
1328  return this;
1329 }
1330 
1332 {
1333  for (int i = 0; i < custom_panels_.size(); ++i)
1334  {
1335  if (custom_panels_[i].dock == dock)
1336  {
1337  auto& record = custom_panels_[i];
1338  record.delete_action->deleteLater();
1339  delete_view_menu_->removeAction(record.delete_action);
1340  delete_view_menu_->setDisabled(delete_view_menu_->actions().isEmpty());
1341  custom_panels_.removeAt(i);
1343  return;
1344  }
1345  }
1346 }
1347 
1349 {
1350  // This should only be called as a SLOT from a QAction in the
1351  // "delete panel" submenu, so the sender will be one of the QActions
1352  // stored as "delete_action" in a PanelRecord. This code looks for
1353  // a delete_action in custom_panels_ matching sender() and removes
1354  // the panel associated with it.
1355  if (QAction* action = qobject_cast<QAction*>(sender()))
1356  {
1357  for (int i = 0; i < custom_panels_.size(); i++)
1358  {
1359  if (custom_panels_[i].delete_action == action)
1360  {
1361  delete custom_panels_[i].dock;
1362  return;
1363  }
1364  }
1365  }
1366 }
1367 
1369 {
1370  Qt::WindowStates state = windowState();
1371  if (full_screen == state.testFlag(Qt::WindowFullScreen))
1372  return;
1373  Q_EMIT(fullScreenChange(full_screen));
1374 
1375  // when switching to fullscreen, remember visibility state of toolbar
1376  if (full_screen)
1377  toolbar_visible_ = toolbar_->isVisible();
1378  menuBar()->setVisible(!full_screen);
1379  toolbar_->setVisible(!full_screen && toolbar_visible_);
1380  statusBar()->setVisible(!full_screen);
1381  setHideButtonVisibility(!full_screen);
1382 
1383  if (full_screen)
1384  setWindowState(state | Qt::WindowFullScreen);
1385  else
1386  setWindowState(state & ~Qt::WindowFullScreen);
1387  show();
1388 }
1389 
1391 {
1392  setFullScreen(false);
1393 }
1394 
1395 QDockWidget* VisualizationFrame::addPanelByName(const QString& name,
1396  const QString& class_id,
1397  Qt::DockWidgetArea area,
1398  bool floating)
1399 {
1400  QString error;
1401  Panel* panel = panel_factory_->make(class_id, &error);
1402  if (!panel)
1403  {
1404  panel = new FailedPanel(class_id, error);
1405  }
1406  panel->setName(name);
1407  connect(panel, &Panel::configChanged, this,
1408  &VisualizationFrame::VisualizationFrame::setDisplayConfigModified);
1409 
1410  PanelRecord record;
1411  record.dock = addPane(name, panel, area, floating);
1412  record.panel = panel;
1413  record.name = name;
1414  record.delete_action = delete_view_menu_->addAction(name, this, &VisualizationFrame::onDeletePanel);
1415  connect(record.dock, &QObject::destroyed, this,
1416  &VisualizationFrame::VisualizationFrame::onPanelDeleted);
1417  custom_panels_.append(record);
1418  delete_view_menu_->setEnabled(true);
1419 
1420  record.panel->initialize(manager_);
1421 
1422  record.dock->setIcon(panel_factory_->getIcon(class_id));
1423 
1424  return record.dock;
1425 }
1426 
1428 VisualizationFrame::addPane(const QString& name, QWidget* panel, Qt::DockWidgetArea area, bool floating)
1429 {
1430  PanelDockWidget* dock;
1431  dock = new PanelDockWidget(name);
1432  addDockWidget(area, dock);
1433 
1434  dock->setContentWidget(panel);
1435  dock->setFloating(floating);
1436  dock->setObjectName(name); // QMainWindow::saveState() needs objectName to be set.
1437 
1438  // we want to know when that panel becomes visible
1439  connect(dock, &PanelDockWidget::visibilityChanged, this,
1441  connect(this, &VisualizationFrame::VisualizationFrame::fullScreenChange, dock,
1443 
1444  QAction* toggle_action = dock->toggleViewAction();
1445  view_menu_->addAction(toggle_action);
1446 
1447  connect(toggle_action, &QAction::triggered, this,
1448  &VisualizationFrame::VisualizationFrame::setDisplayConfigModified);
1449  connect(dock, &PanelDockWidget::closed, this,
1450  &VisualizationFrame::VisualizationFrame::setDisplayConfigModified);
1451 
1452  dock->installEventFilter(geom_change_detector_);
1453 
1454  // repair/update visibility status
1455  hideLeftDock(area == Qt::LeftDockWidgetArea ? false : hide_left_dock_button_->isChecked());
1456  hideRightDock(area == Qt::RightDockWidgetArea ? false : hide_right_dock_button_->isChecked());
1457 
1458  return dock;
1459 }
1460 
1461 } // end namespace rviz
ros::init_options::AnonymousName
AnonymousName
rviz::ToolManager::getToolClasses
QStringList getToolClasses()
Definition: tool_manager.cpp:303
rviz::Panel::configChanged
void configChanged()
Subclasses must emit this whenever a configuration change happens.
panel_dock_widget.h
rviz::VisualizationFrame::indicateToolIsCurrent
void indicateToolIsCurrent(Tool *tool)
Mark the given tool as the current one.
Definition: visualization_frame.cpp:1261
rviz::VisualizationFrame::home_dir_
std::string home_dir_
Definition: visualization_frame.h:341
rviz::ToolManager::toolAdded
void toolAdded(Tool *)
Emitted by addTool() after the tool is added to the list of tools.
rviz::VisualizationFrame::closeEvent
void closeEvent(QCloseEvent *event) override
Definition: visualization_frame.cpp:196
rviz::VisualizationFrame::showHelpPanel
void showHelpPanel()
Definition: visualization_frame.cpp:1270
rviz::VisualizationFrame::config_dir_
std::string config_dir_
Definition: visualization_frame.h:335
rviz::VisualizationManager::statusUpdate
void statusUpdate(const QString &message)
Emitted during file-loading and initialization to indicate progress.
rviz::VisualizationFrame::splash_
QSplashScreen * splash_
Definition: visualization_frame.h:359
env_config.h
ros::package::getPath
ROSLIB_DECL std::string getPath(const std::string &package_name)
rviz::ToolManager
Definition: tool_manager.h:48
rviz::VisualizationFrame::updateRecentConfigMenu
void updateRecentConfigMenu()
Definition: visualization_frame.cpp:677
rviz::VisualizationFrame::manager_
VisualizationManager * manager_
Definition: visualization_frame.h:353
rviz::ToolManager::toolRemoved
void toolRemoved(Tool *)
rviz::Tool
Definition: tool.h:56
rviz::Config::isValid
bool isValid() const
Returns true if the internal Node reference is valid, false if not. Same as (getType() !...
Definition: config.cpp:307
rviz::VisualizationFrame::saveWindowGeometry
void saveWindowGeometry(Config config)
Definition: visualization_frame.cpp:929
rviz::VisualizationFrame::onDockPanelVisibilityChange
virtual void onDockPanelVisibilityChange(bool visible)
Definition: visualization_frame.cpp:604
rviz::YamlConfigReader::error
bool error()
Return true if the latest readFile() or readString() call had an error.
Definition: yaml_config_reader.cpp:108
rviz::VisualizationFrame::file_menu_
QMenu * file_menu_
Definition: visualization_frame.h:345
rviz::Panel
Definition: panel.h:41
rviz::VisualizationFrame::toolbar_actions_
QActionGroup * toolbar_actions_
Definition: visualization_frame.h:364
rviz::VisualizationFrame::setApp
void setApp(QApplication *app)
Definition: visualization_frame.cpp:169
ros::init
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
initialization.h
rviz::PanelFactory
Definition: panel_factory.h:37
rviz::VisualizationFrame::setFullScreen
void setFullScreen(bool full_screen)
Set full screen mode.
Definition: visualization_frame.cpp:1368
rviz::VisualizationManager
The VisualizationManager class is the central manager class of rviz, holding all the Displays,...
Definition: visualization_manager.h:96
rviz::VisualizationFrame::onButtonStyleTool
void onButtonStyleTool(QAction *button_style_tool_menu_action)
Change the button style of the toolbar.
Definition: visualization_frame.cpp:1225
screenshot_dialog.h
rviz::VisualizationFrame::hideRightDock
void hideRightDock(bool hide)
Definition: visualization_frame.cpp:598
rviz::VisualizationFrame::onPanelDeleted
void onPanelDeleted(QObject *dock)
Definition: visualization_frame.cpp:1331
rviz::VisualizationManager::escapePressed
void escapePressed()
Emitted when ESC key is pressed.
rviz::ScreenshotDialog::savedInDirectory
void savedInDirectory(const QString &directory)
Emitted when the user saves a file.
rviz::VisualizationManager::load
void load(const Config &config)
Load the properties of each Display and most editable rviz data.
Definition: visualization_manager.cpp:450
rviz::VisualizationFrame::save
virtual void save(Config config)
Save the properties of each subsystem and most editable rviz data.
Definition: visualization_frame.cpp:855
rviz::VisualizationFrame::onSaveAs
void onSaveAs()
Definition: visualization_frame.cpp:1117
rviz::LoadingDialog
Definition: loading_dialog.h:39
rviz::VisualizationFrame::package_path_
std::string package_path_
Definition: visualization_frame.h:355
rviz::VisualizationFrame::custom_panels_
QList< PanelRecord > custom_panels_
Definition: visualization_frame.h:382
rviz::VisualizationFrame::setHideButtonVisibility
void setHideButtonVisibility(bool visible)
Hide or show the hide-dock buttons.
Definition: visualization_frame.cpp:586
rviz::PanelDockWidget
Dock widget class for docking widgets into VisualizationFrame.
Definition: panel_dock_widget.h:46
rviz::VisualizationFrame::geom_change_detector_
WidgetGeometryChangeDetector * geom_change_detector_
Definition: visualization_frame.h:388
rviz::VisualizationFrame::openNewToolDialog
void openNewToolDialog()
Definition: visualization_frame.cpp:660
rviz::VisualizationFrame::markLoadingDone
void markLoadingDone()
Set loading_ to false.
Definition: visualization_frame.cpp:795
rviz::VisualizationFrame::onToolbarRemoveTool
void onToolbarRemoveTool(QAction *remove_tool_menu_action)
Remove a the tool whose name is given by remove_tool_menu_action->text().
Definition: visualization_frame.cpp:1211
init.h
rviz::VisualizationFrame::toolbar_
QToolBar * toolbar_
Definition: visualization_frame.h:351
rviz::VisualizationFrame::configureToolbars
void configureToolbars(const Config &config)
Applies the user defined toolbar configuration from the given config node.
Definition: visualization_frame.cpp:915
loading_dialog.h
rviz::Config::listLength
int listLength() const
Returns the length of the List in this Node, or 0 if this Node does not have type List.
Definition: config.cpp:324
rviz::VisualizationFrame::delete_view_menu_
QMenu * delete_view_menu_
Definition: visualization_frame.h:348
rviz::VisualizationFrame::show_choose_new_master_option_
bool show_choose_new_master_option_
Definition: visualization_frame.h:367
rviz::VisualizationFrame::setDisplayConfigModified
void setDisplayConfigModified()
Call this to let the frame know that something that would get saved in the display config has changed...
Definition: visualization_frame.cpp:805
rviz::YamlConfigReader::errorMessage
QString errorMessage()
Return an error message if the latest read call had an error, or the empty string if not.
Definition: yaml_config_reader.cpp:113
selection_manager.h
rviz::VisualizationFrame::onDeletePanel
void onDeletePanel()
Delete a panel widget.
Definition: visualization_frame.cpp:1348
rviz::VisualizationFrame::setHelpPath
void setHelpPath(const QString &help_path)
Set the path to the help file. Should contain HTML. Default is a file in the RViz package.
Definition: visualization_frame.cpp:232
rviz::VisualizationFrame::leaveEvent
void leaveEvent(QEvent *event) override
Definition: visualization_frame.cpp:208
rviz::VisualizationFrame::setStatus
void setStatus(const QString &message) override
Definition: visualization_frame.cpp:174
rviz::VisualizationFrame::onSave
void onSave()
Definition: visualization_frame.cpp:1090
rviz::VisualizationFrame::PanelRecord::panel
Panel * panel
Definition: visualization_frame.h:376
rviz::VisualizationFrame::last_fps_calc_time_
ros::WallTime last_fps_calc_time_
Definition: visualization_frame.h:398
rviz::VisualizationFrame::remove_tool_menu_
QMenu * remove_tool_menu_
Definition: visualization_frame.h:385
rviz::VisualizationFrame::initToolbars
void initToolbars()
Sets up the top toolbar with QToolbuttions for adding/deleting tools and modifiying the tool view.
Definition: visualization_frame.cpp:503
rviz::VisualizationFrame::recent_configs_
D_string recent_configs_
Definition: visualization_frame.h:362
rviz::VisualizationFrame::hide_left_dock_button_
QToolButton * hide_left_dock_button_
Definition: visualization_frame.h:369
rviz::loadPixmap
QPixmap loadPixmap(const QString &url, bool fill_cache)
Definition: load_resource.cpp:65
rviz::VisualizationFrame::onHelpWiki
void onHelpWiki()
Definition: visualization_frame.cpp:1293
rviz::VisualizationFrame::addPane
PanelDockWidget * addPane(const QString &name, QWidget *panel, Qt::DockWidgetArea area=Qt::LeftDockWidgetArea, bool floating=false) override
Definition: visualization_frame.cpp:1428
rviz::VisualizationFrame::updateFps
void updateFps()
Definition: visualization_frame.cpp:179
rviz::VisualizationFrame::onToolNameChanged
void onToolNameChanged(const QString &name)
React to name changes of a tool, updating the name of the associated QAction.
Definition: visualization_frame.cpp:1190
tool.h
rviz::VisualizationFrame::PanelRecord::delete_action
QAction * delete_action
Definition: visualization_frame.h:380
rviz::VisualizationFrame::markRecentConfig
void markRecentConfig(const std::string &path)
Definition: visualization_frame.cpp:706
rviz::PluginlibFactory::getIcon
QIcon getIcon(const QString &class_id) const override
Definition: pluginlib_factory.h:130
rviz::VisualizationFrame::tool_to_action_map_
std::map< Tool *, QAction * > tool_to_action_map_
Definition: visualization_frame.h:366
rviz::VisualizationFrame::saveDisplayConfig
bool saveDisplayConfig(const QString &path)
Save display and other settings to the given file.
Definition: visualization_frame.cpp:833
rviz::VisualizationManager::getToolManager
ToolManager * getToolManager() const override
Return a pointer to the ToolManager.
Definition: visualization_manager.h:264
rviz::VisualizationFrame::saveToolbars
void saveToolbars(Config config)
Saves the user configuration of the toolbar to the config node.
Definition: visualization_frame.cpp:924
rviz::VisualizationFrame::loading_
bool loading_
True just when loading a display config file, false all other times.
Definition: visualization_frame.h:389
rviz::WidgetGeometryChangeDetector::changed
void changed()
This signal is emitted whenever any filtered events are detected.
displays_panel.h
rviz::YamlConfigWriter::errorMessage
QString errorMessage()
Return an error message if the latest write call had an error, or the empty string if there was no er...
Definition: yaml_config_writer.cpp:104
rviz::VisualizationFrame::last_config_dir_
std::string last_config_dir_
Definition: visualization_frame.h:339
console.h
yaml_config_writer.h
rviz::VisualizationFrame::PanelRecord::name
QString name
Definition: visualization_frame.h:378
yaml_config_reader.h
rviz::ScreenshotDialog
A dialog for grabbing a screen shot.
Definition: screenshot_dialog.h:52
rviz::RenderPanel::initialize
void initialize(Ogre::SceneManager *scene_manager, DisplayContext *manager)
Definition: render_panel.cpp:77
rviz::VisualizationManager::setHelpPath
virtual void setHelpPath(const QString &help_path)
Definition: visualization_manager.h:360
rviz::VisualizationFrame::setShowChooseNewMaster
void setShowChooseNewMaster(bool show)
Call this before initialize() to have it take effect.
Definition: visualization_frame.cpp:227
selection_panel.h
rviz::VisualizationFrame::onHelpAbout
void onHelpAbout()
Definition: visualization_frame.cpp:1298
rviz::VisualizationFrame::loadWindowGeometry
void loadWindowGeometry(const Config &config)
Definition: visualization_frame.cpp:873
rviz::Config::List
@ List
Definition: config.h:151
rviz::ToolManager::getTool
Tool * 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...
Definition: tool_manager.cpp:194
rviz::VisualizationFrame::onOpen
void onOpen()
Definition: visualization_frame.cpp:1067
rviz::VisualizationFrame::reset
void reset()
Definition: visualization_frame.cpp:213
rviz::Preferences
Definition: preferences.h:35
rviz::VisualizationFrame::loadPanels
void loadPanels(const Config &config)
Loads custom panels from the given config node.
Definition: visualization_frame.cpp:951
preferences.h
rviz::VisualizationManager::startUpdate
void startUpdate()
Start timers. Creates and starts the update and idle timers, both set to 30Hz (33ms).
Definition: visualization_manager.cpp:278
time_panel.h
rviz::VisualizationFrame::frame_count_
int frame_count_
Definition: visualization_frame.h:397
rviz::VisualizationFrame::hideLeftDock
void hideLeftDock(bool hide)
Definition: visualization_frame.cpp:592
rviz::VisualizationFrame::onDockPanelChange
void onDockPanelChange()
Definition: visualization_frame.cpp:1317
rviz::ToolManager::removeTool
void removeTool(int index)
Definition: tool_manager.cpp:271
rviz
Definition: add_display_dialog.cpp:54
rviz::VisualizationFrame::help_path_
QString help_path_
Definition: visualization_frame.h:356
rviz::VisualizationManager::resetTime
void resetTime()
Resets the wall and ROS elapsed time to zero and calls resetDisplays().
Definition: visualization_manager.cpp:423
rviz::VisualizationFrame::loadDisplayConfigHelper
bool loadDisplayConfigHelper(const std::string &full_path, const bool discard_changes=false)
Load display and other settings from the given full file path.
Definition: visualization_frame.cpp:752
rviz::Tool::getName
QString getName() const
Definition: tool.h:124
rviz::ToolManager::toolChanged
void toolChanged(Tool *)
Emitted by setCurrentTool() after the newly chosen tool is activated.
rviz::VisualizationFrame::savePanels
void savePanels(Config config)
Saves custom panels to the given config node.
Definition: visualization_frame.cpp:987
ros::WallTime::now
static WallTime now()
rviz::VisualizationFrame::savePreferences
void savePreferences(Config config)
Definition: visualization_frame.cpp:1003
ros::isInitialized
ROSCPP_DECL bool isInitialized()
rviz::VisualizationFrame::error_message_
QString error_message_
Error message (if any) from most recent saveDisplayConfig() call.
Definition: visualization_frame.h:400
rviz::PanelDockWidget::closed
void closed()
rviz::VisualizationFrame::loadPersistentSettings
void loadPersistentSettings()
Load the "general" config file, which has just the few things which should not be saved with a displa...
Definition: visualization_frame.cpp:404
rviz::SplashScreen
Definition: splash_screen.h:40
rviz::VisualizationFrame::view_menu_
QMenu * view_menu_
Definition: visualization_frame.h:347
rviz::Tool::nameChanged
void nameChanged(const QString &name)
rviz::VisualizationFrame::show_help_action_
QAction * show_help_action_
Definition: visualization_frame.h:333
rviz::VisualizationFrame::displayConfigFileChanged
void displayConfigFileChanged(const QString &fullpath)
Emitted when the config file has changed.
rviz::VisualizationFrame::default_display_config_file_
std::string default_display_config_file_
Definition: visualization_frame.h:338
rviz::LoadingDialog::showMessage
void showMessage(const QString &message)
Definition: loading_dialog.cpp:50
rviz::VisualizationFrame::PanelRecord::dock
PanelDockWidget * dock
Definition: visualization_frame.h:377
rviz::WidgetGeometryChangeDetector
Utility class for watching for events which indicate that widget geometry has changed.
Definition: widget_geometry_change_detector.h:37
rviz::Tool::getIcon
const QIcon & getIcon()
Get the icon of this tool.
Definition: tool.h:177
rviz::VisualizationFrame::loadPreferences
void loadPreferences(const Config &config)
Definition: visualization_frame.cpp:998
new_object_dialog.h
rviz::VisualizationFrame::exitFullScreen
void exitFullScreen()
Exit full screen mode.
Definition: visualization_frame.cpp:1390
rviz::YamlConfigReader::readFile
void readFile(Config &config, const QString &filename)
Read config data from a file. This potentially changes the return value sof error(),...
Definition: yaml_config_reader.cpp:42
rviz::VisualizationManager::initialize
void initialize()
Do initialization that wasn't done in constructor. Initializes tool manager, view manager,...
Definition: visualization_manager.cpp:246
rviz::VisualizationFrame::statusUpdate
void statusUpdate(const QString &message)
Emitted during file-loading and initialization to indicate progress.
rviz::YamlConfigWriter
Definition: yaml_config_writer.h:43
rviz::ClassIdRecordingFactory::make
virtual Type * make(const QString &class_id, QString *error_return=nullptr)
Instantiate and return a instance of a subclass of Type using makeRaw().
Definition: class_id_recording_factory.h:55
rviz::VisualizationFrame::setDisplayConfigFile
void setDisplayConfigFile(const std::string &path)
Set the display config file path.
Definition: visualization_frame.cpp:816
rviz::VisualizationFrame::hide_right_dock_button_
QToolButton * hide_right_dock_button_
Definition: visualization_frame.h:370
rviz::Panel::initialize
void initialize(VisualizationManager *manager)
Definition: panel.cpp:44
rviz::VisualizationFrame::persistent_settings_file_
std::string persistent_settings_file_
Definition: visualization_frame.h:336
rviz::VisualizationFrame::original_status_bar_
QStatusBar * original_status_bar_
Definition: visualization_frame.h:395
failed_panel.h
CONFIG_EXTENSION_WILDCARD
#define CONFIG_EXTENSION_WILDCARD
Definition: visualization_frame.cpp:101
app
app
rviz::YamlConfigWriter::error
bool error()
Return true if the latest write operation had an error.
Definition: yaml_config_writer.cpp:99
package.h
help_panel.h
rviz::Config::listAppendNew
Config listAppendNew()
Ensure the referenced Node is of type List, append a new Empty Node to the end of the list,...
Definition: config.cpp:341
rviz::VisualizationFrame::recent_configs_menu_
QMenu * recent_configs_menu_
Definition: visualization_frame.h:346
rviz::VisualizationFrame::initConfigs
void initConfigs()
Initialize the default config directory (~/.rviz) and set up the persistent_settings_file_ and displa...
Definition: visualization_frame.cpp:382
rviz::VisualizationFrame::panel_factory_
PanelFactory * panel_factory_
Definition: visualization_frame.h:372
rviz::ToolManager::addTool
Tool * addTool(const QString &tool_class_lookup_name)
Create a tool by class lookup name, add it to the list, and return it.
Definition: tool_manager.cpp:223
rviz::VisualizationFrame::onToolbarActionTriggered
void onToolbarActionTriggered(QAction *action)
Looks up the Tool for this action and calls VisualizationManager::setCurrentTool().
Definition: visualization_frame.cpp:1201
rviz::VisualizationFrame::render_panel_
RenderPanel * render_panel_
Definition: visualization_frame.h:331
visualization_manager.h
rviz::VisualizationFrame::onRecentConfigSelected
void onRecentConfigSelected()
Definition: visualization_frame.cpp:1154
render_panel.h
rviz::VisualizationFrame::action_to_tool_map_
std::map< QAction *, Tool * > action_to_tool_map_
Definition: visualization_frame.h:365
rviz::YamlConfigReader
Definition: yaml_config_reader.h:43
rviz::ToolManager::getFactory
PluginlibFactory< Tool > * getFactory()
Definition: tool_manager.h:131
rviz::VisualizationFrame::removeTool
void removeTool(Tool *tool)
Remove the given tool from the frame's toolbar.
Definition: visualization_frame.cpp:1231
rviz::VisualizationFrame::getParentWindow
QWidget * getParentWindow() override
Definition: visualization_frame.cpp:1326
rviz::Config::listChildAt
Config listChildAt(int i) const
Return the i'th child in the list, if the referenced Node has type List. Returns an Invalid Config if...
Definition: config.cpp:329
rviz::VisualizationFrame::initialized_
bool initialized_
Definition: visualization_frame.h:387
rviz::Panel::load
virtual void load(const Config &config)
Override to load configuration data. This version loads the name of the panel.
Definition: panel.cpp:56
rviz::VisualizationFrame::changeMaster
void changeMaster()
Save the current state and quit with exit code 255 to signal the wrapper that we would like to restar...
Definition: visualization_frame.cpp:219
rviz::VisualizationFrame::refreshTool
void refreshTool(Tool *tool)
Refresh the given tool in this frame's' toolbar.
Definition: visualization_frame.cpp:1254
rviz::VisualizationManager::stopUpdate
void stopUpdate()
Definition: visualization_manager.cpp:284
rviz::VisualizationFrame::post_load_timer_
QTimer * post_load_timer_
Definition: visualization_frame.h:390
rviz::NewObjectDialog
Definition: new_object_dialog.h:46
rviz::VisualizationFrame::VisualizationFrame
VisualizationFrame(QWidget *parent=nullptr)
Definition: visualization_frame.cpp:106
rviz::VisualizationManager::configChanged
void configChanged()
Emitted whenever the display configuration changes.
rviz::VisualizationFrame::openPreferencesDialog
void openPreferencesDialog()
Definition: visualization_frame.cpp:626
preferences_dialog.h
RECENT_CONFIG_COUNT
#define RECENT_CONFIG_COUNT
Definition: visualization_frame.cpp:102
rviz::VisualizationFrame::addTool
void addTool(Tool *tool)
Add the given tool to this frame's toolbar.
Definition: visualization_frame.cpp:1174
rviz::Config::mapGetString
bool mapGetString(const QString &key, QString *value_out) const
Convenience function for looking up a named string.
Definition: config.cpp:288
rviz::VisualizationFrame::savePersistentSettings
void savePersistentSettings()
Save the "general" config file, which has just the few things which should not be saved with a displa...
Definition: visualization_frame.cpp:433
rviz::Panel::setName
virtual void setName(const QString &name)
Definition: panel.h:65
ROS_ERROR
#define ROS_ERROR(...)
rviz::VisualizationFrame::~VisualizationFrame
~VisualizationFrame() override
Definition: visualization_frame.cpp:159
rviz::VisualizationFrame::preferences_
boost::shared_ptr< Preferences > preferences_
Definition: visualization_frame.h:343
rviz::VisualizationFrame::PanelRecord
Definition: visualization_frame.h:374
visualization_frame.h
rviz::VisualizationManager::preUpdate
void preUpdate()
Emitted before updating all Displays.
rviz::VisualizationFrame::setSplashPath
void setSplashPath(const QString &splash_path)
Set the path to the "splash" image file. This image is shown during initialization and loading of the...
Definition: visualization_frame.cpp:238
rviz::VisualizationFrame::toolbar_separator_
QAction * toolbar_separator_
Definition: visualization_frame.h:384
rviz::VisualizationFrame::hideDockImpl
void hideDockImpl(Qt::DockWidgetArea area, bool hide)
Definition: visualization_frame.cpp:563
rviz::FailedPanel
Definition: failed_panel.h:38
rviz::VisualizationFrame::display_config_file_
std::string display_config_file_
Definition: visualization_frame.h:337
load_resource.h
rviz::VisualizationFrame::setImageSaveDirectory
void setImageSaveDirectory(const QString &directory)
Set the default directory in which to save screenshot images.
Definition: visualization_frame.cpp:800
rviz::VisualizationFrame::getErrorMessage
QString getErrorMessage() const
Definition: visualization_frame.h:155
CONFIG_EXTENSION
#define CONFIG_EXTENSION
Definition: visualization_frame.cpp:100
rviz::PanelDockWidget::overrideVisibility
virtual void overrideVisibility(bool hide)
Definition: panel_dock_widget.cpp:177
DurationBase< WallDuration >::toSec
double toSec() const
rviz::VisualizationFrame::fps_label_
QLabel * fps_label_
Definition: visualization_frame.h:394
rviz::YamlConfigWriter::writeFile
void writeFile(const Config &config, const QString &filename)
Write config data to a file. This potentially changes the return values of error() and statusMessage(...
Definition: yaml_config_writer.cpp:45
tool_manager.h
rviz::RenderPanel
Definition: render_panel.h:74
ros::WallDuration
rviz::VisualizationFrame::onHelpDestroyed
void onHelpDestroyed()
Definition: visualization_frame.cpp:1288
widget_geometry_change_detector.h
rviz::VisualizationManager::getSceneManager
Ogre::SceneManager * getSceneManager() const override
Returns the Ogre::SceneManager used for the main RenderPanel.
Definition: visualization_manager.h:199
rviz::ToolManager::toolRefreshed
void toolRefreshed(Tool *)
Emitted by refreshTool() to gedraw the tool's icon in the toolbar'.
rviz::VisualizationFrame::loadDisplayConfig
void loadDisplayConfig(const QString &path)
Load display and other settings from the given file.
Definition: visualization_frame.cpp:724
rviz::VisualizationFrame::initMenus
void initMenus()
Definition: visualization_frame.cpp:453
rviz::ToolManager::setCurrentTool
void setCurrentTool(Tool *tool)
Set the current tool. The current tool is given all mouse and keyboard events which VisualizationMana...
Definition: tool_manager.cpp:172
rviz::VisualizationFrame::last_image_dir_
std::string last_image_dir_
Definition: visualization_frame.h:340
rviz::VisualizationFrame::status_label_
QLabel * status_label_
Definition: visualization_frame.h:393
rviz::get_version
std::string get_version()
rviz::PanelDockWidget::setIcon
void setIcon(const QIcon &icon)
Definition: panel_dock_widget.cpp:80
rviz::VisualizationFrame::openNewPanelDialog
void openNewPanelDialog()
Definition: visualization_frame.cpp:639
config
config
rviz::PreferencesDialog
Definition: preferences_dialog.h:44
tool_properties_panel.h
rviz::VisualizationFrame::prepareToExit
bool prepareToExit()
Check for unsaved changes, prompt to save config, etc.
Definition: visualization_frame.cpp:1008
rviz::VisualizationManager::save
void save(Config config) const
Save the properties of each Display and most editable rviz data.
Definition: visualization_manager.cpp:466
panel_factory.h
rviz::VisualizationFrame::addPanelByName
QDockWidget * addPanelByName(const QString &name, const QString &class_lookup_name, Qt::DockWidgetArea area=Qt::LeftDockWidgetArea, bool floating=false)
Definition: visualization_frame.cpp:1395
rviz::VisualizationFrame::fullScreenChange
void fullScreenChange(bool hidden)
Emitted when the interface enters or leaves full screen mode.
rviz::Config::setValue
void setValue(const QVariant &value)
Ensures this is a valid Config object, sets the type to Value then sets the value.
Definition: config.cpp:312
rviz::Config
Configuration data storage class.
Definition: config.h:124
rviz::PanelDockWidget::setContentWidget
void setContentWidget(QWidget *child)
Definition: panel_dock_widget.cpp:114
views_panel.h
splash_screen.h
rviz::Config::getValue
QVariant getValue() const
If this config object is valid and is a Value type, this returns its value. Otherwise it returns an i...
Definition: config.cpp:319
rviz::get_distro
std::string get_distro()
rviz::VisualizationFrame::toolbar_visible_
bool toolbar_visible_
Indicates if the toolbar should be visible outside of fullscreen mode.
Definition: visualization_frame.h:403
rviz::VisualizationFrame::initialize
void initialize(const QString &display_config_file="")
Initialize the visualizer. Creates the VisualizationManager.
Definition: visualization_frame.cpp:243
rviz::VisualizationFrame::splash_path_
QString splash_path_
Definition: visualization_frame.h:357
rviz::VisualizationFrame::load
virtual void load(const Config &config)
Load the properties of all subsystems from the given Config.
Definition: visualization_frame.cpp:864
rviz::VisualizationFrame::onSaveImage
void onSaveImage()
Definition: visualization_frame.cpp:1145


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Thu May 16 2024 02:30:49