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: '-*,
|
||||
modernize-use-override,
|
||||
modernize-use-using,
|
||||
modernize-loop-convert,
|
||||
'
|
||||
HeaderFilterRegex: '.*/moveit/task_constructor/.*\.h'
|
||||
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
|
||||
rviz::Property* root = property_tree_->getRoot();
|
||||
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();
|
||||
// find first child with name >= it->name
|
||||
int next = index;
|
||||
while (next < num && root->childAt(next)->getName().toStdString() < it->name)
|
||||
while (next < num && root->childAt(next)->getName().toStdString() < prop.name)
|
||||
++next;
|
||||
// and remove all children in range [index, next) at once
|
||||
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
|
||||
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;
|
||||
|
||||
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)
|
||||
root->addChild(new_child, index);
|
||||
++index;
|
||||
|
||||
@ -282,22 +282,22 @@ void TaskSolutionVisualization::changedTrail() {
|
||||
|
||||
void TaskSolutionVisualization::changedRobotAlpha() {
|
||||
robot_render_->setAlpha(robot_alpha_property_->getFloat());
|
||||
for (std::size_t i = 0; i < trail_.size(); ++i)
|
||||
trail_[i]->setAlpha(robot_alpha_property_->getFloat());
|
||||
for (auto& waypoint : trail_)
|
||||
waypoint->setAlpha(robot_alpha_property_->getFloat());
|
||||
}
|
||||
|
||||
void TaskSolutionVisualization::changedRobotVisualEnabled() {
|
||||
robot_render_->setVisualVisible(robot_visual_enabled_property_->getBool());
|
||||
renderCurrentWayPoint();
|
||||
for (std::size_t i = 0; i < trail_.size(); ++i)
|
||||
trail_[i]->setVisualVisible(robot_visual_enabled_property_->getBool());
|
||||
for (auto& waypoint : trail_)
|
||||
waypoint->setVisualVisible(robot_visual_enabled_property_->getBool());
|
||||
}
|
||||
|
||||
void TaskSolutionVisualization::changedRobotCollisionEnabled() {
|
||||
robot_render_->setCollisionVisible(robot_collision_enabled_property_->getBool());
|
||||
renderCurrentWayPoint();
|
||||
for (std::size_t i = 0; i < trail_.size(); ++i)
|
||||
trail_[i]->setCollisionVisible(robot_collision_enabled_property_->getBool());
|
||||
for (auto& waypoint : trail_)
|
||||
waypoint->setCollisionVisible(robot_collision_enabled_property_->getBool());
|
||||
}
|
||||
|
||||
void TaskSolutionVisualization::onEnable() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user