diff options
author | bubnikv <bubnikv@gmail.com> | 2019-07-26 14:44:33 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2019-07-26 14:44:33 +0300 |
commit | 30d4bfd41026ea8cc8be181bf2af3210ed76a763 (patch) | |
tree | 4b7bd184882200de85ed09be35cdf3cebc343c19 /src/slic3r/Utils/UndoRedo.hpp | |
parent | eefd950e1678df33a95e0c22749c655a80f0ea83 (diff) |
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.
Diffstat (limited to 'src/slic3r/Utils/UndoRedo.hpp')
-rw-r--r-- | src/slic3r/Utils/UndoRedo.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/slic3r/Utils/UndoRedo.hpp b/src/slic3r/Utils/UndoRedo.hpp index 37cc5a049..558449003 100644 --- a/src/slic3r/Utils/UndoRedo.hpp +++ b/src/slic3r/Utils/UndoRedo.hpp @@ -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; |