ENABLE_THUMBNAIL_GENERATOR -> Thumbnails generated using a callback function

This commit is contained in:
Enrico Turri 2019-11-22 12:39:03 +01:00
parent 3b084c50cd
commit 6df506e482
8 changed files with 108 additions and 136 deletions

View file

@ -17,9 +17,6 @@ namespace Slic3r {
class DynamicPrintConfig;
class GCodePreviewData;
#if ENABLE_THUMBNAIL_GENERATOR
struct ThumbnailData;
#endif // ENABLE_THUMBNAIL_GENERATOR
class Model;
class SLAPrint;
@ -53,7 +50,7 @@ public:
void set_sla_print(SLAPrint *print) { m_sla_print = print; }
void set_gcode_preview_data(GCodePreviewData *gpd) { m_gcode_preview_data = gpd; }
#if ENABLE_THUMBNAIL_GENERATOR
void set_thumbnail_data(const std::vector<ThumbnailData>* data) { m_thumbnail_data = data; }
void set_thumbnail_cb(ThumbnailsGeneratorCallback cb) { m_thumbnail_cb = cb; }
#endif // ENABLE_THUMBNAIL_GENERATOR
// The following wxCommandEvent will be sent to the UI thread / Platter window, when the slicing is finished
@ -159,8 +156,8 @@ private:
// Data structure, to which the G-code export writes its annotations.
GCodePreviewData *m_gcode_preview_data = nullptr;
#if ENABLE_THUMBNAIL_GENERATOR
// Data structures, used to write thumbnails into gcode.
const std::vector<ThumbnailData>* m_thumbnail_data = nullptr;
// Callback function, used to write thumbnails into gcode.
ThumbnailsGeneratorCallback m_thumbnail_cb = nullptr;
#endif // ENABLE_THUMBNAIL_GENERATOR
// Temporary G-code, there is one defined for the BackgroundSlicingProcess, differentiated from the other processes by a process ID.
std::string m_temp_output_path;