8 setObjectName(
"Display");
16 QHBoxLayout *color_mode_layout =
new QHBoxLayout;
17 color_mode_layout->addWidget(
new QLabel(
"Color by:"));
25 QHBoxLayout *display_mode_layout =
new QHBoxLayout;
26 display_mode_layout->addWidget(
new QLabel(
"Display mode:"));
35 QHBoxLayout *cylinder_size_layout =
new QHBoxLayout;
36 cylinder_size_layout->addWidget(
new QLabel(
"Cylinder size:"));
46 QHBoxLayout *wire_size_layout =
new QHBoxLayout;
47 wire_size_layout->addWidget(
new QLabel(
"Wire size:"));
57 QHBoxLayout *axis_size_layout =
new QHBoxLayout;
58 axis_size_layout->addWidget(
new QLabel(
"Axis size:"));
83 labels_container_layout->addWidget(
new QLabel(
"Labels type:"), 0, 0);
84 labels_container_layout->addWidget(
label_type_, 0, 1);
85 labels_container_layout->addWidget(
new QLabel(
"Labels size:"));
102 range_of_layers_layout->addWidget(
new QLabel(
"First layer:"), 0, 0);
104 range_of_layers_layout->addWidget(
new QLabel(
"Last layer:"), 1, 0);
105 range_of_layers_layout->addWidget(
last_layer_, 1, 1);
114 QHBoxLayout *buttons =
new QHBoxLayout;
118 QVBoxLayout *scroll_widget_layout =
new QVBoxLayout();
119 QWidget *scroll_widget =
new QWidget;
120 scroll_widget->setLayout(scroll_widget_layout);
121 QScrollArea *scroll_area =
new QScrollArea;
122 scroll_area->setWidget(scroll_widget);
123 scroll_area->setWidgetResizable(
true);
124 scroll_area->setFrameShape(QFrame::NoFrame);
125 QVBoxLayout* main_layout =
new QVBoxLayout(
this);
126 main_layout->addWidget(scroll_area);
128 scroll_widget_layout->addLayout(color_mode_layout);
129 scroll_widget_layout->addLayout(display_mode_layout);
138 scroll_widget_layout->addStretch(1);
140 main_layout->addLayout(buttons);
181 "RViz panel " <<
getName().toStdString() <<
" connected to the service " << client.
getService());
187 "RViz panel " <<
getName().toStdString() <<
" could not connect to ROS service: " << client.
getService());
195 Q_EMIT setEnabled(
false);
200 Q_EMIT setEnabled(
true);
257 Q_EMIT setEnabled(
false);
260 color.setModal(
true);
262 QColor old_color((
int)(
params_.request.mesh_color.r * 255),
263 (
int)(
params_.request.mesh_color.g * 255),
264 (
int)(
params_.request.mesh_color.b * 255),
265 (
int)(
params_.request.mesh_color.a * 255));
266 QColor rgba = color.getColor(old_color,
this,
"Mesh color", QColorDialog::ShowAlphaChannel);
270 Q_EMIT setEnabled(
true);
274 params_.request.mesh_color.r = rgba.red() / 255.0;
275 params_.request.mesh_color.g = rgba.green() / 255.0;
276 params_.request.mesh_color.b = rgba.blue() / 255.0;
277 params_.request.mesh_color.a = rgba.alpha() / 255.0;
279 ram_display::UpdateMeshColor srv;
280 srv.request.color =
params_.request.mesh_color;
285 Q_EMIT setEnabled(
true);
291 Q_EMIT setEnabled(
false);
311 if (!
params_.response.error.empty())
314 QString::fromStdString(
params_.response.error),
318 Q_EMIT setEnabled(
true);
323 Q_EMIT setEnabled(
false);
331 ram_display::DeleteTrajectory delete_traj;
339 Q_EMIT setEnabled(
true);
366 bool tmp_bool(
false);
368 float tmp_float(0.01);
370 if (config.
mapGetInt(
"color_mode", &tmp_int))
373 if (config.
mapGetInt(
"display_mode", &tmp_int))
376 if (config.
mapGetFloat(
"cylinder_size", &tmp_float))
382 if (config.
mapGetFloat(
"label_text_size", &tmp_float))
389 if (config.
mapGetInt(
"display_pose_layer", &tmp_int))
392 if (config.
mapGetBool(
"display_labels", &tmp_bool))
399 if (config.
mapGetBool(
"range_of_layers", &tmp_bool))
406 if (config.
mapGetInt(
"first_layer", &tmp_int))
409 if (config.
mapGetInt(
"last_layer", &tmp_int))
413 params_.request.mesh_color.r = tmp_float;
415 params_.request.mesh_color.r = 0.7;
418 params_.request.mesh_color.g = tmp_float;
420 params_.request.mesh_color.g = 0.7;
423 params_.request.mesh_color.b = tmp_float;
425 params_.request.mesh_color.b = 0.7;
428 params_.request.mesh_color.a = tmp_float;
430 params_.request.mesh_color.a = 0.75;
446 Q_EMIT setEnabled(
false);
449 Q_EMIT setEnabled(
true);
480 const QString message,
481 const QString info_msg)
483 bool old_state(isEnabled());
484 Q_EMIT setEnabled(
false);
486 msg_box.setWindowTitle(title);
487 msg_box.setText(message);
488 msg_box.setInformativeText(info_msg);
489 msg_box.setIcon(QMessageBox::Critical);
490 msg_box.setStandardButtons(QMessageBox::Ok);
492 Q_EMIT setEnabled(old_state);
QWidget * axis_size_widget_
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
void updateInternalParameters()
ram_display::DisplayTrajectory params_
void connectToService(ros::ServiceClient &client)
void sendLoadedInformation()
void sendDisplayInformation()
void displayErrorMessageBox(const QString, const QString, const QString)
QDoubleSpinBox * cylinder_size_
bool call(MReq &req, MRes &res)
bool mapGetFloat(const QString &key, float *value_out) const
QWidget * range_of_layers_container_
ros::ServiceClient delete_client_
QDoubleSpinBox * wire_size_
QWidget * wire_size_widget_
void displayModeChanged()
ros::ServiceClient update_mesh_color_client_
QWidget * labels_container_
QWidget * cylinder_size_widget_
void mapSetValue(const QString &key, QVariant value)
QPushButton * display_button_
QComboBox * display_mode_
ros::ServiceClient display_client_
QCheckBox * display_labels_
virtual void setName(const QString &name)
QDoubleSpinBox * axis_size_
bool waitForExistence(ros::Duration timeout=ros::Duration(-1))
void load(const rviz::Config &config)
void save(rviz::Config config) const
bool mapGetBool(const QString &key, bool *value_out) const
virtual QString getName() const
Display(QWidget *parent=NULL)
bool mapGetInt(const QString &key, int *value_out) const
QCheckBox * range_of_layers_
#define ROS_INFO_STREAM(args)
QPushButton * mesh_color_
void enableRangeLimitsBox()
void sendDeleteInformationButtonHandler()
virtual void save(Config config) const
void sendDeleteInformation()
#define ROS_ERROR_STREAM(args)
virtual void load(const Config &config)
void displayErrorBoxHandler(const QString title, const QString message, const QString info_msg)
void sendDisplayInformationButtonHandler()
ROSCPP_DECL void spinOnce()
QDoubleSpinBox * label_text_size_
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
QPushButton * delete_button_