mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 18:27:58 -06:00
New Undo / Redo stack for the gizmos. The Gizmo specific stack is
entered with Plater::enter_gizmos_stack(), and left with Plater::enter_gizmos_stack(). Other than that, the 2nd Undo / Redo stack is transparent to the user of the Plater. WIP: Currently the Gizmo stack takes a snapshot of the whole scene on Plater::enter_gizmos_stack(). While it should work, it may be cheaper to modify the Undo/Redo stack to only take a snapshot of the gizmos in the Gizmo mode.
This commit is contained in:
parent
eefd950e16
commit
30d4bfd410
5 changed files with 94 additions and 34 deletions
|
@ -71,7 +71,8 @@ struct Snapshot
|
|||
|
||||
// Excerpt of Slic3r::GUI::Selection for serialization onto the Undo / Redo stack.
|
||||
struct Selection : public Slic3r::ObjectBase {
|
||||
unsigned char mode;
|
||||
void clear() { mode = 0; volumes_and_instances.clear(); }
|
||||
unsigned char mode = 0;
|
||||
std::vector<std::pair<size_t, size_t>> volumes_and_instances;
|
||||
template<class Archive> void serialize(Archive &ar) { ar(mode, volumes_and_instances); }
|
||||
};
|
||||
|
@ -86,6 +87,9 @@ public:
|
|||
Stack();
|
||||
~Stack();
|
||||
|
||||
void clear();
|
||||
bool empty() const;
|
||||
|
||||
// Set maximum memory threshold. If the threshold is exceeded, least recently used snapshots are released.
|
||||
void set_memory_limit(size_t memsize);
|
||||
size_t get_memory_limit() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue