mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-12 18:59:59 +01:00
Work-in-progress: Interpolation of snapshot in Action manager
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <tinyxml2.h>
|
||||
|
||||
|
||||
class Interpolator;
|
||||
|
||||
class Action
|
||||
{
|
||||
@@ -17,36 +17,41 @@ class Action
|
||||
|
||||
public:
|
||||
|
||||
static Action& manager()
|
||||
static Action& manager ()
|
||||
{
|
||||
// The only instance
|
||||
static Action _instance;
|
||||
return _instance;
|
||||
}
|
||||
void init();
|
||||
void init ();
|
||||
|
||||
// UNDO History
|
||||
void store(const std::string &label);
|
||||
void undo();
|
||||
void redo();
|
||||
void stepTo(uint target);
|
||||
void store (const std::string &label);
|
||||
void undo ();
|
||||
void redo ();
|
||||
void stepTo (uint target);
|
||||
|
||||
inline uint current() const { return history_step_; }
|
||||
inline uint max() const { return history_max_step_; }
|
||||
std::string label(uint s) const;
|
||||
inline uint current () const { return history_step_; }
|
||||
inline uint max () const { return history_max_step_; }
|
||||
std::string label (uint s) const;
|
||||
|
||||
// Snapshots
|
||||
void snapshot(const std::string &label);
|
||||
void snapshot (const std::string &label);
|
||||
|
||||
std::list<uint64_t> snapshots() const;
|
||||
void replace(uint64_t snapshotid);
|
||||
void restore(uint64_t snapshotid);
|
||||
void interpolate(uint64_t snapshotid, float val);
|
||||
void remove (uint64_t snapshotid);
|
||||
std::list<uint64_t> snapshots () const;
|
||||
uint64_t currentSnapshot () const { return snapshot_id_; }
|
||||
|
||||
std::string label(uint64_t snapshotid) const;
|
||||
void open (uint64_t snapshotid);
|
||||
void replace (uint64_t snapshotid = 0);
|
||||
void restore (uint64_t snapshotid = 0);
|
||||
void remove (uint64_t snapshotid = 0);
|
||||
|
||||
std::string label (uint64_t snapshotid) const;
|
||||
void setLabel (uint64_t snapshotid, const std::string &label);
|
||||
|
||||
float interpolation ();
|
||||
void interpolate (float val, uint64_t snapshotid = 0);
|
||||
|
||||
private:
|
||||
|
||||
tinyxml2::XMLDocument history_doc_;
|
||||
@@ -55,6 +60,11 @@ private:
|
||||
std::atomic<bool> locked_;
|
||||
void restore(uint target);
|
||||
|
||||
uint64_t snapshot_id_;
|
||||
tinyxml2::XMLElement *snapshot_node_;
|
||||
|
||||
Interpolator *interpolator_;
|
||||
tinyxml2::XMLElement *interpolator_node_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user