#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 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 p); DbRect GetSelObjRect(); void OperateObj(SObjOperatePar &par,bool bAll); void GetLineInRect(DbRect &rect,vector &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> &GetObjVec(){return m_ObjVec;}; void AllObjAddToLayer(); CObjBase *GetCurOpObj(); void DeleteLastObj(); void OperateLastObj(SObjOperatePar &par); Sptr GetFirstObjInRect(DbRect &rect); Sptr GetFirstNodeObjInRect(DbRect &rect); bool HasObjectInRect(DbRect rect); void GetIntersectPoint(DbLine &line,vector &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 &vec); CMFCPropertyGridProperty *CreatSpecialGridProperty(CModule *pModule); void OnSpecialPropertyChanged(); Sptr GetFirstSelObj(); void InsertList(CListCtrl &List); void WriteWorkFile(vector &LabVec); void ReadWorkFile(CLabVecRang &LabVecRang); void GetAllPointObjPt(vector &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 &vec); void SetObjScanState(int ScanedLineCnt); bool HasScanedLine(); bool HasScanLine(); void SelObjByPenNum(int num); int GetScanLineCnt(); void GetObjPtData(vector> &vec,bool bNeedSel,bool bXYTest=false); void GetObjFillData(vector> &vec,bool bNeedSel); private: bool CorrectIdx(int idx); int GetMarkObjCnt(); private: vector> m_ObjVec;//obj 对象容器 };