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.

108 lines
4.5 KiB
C

#pragma once
#include "GlobalDefine.h"
#include "DataPoint.h"
#include "SequentialPoint.h"
#include "SmartPtr.h"
#include "ObjFill.h"
#include "PenParMgr.h"
#include "LabVecRang.h"
#include "ObjGeometryPorp.h"
class CModule;
class CObjPline;
class CObjBase
{
public:
CObjBase(void);
CObjBase(CObjBase &rhs);
virtual void WriteWorkFileExt(vector<CLab> &LabVec);
virtual void ReadWorkFileExt(CLabVecRang &LabVecRang);
virtual ~CObjBase(void);
virtual CString GetStr(){return "objbase";};
virtual CObjBase * Clone(){return new CObjBase;};
virtual void Draw(CDC* pDC,CPen &Pen);
virtual void Draw(CDC* pDC);
virtual bool IsInRect(DbRect rect,bool bNeedAllIn){return m_PtContainer.IsInRect(rect,bNeedAllIn);};//obj <20>ĵ<EFBFBD><C4B5>Ƿ<EFBFBD><C7B7><EFBFBD>rect <20><>
virtual OBJ_TYPE GetType(){return _TYPE_BASE;};
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-----------------------------------------------------------------------
virtual CMFCPropertyGridProperty *CreatSpecialGridProperty(CModule *pModule){return NULL;};
virtual void OnSpecialPropertyChanged(){};
virtual void SetSelected(bool bSelected);
virtual void Operate(SObjOperatePar &par);
virtual DbRect GetRect();
virtual Dbxy GetCenterPt(){return GetRect().GetCenterPt();};
virtual void BindingDlg(){};
virtual void GetPtData(vector<vector<Dbxy>> &vec);
virtual void GetFillData(vector<vector<Dbxy>> &vec);
virtual void CreatFillData(SFillPar FillPar);
virtual void GetLineInRect(DbRect &rect,vector<DbLine> &DataPtLineVec,bool bGetCatchNode = true);
virtual void DrawPtCoord(CDC* pDC);
public:
void WriteWorkFile(vector<CLab> &LabVec);
void ReadWorkFile(CLabVecRang &LabVecRang);
void AddDataPoint(CDataPoint pt);
void CopyPt(CObjBase &rhs);
void AddNodePt(CDataPoint pt);
bool Empty();
void DelAllPt();//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>
void DelLastDataPoint();//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ڵ<EFBFBD>
void DrawLastLine(CDC* pDC,CPen &Pen);
bool IsSelected();
bool HasNodeInRect(DbRect rect);
vector<CDataPoint>& GetPtContainer(){return m_PtContainer.GetPtContainer();};
void SetLastPoint(CDataPoint &pt);
Dbxy GetFirstPt();
Dbxy GetLastPt();
int GetNodePtIdx(Dbxy pt);
void DelNodePtByIdx(int idx);
void InsertNode(int idx,Dbxy pt);
void SetNodePtByIdx(int idx,Dbxy pt);
int GetPtCnt();
SFillPar GetFillPar(){return m_FillPar;};
bool IntersectWithLine(DbLine &line);
void SetLock(bool b){m_bLocked = b;};
void SetbDraw(bool b){m_bDraw = b;};
void SetPenNum(int n);
int GetPenNum(){return m_PenNum;};
bool IsbMarkPt(){return m_bMarkPt;};
void SetbMarkPt(bool b){m_bMarkPt = b;};
bool IsbCollected(){return m_bCollected;};
void SetbCollected(bool b){m_bCollected = b;};
bool IsbFillObj(){return m_bFillObj;};
void SetbFillObj(bool b){m_bFillObj = b;};
void SetbScaned(bool b){m_bScaned = b;};
bool IsbScaned(){return m_bScaned;};
protected:
void OnCreat();
void DrawFill(CDC* pDC,CPen &Pen);
void OperateFill(SObjOperatePar &par);
void SaveSequentialPoint(ofstream *pfile);
void SaveObjType(ofstream *pfile,CString s);
private:
void WriteWorkFileBase(vector<CLab> &LabVec);
void ReadWorkFileBase(CLabVecRang &LabVecRang);
COLORREF GetColor();
void AddDataPointVec(vector<CDataPoint> &DataPointVec);
void DrawPtCoordExt(CDC* pDC,Dbxy &pt);
protected:
CSequentialPoint m_PtContainer;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD><EFBFBD>(һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߶<EFBFBD>)
CSequentialPoint m_NodePtContainer;//<2F><EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD>ĵ<EFBFBD>(<28><><EFBFBD><EFBFBD>Բ<EFBFBD>ĵ<EFBFBD>)
vector<CSequentialPoint> m_FillDataVec;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SFillPar m_FillPar;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool m_bSelected;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ѡ<EFBFBD><D1A1>
bool m_bLocked;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>
bool m_bDraw;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
bool m_bMarkPt;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊmark <20><>λ<EFBFBD><CEBB>
bool m_bCollected;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ռ<EFBFBD>
bool m_bFillObj;//<2F>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>obj
bool m_bScaned;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD>
int m_PenNum;//<2F>ʺ<EFBFBD>
CObjGeometryPorp m_GeometryPorp;//<2F><><EFBFBD><EFBFBD>obj <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
};