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.

62 lines
2.2 KiB
C++

#pragma once
#include "MarkArea.h"
#include "Module.h"
#include "EnumDirection.h"
//标刻区域管理
class CMarkAreaMgr :public CModule
{
public:
CMarkAreaMgr(void);
~CMarkAreaMgr(void);
virtual void OnAppInitialize();
virtual void Draw(CDC* pDC);//在pDC 绘制一些内容
virtual MODULE GetModuleType(){return _MARK_AREA_PROP;};
virtual void WriteWorkFileExt(vector<CLab> &LabVec);
virtual void ReadWorkFile(CLabVecRang &LabVecRang);
void Add();
void AddArea(CMarkArea &Area){m_AreaVec.push_back(Area);};
void InsertList(CListCtrl &List);
void DelSel(int &idx);
void DelAll();
void OpArea(int idx,CMarkArea &Area,bool bRead);
void Order(int &idx,bool bMoveUp);
void SetCurSelIdx(int idx){m_CurSelIdx = idx;};
int GetCurSelIdx();
bool GetbDraw(){return m_bDraw;};
void SetbDraw(bool b){m_bDraw = b;};
void SaveOrLoad(bool bSave,bool bFixed = false);
void SaveOrLoadExt(CArchive &ar);
bool Empty(){return m_AreaVec.empty();};
int GetHasWorkDataAreaCnt();
vector<CMarkArea> &GetAreaVec(){return m_AreaVec;}
void ArrayCreat(int CntX,int CntY,double Offset);
void ResetAllAreaSelState();
void MoveAllArea(double Val,DIRECTION dir);
void SelAreaByPt(Dbxy pt);
void SetAllMarkSize();
void CollectWorkData(bool bNeedSe);
void SelFristArea();
void SetbDrawIdx(bool b){m_bDrawIdx = b;};
void AdjustByObj();
void ReReadFixMarkArea();
void Adjust();
void SendDataToCard(int CardIdx);
bool CheckTempIdx(int idx);
private:
bool IdxValid(int idx);
void SwapArea(int &idx1,int idx2);
void ConvertTempData(vector<vector<Dbxy>> &DataVec,vector<double> &TempDataVec);
void ConvertPosVec(vector<vector<Dbxy>> &DataVec,vector<Dbxy> &PosVec);
bool IsAllPtData(vector<vector<Dbxy>> &PtDataVec);
private:
vector<CMarkArea> m_AreaVec;
int m_CurSelIdx;//当前选择的area 索引值
bool m_bDraw;//是否绘制
bool m_bDrawIdx;//是否显示area 的索引值
int m_CurTempCnt;//当前模板数量
};
extern CMarkAreaMgr *gMarkAreaMgr;