1+ /*
2+ * Solidify (Push Pull) algorithm implementation using OpenImageIO
3+ * Copyright (c) 2022 Erium Vladlen.
4+ *
5+ * This program is free software: you can redistribute it and/or modify
6+ * it under the terms of the GNU General Public License as published by
7+ * the Free Software Foundation, version 3.
8+ *
9+ * This program is distributed in the hope that it will be useful, but
10+ * WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+ * General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU General Public License
15+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
16+ */
17+ #include < QtWidgets/QApplication>
18+ #include < QtWidgets/QLabel>
19+ #include < QtGui/QDragEnterEvent>
20+ #include < QtGui/QDropEvent>
21+ #include < QtCore/QMimeData>
22+ #include < QtCore/QDebug>
23+ #include < QtCore/QFileInfo>
24+
25+ #include " solidify.h"
26+
27+ std::vector<QString> fileNames; // This will hold the names of all files
28+
29+ bool doProcessing (QList<QUrl> urls) {
30+ for (const QUrl& url : urls) {
31+ QString fileName = url.toLocalFile ();
32+ if (!fileName.isEmpty ()) {
33+ fileNames.push_back (fileName);
34+ }
35+ }
36+
37+ for (int i = 0 ; i < fileNames.size (); i++) {
38+ // qDebug() << "File name: " << fileName;
39+ QFileInfo fileInfo (fileNames[i]);
40+ QString baseName = fileInfo.baseName ();
41+ QString path = fileInfo.absolutePath ();
42+ QString outName = path + " /" + baseName + " _fill." + fileInfo.completeSuffix ();
43+
44+ // Call the solidify_main function
45+ if (solidify_main (fileNames[i].toStdString (), outName.toStdString ())) {
46+ exit (-1 );
47+ };
48+ }
49+
50+ return true ;
51+ }
0 commit comments