mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 10:17:55 -06:00
Implemented generic mechanism for executing tasks on UI thread synchronously
from the background slicing thread, that supports cancellation. The generic mechanism is used for generating thumbnails into G-code and Fixes Fix deadlock when canceling the slicing while gcode is creating thumbnails #6476 Thanks @supermerill for pointing out the issue.
This commit is contained in:
parent
5f5d0df47e
commit
1aef86f650
5 changed files with 126 additions and 46 deletions
|
@ -19,8 +19,18 @@ struct ThumbnailData
|
|||
bool is_valid() const;
|
||||
};
|
||||
|
||||
typedef std::vector<ThumbnailData> ThumbnailsList;
|
||||
typedef std::function<void(ThumbnailsList & thumbnails, const Vec2ds & sizes, bool printable_only, bool parts_only, bool show_bed, bool transparent_background)> ThumbnailsGeneratorCallback;
|
||||
using ThumbnailsList = std::vector<ThumbnailData>;
|
||||
|
||||
struct ThumbnailsParams
|
||||
{
|
||||
const Vec2ds sizes;
|
||||
bool printable_only;
|
||||
bool parts_only;
|
||||
bool show_bed;
|
||||
bool transparent_background;
|
||||
};
|
||||
|
||||
typedef std::function<ThumbnailsList(const ThumbnailsParams&)> ThumbnailsGeneratorCallback;
|
||||
|
||||
} // namespace Slic3r
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue