Go to the documentation of this file.
33 #include <OGRE/OgreLogManager.h>
35 #include <QCloseEvent>
36 #include <QFileDialog>
39 #include <boost/program_options.hpp>
55 setObjectName(
"RViz");
60 Ogre::LogManager* log_manager = Ogre::LogManager::getSingletonPtr();
61 if (log_manager &&
log_)
63 log_manager->destroyLog(
log_);
74 Ogre::LogManager* log_manager = Ogre::LogManager::getSingletonPtr();
77 log_manager =
new Ogre::LogManager();
79 QString filename = QString(
"rqt_rviz_ogre") + (context.
serialNumber() > 1 ? QString::number(context.
serialNumber()) : QString(
"")) + QString(
".log");
80 log_ = log_manager->createLog(filename.toStdString().c_str(),
false,
false, !
ogre_log_);
95 QAction* action =
menu_bar_->findChild<QAction*>(
"actQuit");
97 action->setVisible(
false);
102 widget_->installEventFilter(
this);
114 namespace po = boost::program_options;
118 const int argc = qargv.count();
123 std::vector<QByteArray> argv_array;
124 std::vector<const char *> argv(argc+1);
127 for (
int i = 0; i < argc; ++i)
129 argv_array.push_back(qargv.at(i).toLocal8Bit());
130 argv[i+1] = argv_array[i].constData();
133 po::variables_map vm;
134 po::options_description options;
135 options.add_options()
136 (
"display-config,d", po::value<std::string>(),
"")
142 po::store(po::parse_command_line(argc+1, argv.data(), options), vm);
145 if (vm.count(
"hide-menu"))
151 if (vm.count(
"display-config"))
157 if (vm.count(
"ogre-log"))
163 catch (std::exception& e)
165 ROS_ERROR(
"Error parsing command line: %s", e.what());
180 instance_settings.
contains(
"rviz_config_file"))
182 display_config_ = instance_settings.
value(
"rviz_config_file").toString().toLocal8Bit().constData();;
187 instance_settings.
contains(
"hide_menu"))
206 if (dialog->exec() != QDialog::Accepted)
220 if (watched ==
widget_ && event->type() == QEvent::Close)
227 return QObject::eventFilter(watched, event);
void triggerConfiguration()
virtual void initPlugin(qt_gui_cpp::PluginContext &context)
void SetHide(const bool hide)
Set the hide menu option.
void setValue(const QString &key, const QVariant &value)
virtual void saveSettings(qt_gui_cpp::Settings &plugin_settings, qt_gui_cpp::Settings &instance_settings) const
uint8_t set_from_cmdline_
bool contains(const QString &key) const
rviz::VisualizationFrame * widget_
void addWidget(QWidget *widget)
bool GetHide() const
Get the hide menu option.
std::string GetFile() const
Get the file path entered by the user.
std::string display_config_
bool hasConfiguration() const
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
void displayConfigFileChanged(const QString &fullpath)
QMenuBar * menu_bar_
Pointer to menu bar.
const QStringList & argv() const
qt_gui_cpp::PluginContext * context_
void setSplashPath(const QString &splash_path)
void onDisplayConfigChanged(const QString &fullpath)
void loadDisplayConfig(const QString &path)
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
virtual bool eventFilter(QObject *watched, QEvent *event)
void SetFile(const std::string &file)
Populate the file path line edit.
void initialize(const QString &display_config_file="")
virtual void restoreSettings(const qt_gui_cpp::Settings &plugin_settings, const qt_gui_cpp::Settings &instance_settings)
rqt_rviz
Author(s): Dorian Scholz
autogenerated on Wed Mar 2 2022 00:59:27