Commit e478b781 authored by Jan Möbius's avatar Jan Möbius
Browse files

Use ranges for Object Iteration to simplify code

parent 06a7744a
......@@ -91,8 +91,7 @@ void IsotropicRemesherPlugin::slotRemeshButtonClicked() {
void IsotropicRemesherPlugin::slotRemesh(){
//read one target objects
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS,DataType(DATA_TRIANGLE_MESH)) ;
o_it != PluginFunctions::objectsEnd(); ++o_it) {
for (auto* o_it : PluginFunctions::objects(PluginFunctions::TARGET_OBJECTS,DataType(DATA_TRIANGLE_MESH)) ) {
//check dataType
if ( o_it->dataType(DATA_TRIANGLE_MESH) ) {
......@@ -117,8 +116,7 @@ void IsotropicRemesherPlugin::threadFinished(QString /*_jobId*/) {
std::cerr << "threadFinished() called" << std::endl;
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS,DataType(DATA_TRIANGLE_MESH)) ;
o_it != PluginFunctions::objectsEnd(); ++o_it) {
for (auto* o_it : PluginFunctions::objects(PluginFunctions::TARGET_OBJECTS,DataType(DATA_TRIANGLE_MESH)) ) {
emit updatedObject( o_it->id(), UPDATE_ALL );
......@@ -139,8 +137,7 @@ void IsotropicRemesherPlugin::slotSetMinLength()
if (!ok)
return;
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS,DataType(DATA_TRIANGLE_MESH)) ;
o_it != PluginFunctions::objectsEnd(); ++o_it) {
for (auto* o_it : PluginFunctions::objects(PluginFunctions::TARGET_OBJECTS,DataType(DATA_TRIANGLE_MESH)) ) {
if (first)
{
......@@ -166,8 +163,7 @@ void IsotropicRemesherPlugin::slotSetMaxLength()
if (!ok)
return;
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS,DataType(DATA_TRIANGLE_MESH)) ;
o_it != PluginFunctions::objectsEnd(); ++o_it) {
for (auto* o_it : PluginFunctions::objects(PluginFunctions::TARGET_OBJECTS,DataType(DATA_TRIANGLE_MESH)) ) {
if (first)
{
......@@ -193,10 +189,7 @@ void IsotropicRemesherPlugin::slotSetMeanLength()
if (!ok)
return;
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS,DataType(DATA_TRIANGLE_MESH)) ;
o_it != PluginFunctions::objectsEnd(); ++o_it) {
for (auto* o_it : PluginFunctions::objects(PluginFunctions::TARGET_OBJECTS,DataType(DATA_TRIANGLE_MESH)) ) {
current += RPC::callFunctionValue<int> ("infomeshobject" , "edgeCount",o_it->id()) *
RPC::callFunctionValue<double>("infomeshobject" , "meanEdgeLength",o_it->id() );
div += RPC::callFunctionValue<int> ("infomeshobject" , "edgeCount",o_it->id() );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment