Skip to content

Commit 5ae2f65

Browse files
committed
removed old rti interface
clean up deepzoom files
1 parent 2780f5c commit 5ae2f65

8 files changed

+28
-288
lines changed

relight/zoom.h

+27-8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <QMessageBox>
88

99
#include <QString>
10+
#include <QFile>
1011
#include <QStringList>
1112
#include <QDomDocument>
1213
#include <QDebug>
@@ -86,10 +87,10 @@ inline QString getItarzoomPlaneData(const QString& path, ZoomData& data, QJsonAr
8687
}
8788

8889
inline QString deepZoom(QString inputFolder, QString output, uint32_t quality, uint32_t overlap,
89-
uint32_t tileSize, std::function<bool(QString s, int n)> progressed)
90-
{
90+
uint32_t tileSize, std::function<bool(QString s, int n)> progressed) {
9191
int nplanes = getNFiles(inputFolder, "jpg");
9292

93+
bool remove = true;
9394

9495
// Deep zoom every plane
9596
for(int plane = 0; plane < nplanes; plane++)
@@ -100,6 +101,8 @@ inline QString deepZoom(QString inputFolder, QString output, uint32_t quality, u
100101
dz.quality = quality;
101102
dz.build(fileName, output + "/" + QString("plane_%1").arg(plane), tileSize, overlap);
102103

104+
if(remove)
105+
QFile::remove(fileName);
103106
// Update progress bar
104107
if(!progressed("Deepzoom:", 100*(plane+1)/nplanes))
105108
break;
@@ -108,8 +111,9 @@ inline QString deepZoom(QString inputFolder, QString output, uint32_t quality, u
108111
return "OK";
109112
}
110113

111-
inline QString tarZoom(QString inputFolder, QString output, std::function<bool(QString s, int n)> progressed)
112-
{
114+
inline QString tarZoom(QString inputFolder, QString output, std::function<bool(QString s, int n)> progressed) {
115+
bool remove = true;
116+
113117
// Find number of planes
114118
int nPlanes = getNFiles(inputFolder, "dzi");
115119
if (nPlanes == 0)
@@ -213,6 +217,11 @@ inline QString tarZoom(QString inputFolder, QString output, std::function<bool(Q
213217
outIndexFile.write(QJsonDocument(index).toJson());
214218
outIndexFile.close();
215219

220+
if(remove) {
221+
QFile::remove(dziPath);
222+
planeFolder.removeRecursively();
223+
}
224+
216225
// Update progress bar
217226
if(!progressed("Tarzoom:", 100*(i+1)/nPlanes))
218227
break;
@@ -223,6 +232,8 @@ inline QString tarZoom(QString inputFolder, QString output, std::function<bool(Q
223232

224233
inline QString itarZoom(const QString& inputFolder, const QString& output, std::function<bool(QString s, int n)> progressed)
225234
{
235+
bool remove = true;
236+
226237
// Find number of planes
227238
int nPlanes = getNFiles(inputFolder, "tzb");
228239
if (nPlanes == 0)
@@ -272,7 +283,8 @@ inline QString itarZoom(const QString& inputFolder, const QString& output, std::
272283
std::deque<uint32_t> sizes;
273284

274285
// Get tzi data
275-
QString err = getItarzoomPlaneData(QString("%1/plane_%2.tzi").arg(inputFolder).arg(i), data, offsets);
286+
QString tzi_path = QString("%1/plane_%2.tzi").arg(inputFolder).arg(i);
287+
QString err = getItarzoomPlaneData(tzi_path, data, offsets);
276288
if (err.compare("OK") != 0)
277289
return err;
278290

@@ -295,11 +307,15 @@ inline QString itarZoom(const QString& inputFolder, const QString& output, std::
295307
}
296308

297309
// Append file to final tzb
298-
QString tzbPath = QString("%1/plane_%2.tzb").arg(inputFolder).arg(i);
299-
files.push_back(new QFile(tzbPath));
310+
QString tzb_path = QString("%1/plane_%2.tzb").arg(inputFolder).arg(i);
311+
files.push_back(new QFile(tzb_path));
300312
if (!files[i]->open(QIODevice::ReadOnly))
301313
return QString("Error while opening .tzb file %1").arg(files[i]->fileName());
302314

315+
if(remove) {
316+
QFile::remove(tzi_path);
317+
}
318+
303319
// Update progress bar
304320
if(!progressed("Itarzoom:", 50*(i+1)/nPlanes))
305321
break;
@@ -329,8 +345,11 @@ inline QString itarZoom(const QString& inputFolder, const QString& output, std::
329345
outIndexFile.close();
330346

331347
// Clean file pointers
332-
for(QFile *file: files)
348+
for(QFile *file: files) {
349+
file->remove();
333350
delete file;
351+
}
352+
334353

335354
return "OK";
336355
}

relightlab/CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ set (RELIGHT_HEADERS
6464
markerdialog.h
6565
domepanel.h
6666
directionsview.h
67-
rtiexportdialog.h
6867
sphereframe.h
6968
spherepicking.h
7069
spheredialog.h
@@ -74,7 +73,6 @@ set (RELIGHT_HEADERS
7473
helpbutton.h
7574
cropframe.h
7675
rtiframe.h
77-
rticard.h
7876
rtitask.h
7977
../relight/imagecropper.h
8078
../relight-cli/rtibuilder.h
@@ -144,8 +142,6 @@ set (RELIGHTLAB_SOURCES
144142
rtiframe.cpp
145143
rtirecents.cpp
146144
rtiplan.cpp
147-
rticard.cpp
148-
rtiexportdialog.cpp
149145
rtitask.cpp
150146
../relight/imagecropper.cpp
151147
../relight-cli/rtibuilder.cpp

relightlab/relightlab.pro

-4
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ SOURCES += main.cpp \
7575
recentprojects.cpp \
7676
reflectionview.cpp \
7777
relightapp.cpp \
78-
rticard.cpp \
7978
rtiframe.cpp \
8079
rtiplan.cpp \
8180
rtirecents.cpp \
@@ -98,7 +97,6 @@ SOURCES += main.cpp \
9897
cropframe.cpp \
9998
../relight/imagecropper.cpp \
10099
creatertidialog.cpp \
101-
rtiexportdialog.cpp \
102100
rtitask.cpp \
103101
task.cpp \
104102
queueitem.cpp \
@@ -160,7 +158,6 @@ HEADERS += \
160158
recentprojects.h \
161159
reflectionview.h \
162160
relightapp.h \
163-
rticard.h \
164161
rtiframe.h \
165162
rtiplan.h \
166163
rtirecents.h \
@@ -184,7 +181,6 @@ HEADERS += \
184181
cropframe.h \
185182
../relight/imagecropper.h \
186183
creatertidialog.h \
187-
rtiexportdialog.h \
188184
rtitask.h \
189185
task.h \
190186
queueitem.h \

relightlab/rticard.cpp

-130
This file was deleted.

relightlab/rticard.h

-40
This file was deleted.

0 commit comments

Comments
 (0)