Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2019-07-18 18:41:47 +0300
committerbubnikv <bubnikv@gmail.com>2019-07-18 18:41:47 +0300
commita0ea96968d9097ad2f329e1e34bf207d955bed04 (patch)
tree5f169187c087e74a24009acf129dc7726b8da9f1 /src/slic3r/Utils/UndoRedo.hpp
parent631a952f94b9307eb1d696d9f0dfcb2ed1da799a (diff)
Storing the active printer technology onto the Undo / Redo stack,
remembering the last selected Printer profile for the SLA and FDM technologies separately, and activating them on Undo / Redo. When switching the technologies, user is asked whether to discard the modified profiles or not.
Diffstat (limited to 'src/slic3r/Utils/UndoRedo.hpp')
-rw-r--r--src/slic3r/Utils/UndoRedo.hpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/slic3r/Utils/UndoRedo.hpp b/src/slic3r/Utils/UndoRedo.hpp
index 6785cd740..00ab55822 100644
--- a/src/slic3r/Utils/UndoRedo.hpp
+++ b/src/slic3r/Utils/UndoRedo.hpp
@@ -23,11 +23,13 @@ namespace UndoRedo {
struct Snapshot
{
Snapshot(size_t timestamp) : timestamp(timestamp) {}
- Snapshot(const std::string &name, size_t timestamp, size_t model_id) : name(name), timestamp(timestamp), model_id(model_id) {}
+ Snapshot(const std::string &name, size_t timestamp, size_t model_id, Slic3r::PrinterTechnology printer_technology) :
+ name(name), timestamp(timestamp), model_id(model_id), printer_technology(printer_technology) {}
- std::string name;
- size_t timestamp;
- size_t model_id;
+ std::string name;
+ size_t timestamp;
+ size_t model_id;
+ PrinterTechnology printer_technology;
bool operator< (const Snapshot &rhs) const { return this->timestamp < rhs.timestamp; }
bool operator==(const Snapshot &rhs) const { return this->timestamp == rhs.timestamp; }
@@ -66,7 +68,7 @@ public:
void release_least_recently_used();
// Store the current application state onto the Undo / Redo stack, remove all snapshots after m_active_snapshot_time.
- void take_snapshot(const std::string& snapshot_name, const Slic3r::Model& model, const Slic3r::GUI::Selection& selection, const Slic3r::GUI::GLGizmosManager& gizmos);
+ void take_snapshot(const std::string& snapshot_name, const Slic3r::Model& model, const Slic3r::GUI::Selection& selection, const Slic3r::GUI::GLGizmosManager& gizmos, Slic3r::PrinterTechnology printer_technology);
// To be queried to enable / disable the Undo / Redo buttons at the UI.
bool has_undo_snapshot() const;
@@ -74,7 +76,7 @@ public:
// Roll back the time. If time_to_load is SIZE_MAX, the previous snapshot is activated.
// Undoing an action may need to take a snapshot of the current application state, so that redo to the current state is possible.
- bool undo(Slic3r::Model& model, const Slic3r::GUI::Selection& selection, Slic3r::GUI::GLGizmosManager& gizmos, size_t time_to_load = SIZE_MAX);
+ bool undo(Slic3r::Model& model, const Slic3r::GUI::Selection& selection, Slic3r::GUI::GLGizmosManager& gizmos, PrinterTechnology printer_technology, size_t time_to_load = SIZE_MAX);
// Jump forward in time. If time_to_load is SIZE_MAX, the next snapshot is activated.
bool redo(Slic3r::Model& model, Slic3r::GUI::GLGizmosManager& gizmos, size_t time_to_load = SIZE_MAX);