#ifndef DUST3D_APPLICATION_PART_PREVIEW_IMAGES_GENERATOR_H_ #define DUST3D_APPLICATION_PART_PREVIEW_IMAGES_GENERATOR_H_ #include #include #include #include #include "model_offscreen_render.h" class PartPreviewImagesGenerator : public QObject { Q_OBJECT public: PartPreviewImagesGenerator(ModelOffscreenRender *modelOffscreenRender) : m_offscreenRender(modelOffscreenRender) { } struct PreviewInput { Model *mesh = nullptr; bool isCutFace = false; }; ~PartPreviewImagesGenerator() { for (const auto &it: m_partPreviews) delete it.second.mesh; delete m_partImages; delete m_offscreenRender; } void addPart(const dust3d::Uuid &partId, Model *previewMesh, bool isCutFace); void generate(); std::map *takePartImages(); signals: void finished(); public slots: void process(); private: std::map m_partPreviews; ModelOffscreenRender *m_offscreenRender = nullptr; std::map *m_partImages = nullptr; }; #endif