HistoryHandler(int maxElements);
~HistoryHandler();
void CleanHistory();
- StateType* Undo();
- StateType* Redo();
+ StateType* Undo(StateType* State);
+ StateType* UndoKeepCurrent();
+ StateType* Redo(StateType* State);
+ StateType* RedoKeepCurrent();
void Save(StateType* State);
+ StateType* GetPrevious();
+ StateType* GetNext();
int UndoSize();
int RedoSize();
MeshManagerModel(std::vector<vtkPolyData*> meshList);
~MeshManagerModel();
+ void SetHistory(int maxCapacity);
void ResetHistory();
void ResetAll();
- void UpdateMeshReference(vtkPolyData* mesh);
+ void SetReferencePoint(std::vector<double> point);
+ std::vector<double> GetReferencePoint();
+ void SetReferenceNormal(std::vector<double> normal);
+ std::vector<double> GetReferenceNormal();
+
void SetMeshBase(vtkPolyData* mesh);
void SetMeshMemoryMode(vtkPolyData* mesh);
+ void MeshMemoryModeOn();
+ void MeshMemoryModeOff();
void CopySetMeshBase(vtkPolyData* mesh);
void ResetMeshTemp();
//void ResetMeshTemp_();
void NextMesh();
void PreviousMesh();
+ void SaveMemoryMode();
void Undo();
void Redo();
std::vector<std::string> GetMeshNames();
+ std::vector<vtkPolyData*> GetAllPolyDatas();
+ int GetCurrentMesh();
//--Method template----------------------------
// void FunctionName(int& parameterA);
std::vector<std::shared_ptr<MeshModel>> _meshes;
int currentMesh;
int meshId;
+ int lastModified;
+ bool memoryMode;
+ std::vector<double> referencePoint;
+ std::vector<double> referenceNormal;
class ManagerState{
public:
- ManagerState(std::vector<std::shared_ptr<MeshModel>> meshesToSave, int meshId, int currentMesh);
+ ManagerState(std::vector<std::shared_ptr<MeshModel>> meshesToSave, int meshId, int modifiedId);
+ ManagerState(std::vector<std::shared_ptr<MeshModel>> meshesToSave, int meshId, int modifiedId, std::vector<double> refPoint, std::vector<double> refNormal);
~ManagerState();
std::vector<std::shared_ptr<MeshModel>>& GetMeshes();
int GetMeshId();
- int GetCurrentMesh();
- private:
+ int GetModifiedPos();
+ std::vector<double>& GetReferencePoint();
+
std::vector<std::shared_ptr<MeshModel>> savedMeshes;
- int savedCurrentMesh;
+ int savedModifiedPos;
int savedId;
+ std::vector<double> referencePoint;
+ std::vector<double> referenceNormal;
};
void Save();
void RestoreState(ManagerState* state);
+ void RestoreStateMemoryMode(ManagerState* state);
HistoryHandler<ManagerState> *history;