2021-11-18 14:58:01 +00:00
|
|
|
#ifndef DUST3D_APPLICATION_DOCUMENT_SAVER_H_
|
|
|
|
#define DUST3D_APPLICATION_DOCUMENT_SAVER_H_
|
|
|
|
|
|
|
|
#include <QByteArray>
|
2022-10-18 09:35:04 +00:00
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
#include <dust3d/base/snapshot.h>
|
|
|
|
#include <dust3d/base/uuid.h>
|
2021-11-18 14:58:01 +00:00
|
|
|
#include <map>
|
|
|
|
#include <set>
|
|
|
|
|
2022-10-18 09:35:04 +00:00
|
|
|
class DocumentSaver : public QObject {
|
2021-11-18 14:58:01 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-10-18 09:35:04 +00:00
|
|
|
DocumentSaver(const QString* filename,
|
|
|
|
dust3d::Snapshot* snapshot,
|
|
|
|
QByteArray* turnaroundPngByteArray);
|
2021-11-18 14:58:01 +00:00
|
|
|
~DocumentSaver();
|
2022-10-18 09:35:04 +00:00
|
|
|
static bool save(const QString* filename,
|
|
|
|
dust3d::Snapshot* snapshot,
|
|
|
|
const QByteArray* turnaroundPngByteArray);
|
|
|
|
static void collectUsedResourceIds(const dust3d::Snapshot* snapshot,
|
|
|
|
std::set<dust3d::Uuid>& imageIds);
|
2021-11-18 14:58:01 +00:00
|
|
|
signals:
|
|
|
|
void finished();
|
|
|
|
public slots:
|
|
|
|
void process();
|
2022-10-18 09:35:04 +00:00
|
|
|
|
2021-11-18 14:58:01 +00:00
|
|
|
private:
|
2022-10-18 09:35:04 +00:00
|
|
|
const QString* m_filename = nullptr;
|
|
|
|
dust3d::Snapshot* m_snapshot = nullptr;
|
|
|
|
QByteArray* m_turnaroundPngByteArray = nullptr;
|
2021-11-18 14:58:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|