mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
clang-tidy: modernize-loop-convert
This commit is contained in:
parent
3fe4436ad7
commit
48f4c025ba
@ -2,6 +2,7 @@
|
|||||||
Checks: '-*,
|
Checks: '-*,
|
||||||
modernize-use-override,
|
modernize-use-override,
|
||||||
modernize-use-using,
|
modernize-use-using,
|
||||||
|
modernize-loop-convert,
|
||||||
'
|
'
|
||||||
HeaderFilterRegex: '.*/moveit/task_constructor/.*\.h'
|
HeaderFilterRegex: '.*/moveit/task_constructor/.*\.h'
|
||||||
AnalyzeTemporaryDtors: false
|
AnalyzeTemporaryDtors: false
|
||||||
|
|||||||
@ -98,11 +98,11 @@ void RemoteTaskModel::Node::setProperties(const std::vector<moveit_task_construc
|
|||||||
// insert properties in same order as reported in description
|
// insert properties in same order as reported in description
|
||||||
rviz::Property* root = property_tree_->getRoot();
|
rviz::Property* root = property_tree_->getRoot();
|
||||||
int index = 0; // current child index in root
|
int index = 0; // current child index in root
|
||||||
for (auto it = props.begin(); it != props.end(); ++it) {
|
for (const auto& prop : props) {
|
||||||
int num = root->numChildren();
|
int num = root->numChildren();
|
||||||
// find first child with name >= it->name
|
// find first child with name >= it->name
|
||||||
int next = index;
|
int next = index;
|
||||||
while (next < num && root->childAt(next)->getName().toStdString() < it->name)
|
while (next < num && root->childAt(next)->getName().toStdString() < prop.name)
|
||||||
++next;
|
++next;
|
||||||
// and remove all children in range [index, next) at once
|
// and remove all children in range [index, next) at once
|
||||||
root->removeChildren(index, next - index);
|
root->removeChildren(index, next - index);
|
||||||
@ -110,10 +110,10 @@ void RemoteTaskModel::Node::setProperties(const std::vector<moveit_task_construc
|
|||||||
|
|
||||||
// if names differ, insert a new child, otherwise reuse existing
|
// if names differ, insert a new child, otherwise reuse existing
|
||||||
rviz::Property* old_child = index < num ? root->childAt(index) : nullptr;
|
rviz::Property* old_child = index < num ? root->childAt(index) : nullptr;
|
||||||
if (old_child && old_child->getName().toStdString() != it->name)
|
if (old_child && old_child->getName().toStdString() != prop.name)
|
||||||
old_child = nullptr;
|
old_child = nullptr;
|
||||||
|
|
||||||
rviz::Property* new_child = createProperty(*it, old_child, scene_, display_context_);
|
rviz::Property* new_child = createProperty(prop, old_child, scene_, display_context_);
|
||||||
if (new_child != old_child)
|
if (new_child != old_child)
|
||||||
root->addChild(new_child, index);
|
root->addChild(new_child, index);
|
||||||
++index;
|
++index;
|
||||||
|
|||||||
@ -282,22 +282,22 @@ void TaskSolutionVisualization::changedTrail() {
|
|||||||
|
|
||||||
void TaskSolutionVisualization::changedRobotAlpha() {
|
void TaskSolutionVisualization::changedRobotAlpha() {
|
||||||
robot_render_->setAlpha(robot_alpha_property_->getFloat());
|
robot_render_->setAlpha(robot_alpha_property_->getFloat());
|
||||||
for (std::size_t i = 0; i < trail_.size(); ++i)
|
for (auto& waypoint : trail_)
|
||||||
trail_[i]->setAlpha(robot_alpha_property_->getFloat());
|
waypoint->setAlpha(robot_alpha_property_->getFloat());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TaskSolutionVisualization::changedRobotVisualEnabled() {
|
void TaskSolutionVisualization::changedRobotVisualEnabled() {
|
||||||
robot_render_->setVisualVisible(robot_visual_enabled_property_->getBool());
|
robot_render_->setVisualVisible(robot_visual_enabled_property_->getBool());
|
||||||
renderCurrentWayPoint();
|
renderCurrentWayPoint();
|
||||||
for (std::size_t i = 0; i < trail_.size(); ++i)
|
for (auto& waypoint : trail_)
|
||||||
trail_[i]->setVisualVisible(robot_visual_enabled_property_->getBool());
|
waypoint->setVisualVisible(robot_visual_enabled_property_->getBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TaskSolutionVisualization::changedRobotCollisionEnabled() {
|
void TaskSolutionVisualization::changedRobotCollisionEnabled() {
|
||||||
robot_render_->setCollisionVisible(robot_collision_enabled_property_->getBool());
|
robot_render_->setCollisionVisible(robot_collision_enabled_property_->getBool());
|
||||||
renderCurrentWayPoint();
|
renderCurrentWayPoint();
|
||||||
for (std::size_t i = 0; i < trail_.size(); ++i)
|
for (auto& waypoint : trail_)
|
||||||
trail_[i]->setCollisionVisible(robot_collision_enabled_property_->getBool());
|
waypoint->setCollisionVisible(robot_collision_enabled_property_->getBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TaskSolutionVisualization::onEnable() {
|
void TaskSolutionVisualization::onEnable() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user