From 51aa78f35064214ce456f46c19bb490a997a9a16 Mon Sep 17 00:00:00 2001 From: Luca Della Vedova Date: Wed, 29 May 2024 18:21:16 +0800 Subject: [PATCH] Address style issues Signed-off-by: Luca Della Vedova --- .../gui/crowd_sim/agent_profile_table.cpp | 3 ++- rmf_traffic_editor/gui/crowd_sim/condition_dialog.cpp | 11 ++++++----- rmf_traffic_editor/gui/crowd_sim/to_state_dialog.cpp | 3 ++- rmf_traffic_editor/gui/editor.cpp | 3 ++- rmf_traffic_editor/gui/level_table.cpp | 3 ++- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/rmf_traffic_editor/gui/crowd_sim/agent_profile_table.cpp b/rmf_traffic_editor/gui/crowd_sim/agent_profile_table.cpp index f43fd5a15..72eaae670 100644 --- a/rmf_traffic_editor/gui/crowd_sim/agent_profile_table.cpp +++ b/rmf_traffic_editor/gui/crowd_sim/agent_profile_table.cpp @@ -50,7 +50,8 @@ void AgentProfileTab::list_item_in_cache() { auto current_profile = _cache[i]; setItem(i, 0, - new QTableWidgetItem(QString::fromStdString(current_profile.profile_name))); + new QTableWidgetItem(QString::fromStdString( + current_profile.profile_name))); setItem(i, 1, new QTableWidgetItem(QString::number( static_cast(current_profile.profile_class)))); diff --git a/rmf_traffic_editor/gui/crowd_sim/condition_dialog.cpp b/rmf_traffic_editor/gui/crowd_sim/condition_dialog.cpp index 84eedc810..63a7a5b12 100644 --- a/rmf_traffic_editor/gui/crowd_sim/condition_dialog.cpp +++ b/rmf_traffic_editor/gui/crowd_sim/condition_dialog.cpp @@ -65,14 +65,14 @@ ConditionDialog::ConditionDialog( auto root_condition = _current_transition.get_condition(); if (crowd_sim::Condition::GOAL == root_condition->get_type()) { - auto goal_condition = std::dynamic_pointer_cast( - root_condition); + auto goal_condition = + std::dynamic_pointer_cast(root_condition); goal_condition->set_value(temp); } if (crowd_sim::Condition::TIMER == root_condition->get_type()) { - auto timer_condition = std::dynamic_pointer_cast( - root_condition); + auto timer_condition = + std::dynamic_pointer_cast(root_condition); timer_condition->set_value(temp); } } @@ -268,7 +268,8 @@ void ConditionDialog::_construct_leaf_condition_widget( condition_value->setText(QString::number(_condition2ValueD)); std::string condition_label = "condition" + std::to_string(condition_index) + ":"; - condition_hbox->addWidget(new QLabel(QString::fromStdString(condition_label) )); + condition_hbox->addWidget(new QLabel(QString::fromStdString( + condition_label) )); condition_hbox->addWidget(condition_type); condition_hbox->addWidget(condition_value); connect( diff --git a/rmf_traffic_editor/gui/crowd_sim/to_state_dialog.cpp b/rmf_traffic_editor/gui/crowd_sim/to_state_dialog.cpp index 580b38a67..bf330c33e 100644 --- a/rmf_traffic_editor/gui/crowd_sim/to_state_dialog.cpp +++ b/rmf_traffic_editor/gui/crowd_sim/to_state_dialog.cpp @@ -28,7 +28,8 @@ ToStateDialog::ToStateDialog( _to_state_tab = ToStateTab::init_and_make(crowd_sim_impl, transition); if (!_to_state_tab) { - throw std::runtime_error("Failed to initialize ToStateTab in ToStateDialog"); + throw std::runtime_error( + "Failed to initialize ToStateTab in ToStateDialog"); } _to_state_tab->update(); std::string title = "from_state: " + transition.get_from_state(); diff --git a/rmf_traffic_editor/gui/editor.cpp b/rmf_traffic_editor/gui/editor.cpp index 5f6eee540..4b80f05ce 100644 --- a/rmf_traffic_editor/gui/editor.cpp +++ b/rmf_traffic_editor/gui/editor.cpp @@ -477,7 +477,8 @@ void Editor::load_model_names() try { share_dir = - ament_index_cpp::get_package_share_directory("rmf_traffic_editor_assets"); + ament_index_cpp::get_package_share_directory( + "rmf_traffic_editor_assets"); ament_index_cpp::get_resource("rmf_traffic_editor_assets", "assets", diff --git a/rmf_traffic_editor/gui/level_table.cpp b/rmf_traffic_editor/gui/level_table.cpp index d08415399..053f0f894 100644 --- a/rmf_traffic_editor/gui/level_table.cpp +++ b/rmf_traffic_editor/gui/level_table.cpp @@ -95,7 +95,8 @@ void LevelTable::update(Building& building) if (dialog.exec() == QDialog::Accepted) { building.levels[i].name = ui.name_line_edit->text().toStdString(); - building.levels[i].elevation = ui.elevation_line_edit->text().toDouble(); + building.levels[i].elevation = + ui.elevation_line_edit->text().toDouble(); setWindowModified(true); // not sure why, but this doesn't work } }