From 48eb234cd7e38d3601d26c72f43ead481997e7eb Mon Sep 17 00:00:00 2001 From: Steve Demlow Date: Tue, 9 Oct 2018 10:16:03 -0500 Subject: [PATCH] Add command line support to load multiple mesh files --- src/meshlab/main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/meshlab/main.cpp b/src/meshlab/main.cpp index 1bcad16ca..ecf534faa 100644 --- a/src/meshlab/main.cpp +++ b/src/meshlab/main.cpp @@ -61,10 +61,14 @@ int main(int argc, char *argv[]) "for a longer documentation\n" ); - if(QString::fromLocal8Bit(argv[1]).endsWith("mlp",Qt::CaseInsensitive) || QString::fromLocal8Bit(argv[1]).endsWith("mlb", Qt::CaseInsensitive) || QString::fromLocal8Bit(argv[1]).endsWith("aln",Qt::CaseInsensitive) || QString::fromLocal8Bit(argv[1]).endsWith("out",Qt::CaseInsensitive) || QString::fromLocal8Bit(argv[1]).endsWith("nvm",Qt::CaseInsensitive)) - window.openProject(QString::fromLocal8Bit(argv[1])); - else - window.importMeshWithLayerManagement(QString::fromLocal8Bit(argv[1])); + for (int i = 1; i < argc; ++i) + { + QString arg = QString::fromLocal8Bit(argv[i]); + if(arg.endsWith("mlp",Qt::CaseInsensitive) || arg.endsWith("mlb",Qt::CaseInsensitive) || arg.endsWith("aln",Qt::CaseInsensitive) || arg.endsWith("out",Qt::CaseInsensitive) || arg.endsWith("nvm",Qt::CaseInsensitive)) + window.openProject(arg); + else + window.importMeshWithLayerManagement(arg); + } } //else if(filterObj->noEvent) window.open(); return app.exec();