36 lines
846 B
C++
36 lines
846 B
C++
#ifndef StabilityUndoRedoManager_H
|
|
#define StabilityUndoRedoManager_H
|
|
|
|
#include "ModelData.h"
|
|
#include "DataManagerGlobal.h"
|
|
#include <QUndoStack>
|
|
|
|
class DATAMANAGER_DLL_API_EXPORTS StabilityUndoRedoManager
|
|
{
|
|
public:
|
|
StabilityUndoRedoManager();
|
|
~StabilityUndoRedoManager();
|
|
|
|
void pushCommand(int& icommandid, IModel* data);
|
|
void pushCommand(int& icommandid, std::vector<IModel*>& data,vector<string> commandLines = vector<string>());
|
|
bool undo();
|
|
bool redo();
|
|
bool getChangeData(vector<IModel*>*& discardData, vector<IModel*>*& usingData);
|
|
int getCurentCommandID();
|
|
|
|
bool isCanUndo();
|
|
|
|
bool isCanRedo();
|
|
private:
|
|
|
|
vector<IModel*>* m_pDiscardData = nullptr;
|
|
vector<IModel*>* m_pUsingData = nullptr;
|
|
QUndoStack m_undoStack;
|
|
|
|
int m_iCurentCommandID;
|
|
|
|
|
|
};
|
|
|
|
#endif // StabilityUndoRedoManager_H
|