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.

103 lines
3.5 KiB
C++

#pragma once
#include "SmartPtr.h"
#include "GlobalDefine.h"
#include "ObjBase.h"
#include "Subject.h"
#include "LabVecRang.h"
class CCommandBase;
//¹ÜÀíobj µÄÈÝÆ÷
class CObjContainer
{
public:
CObjContainer(void);
~CObjContainer(void);
void AddObject(CObjBase *pMarkObject);
void AddObject(Sptr<CObjBase> p);
void AddPtToLastObj(CDataPoint pt);
void DrawAllObj(CDC* pDC);
void DrawAllObj(CDC* pDC,CPen &Pen);
void XorRedrawObj(CDC* pDC,bool bNeedSel);
void XorDrawLastObj(CDC* pDC);
bool HasSelObjectInRect(DbRect rect);
bool HasSelNodeInRect(DbRect rect);
bool SelObjectInRect(DbRect rect,bool bNeedAllIn);
void SelAllObj();
bool HasObjSel();
void NotSelAllObj();
void RevSelAllObj();
void DelSelObj();
void DelObj(Sptr<CObjBase> p);
DbRect GetSelObjRect();
void OperateObj(SObjOperatePar &par,bool bAll);
void GetLineInRect(DbRect &rect,vector<DbLine> &DataPtLineVec,bool bCatchTemp);
void CloneObj(CObjContainer &rhs,bool bNeedSel);
void AllObjAddToContainer(CObjContainer &rhs,bool bNeedSel);
void AddObjToCmd(CCommandBase *p,bool bNeedSel);
void SetNodePtByIdx(int idx,Dbxy pt);
bool Empty(){return m_ObjVec.empty();};
void Clear(){m_ObjVec.clear();};
vector<Sptr<CObjBase>> &GetObjVec(){return m_ObjVec;};
void AllObjAddToLayer();
CObjBase *GetCurOpObj();
void DeleteLastObj();
void OperateLastObj(SObjOperatePar &par);
Sptr<CObjBase> GetFirstObjInRect(DbRect &rect);
Sptr<CObjBase> GetFirstNodeObjInRect(DbRect &rect);
bool HasObjectInRect(DbRect rect);
void GetIntersectPoint(DbLine &line,vector<Dbxy> &PointVec);
bool HasObjIntersectWithLine(DbLine &line);
void AllObjAddToLayerTmp();
void AllObjCombToPline();
CObjBase* JoinSelObj();
void DelNullLine();
DbRect GetObjRect(bool bNeedSel);
DbRect GetObjRect(int idx);
bool IsInRect(DbRect rect,bool bNeedAllIn);
void SetSelected(bool bSelected);
void Operate(SObjOperatePar &par,int idx= -1);
int GetSize(){return m_ObjVec.size();};
void BindingDlg();
int GetSelObjCnt();
int GetObjCnt(){return m_ObjVec.size();};
void FillObj(SFillPar &FillPar,bool bNeedSel);
void GetOnePoint(vector<Dbxy> &vec);
CMFCPropertyGridProperty *CreatSpecialGridProperty(CModule *pModule);
void OnSpecialPropertyChanged();
Sptr<CObjBase> GetFirstSelObj();
void InsertList(CListCtrl &List);
void WriteWorkFile(vector<CLab> &LabVec);
void ReadWorkFile(CLabVecRang &LabVecRang);
void GetAllPointObjPt(vector<Dbxy> &PtVec);
void SetSelObjPenNum(int num);
void SelborderObj(bool bNext);
void DrawObjIdx(CDC* pDC);
void SelectedObjInsertToIdx(int idx);
void ReverseSelObj();
void SelFirstObj();
void DrawMarkIdx(CDC* pDC);
void ResetAllMarkObj();
void ResetAllCollectedState();
int GetSelObjPenNum();
int GetScanAreaCnt();
void SelObjByIdx(int idx);
void DelAllFillObj();
void SelAllFillObj();
void SelObjByIdxVec(vector<bool> &vec);
void SetObjScanState(int ScanedLineCnt);
bool HasScanedLine();
bool HasScanLine();
void SelObjByPenNum(int num);
int GetScanLineCnt();
void GetObjPtData(vector<vector<Dbxy>> &vec,bool bNeedSel,bool bXYTest=false);
void GetObjFillData(vector<vector<Dbxy>> &vec,bool bNeedSel);
private:
bool CorrectIdx(int idx);
int GetMarkObjCnt();
private:
vector<Sptr<CObjBase>> m_ObjVec;//obj ¶ÔÏóÈÝÆ÷
};