mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-26 10:11:10 -06:00
WIP Undo / Redo and project state: Marking Undo / Redo snapshots
with their purpose.
This commit is contained in:
parent
783c9cf202
commit
41dc265a45
9 changed files with 80 additions and 31 deletions
|
|
@ -37,6 +37,7 @@ using ModelInstancePtrs = std::vector<ModelInstance*>;
|
|||
|
||||
namespace UndoRedo {
|
||||
class Stack;
|
||||
enum class SnapshotType : unsigned char;
|
||||
struct Snapshot;
|
||||
}
|
||||
|
||||
|
|
@ -241,6 +242,9 @@ public:
|
|||
|
||||
void take_snapshot(const std::string &snapshot_name);
|
||||
void take_snapshot(const wxString &snapshot_name);
|
||||
void take_snapshot(const std::string &snapshot_name, UndoRedo::SnapshotType snapshot_type);
|
||||
void take_snapshot(const wxString &snapshot_name, UndoRedo::SnapshotType snapshot_type);
|
||||
|
||||
void undo();
|
||||
void redo();
|
||||
void undo_to(int selection);
|
||||
|
|
@ -392,6 +396,12 @@ public:
|
|||
m_plater->take_snapshot(snapshot_name);
|
||||
m_plater->suppress_snapshots();
|
||||
}
|
||||
TakeSnapshot(Plater *plater, const wxString &snapshot_name, UndoRedo::SnapshotType snapshot_type) : m_plater(plater)
|
||||
{
|
||||
m_plater->take_snapshot(snapshot_name, snapshot_type);
|
||||
m_plater->suppress_snapshots();
|
||||
}
|
||||
|
||||
~TakeSnapshot()
|
||||
{
|
||||
m_plater->allow_snapshots();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue