diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index 0e0135f0e..39585ad16 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -2420,7 +2420,16 @@ bool MainWindow::importMesh(QString fileName) // the user does not want to see the parameter dialog // need to take the default values from the currentGlobalParams else { - //TODO + for (RichParameter& p : prePar){ + QString prefixName = "MeshLab::IO::" + extension.toUpper() + "::"; + if (currentGlobalParams.hasParameter(prefixName + p.name())){ + const RichParameter& cp = currentGlobalParams.getParameterByName(prefixName + p.name()); + p.setValue(cp.value()); + } + else { + qDebug() << "ERROR!!! " + prefixName + p.name() + " not found in global params."; + } + } } } diff --git a/src/meshlabplugins/io_base/baseio.cpp b/src/meshlabplugins/io_base/baseio.cpp index 83092a5f5..c889b5926 100644 --- a/src/meshlabplugins/io_base/baseio.cpp +++ b/src/meshlabplugins/io_base/baseio.cpp @@ -136,7 +136,7 @@ void BaseMeshIOPlugin::initPreOpenParameter(const QString &formatName, RichParam parlst.addParam(RichFloat("angle", 85.0, "Angle limit for face culling", "short")); } if (formatName.toUpper() == tr("STL")) { - parlst.addParam(RichBool(stlUnifyParName(), true, "Unify Duplicated Vertices in STL files", "The STL format is not an vertex-indexed format. Each triangle is composed by independent vertices, so, usually, duplicated vertices should be unified")); + parlst.addParam(RichBool("unify_vertices", true, "Unify Duplicated Vertices in STL files", "The STL format is not an vertex-indexed format. Each triangle is composed by independent vertices, so, usually, duplicated vertices should be unified")); } } @@ -189,7 +189,7 @@ void BaseMeshIOPlugin::open(const QString &formatName, const QString &fileName, throw MLException(errorMsgFormat.arg(fileName, tri::io::ImporterSTL::ErrorMsg(result))); } - bool stluinf = parlst.getBool(stlUnifyParName()); + bool stluinf = parlst.getBool("unify_vertices"); if (stluinf) { tri::Clean::RemoveDuplicateVertex(m.cm); diff --git a/src/meshlabplugins/io_base/baseio.h b/src/meshlabplugins/io_base/baseio.h index ce65fbab6..34917bb46 100644 --- a/src/meshlabplugins/io_base/baseio.h +++ b/src/meshlabplugins/io_base/baseio.h @@ -76,8 +76,6 @@ public: private: std::list rasterFormatList; - - static QString stlUnifyParName() { return QString("MeshLab::IO::STL::UnifyVertices"); } }; #endif