You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
1.4 KiB
C++
82 lines
1.4 KiB
C++
#pragma once
|
|
#include "PeriodicLattice.h"
|
|
#include <vector>
|
|
#include <map>
|
|
|
|
|
|
|
|
//结构体用于保存操作的信息
|
|
struct CommandInfo
|
|
{
|
|
//操作的类型
|
|
//CommandType type;
|
|
|
|
//更行范围
|
|
BBox bbox;
|
|
|
|
//更新数据表
|
|
std::vector<uint64_t> idxList;
|
|
|
|
//表对应数据
|
|
std::vector<double> valList;
|
|
};
|
|
|
|
//结构体用于保存详细参数
|
|
struct MeshDataInfo
|
|
{
|
|
double isopStep; //等值线间隔
|
|
int markStep; //标注间隔
|
|
double zMin;
|
|
double zMax;
|
|
|
|
double isoplethMin; //最小等值线
|
|
double isoplethMax; //最大等值线
|
|
};
|
|
|
|
//用于Object和View中的Undo/Redo
|
|
class OMUndoRedo
|
|
{
|
|
public:
|
|
OMUndoRedo(void);
|
|
~OMUndoRedo(void);
|
|
|
|
void Start();
|
|
void Add(const BBox& bbox, const std::vector<uint64_t>& idxList, const std::vector<double>& valList);
|
|
void AddMeshInfo(double isopStep, int markStep, double zMin, double zMax, double isoplethMin, double isoplethMax);
|
|
void End();
|
|
|
|
void Undo();
|
|
void Redo();
|
|
|
|
unsigned int GetUndoCurStep();
|
|
|
|
unsigned int GetUndoCount();
|
|
|
|
//删除所有的undo列表以及内存
|
|
void ClearUndoList();
|
|
private:
|
|
//保存undo消息的集合
|
|
std::vector<CommandInfo*> m_vInfos;
|
|
std::vector<MeshDataInfo*> m_vDataInfos;
|
|
|
|
//指向当前Vector中对应的Index
|
|
uint32_t m_curStep;
|
|
|
|
//指向当前Vector中 MeshDataInfo 对应的Index
|
|
uint32_t m_curDataStep;
|
|
|
|
//数据总数,大于这个数就释放前面的
|
|
uint64_t m_numData;
|
|
|
|
//临时
|
|
CommandInfo* m_pCmdinfo;
|
|
|
|
MeshDataInfo* m_pDataInfo;
|
|
|
|
//正在进行添加undo
|
|
bool m_bWoring;
|
|
|
|
std::map<uint64_t, double> m_data;
|
|
};
|
|
|