2021-11-18 14:58:01 +00:00
|
|
|
#ifndef DUST3D_APPLICATION_MATERIAL_PREVIEWS_GENERATOR_H_
|
|
|
|
#define DUST3D_APPLICATION_MATERIAL_PREVIEWS_GENERATOR_H_
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
2022-09-23 15:54:49 +00:00
|
|
|
#include "model_mesh.h"
|
2021-11-18 14:58:01 +00:00
|
|
|
#include "material_layer.h"
|
|
|
|
|
|
|
|
class MaterialPreviewsGenerator : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
MaterialPreviewsGenerator();
|
|
|
|
~MaterialPreviewsGenerator();
|
|
|
|
void addMaterial(dust3d::Uuid materialId, const std::vector<MaterialLayer> &layers);
|
|
|
|
const std::set<dust3d::Uuid> &generatedPreviewMaterialIds();
|
2022-09-23 15:54:49 +00:00
|
|
|
ModelMesh *takePreview(dust3d::Uuid materialId);
|
2021-11-18 14:58:01 +00:00
|
|
|
void generate();
|
|
|
|
signals:
|
|
|
|
void finished();
|
|
|
|
public slots:
|
|
|
|
void process();
|
|
|
|
private:
|
|
|
|
std::vector<std::pair<dust3d::Uuid, std::vector<MaterialLayer>>> m_materials;
|
2022-09-23 15:54:49 +00:00
|
|
|
std::map<dust3d::Uuid, ModelMesh *> m_previews;
|
2021-11-18 14:58:01 +00:00
|
|
|
std::set<dust3d::Uuid> m_generatedMaterialIds;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|