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.

104 lines
3.8 KiB
C++

#pragma once
#include "SmartPtr.h"
#include "ObjBase.h"
#include "GlobalDefine.h"
#include "ObjContainer.h"
#include "EnumDirection.h"
//创建扫描区域的参数
class CCreatAreaPar
{
public:
CCreatAreaPar()
{
m_CircleDia = 300;//圆的直径
};
public:
double m_CircleDia;//圆的直径
vector<double> m_LineCoordyVec;//用来划分圆的直线坐标
};
class CLayer
{
public:
CLayer(void);
~CLayer(void);
CMFCPropertyGridProperty *CreatSpecialGridProperty(CModule *pModule);
void Serialize(CArchive& ar);
void Draw(CDC* pDC);
void XorRedrawObj(CDC* pDC,bool bNeedSel = true);
void AddObject(CObjBase *pMarkObject);
void AddObject(Sptr<CObjBase> p);
void AddObject(CObjContainer &ObjContainer);
void AddTmpObject(Sptr<CObjBase> p);
void DelSelObj();
void DelObj(Sptr<CObjBase> p);
void DelObj(CObjContainer &ObjContainer);
void ClearTmpObj();
bool SelObjectInRect(DbRect rect,bool bNeedAllIn);
void SelAllObj();
void DelAllObj();
void NotSelAllObj();
void RevSelAllObj();
bool HasSelObjectInRect(DbRect rect);
bool HasObjSel();
MOUSE_TOOL JudgeMouseToolType(Dbxy pt);
void OperateObj(SObjOperatePar &par,bool bAll);
DbRect GetSelObjRect();
void OnRotato(double Angle);
void OnMirror(X_OR_Y xy);
void OnMove(double MoveX,double MoveY,bool bAddUndo = true);
void GetLineInRect(DbRect &rect,vector<DbLine> &DataPtLineVec,bool bCatchTemp);
void CloneObj(CObjContainer &ObjContainer,bool bNeedSel);
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 OnReverseSelObj();
bool OnJoin();
void OnExplode();
bool HasSelNodeInRect(DbRect rect);
void BindingSelObjToDlg();
bool HasObj(){return !m_ObjContainer->Empty();};
CObjContainer &GetObjContainer(){return *m_ObjContainer;};
void FillObj(SFillPar FillPar,bool bNeedSel = true);
void OnSpecialPropertyChanged();
void BindObjContainer(CObjContainer &Container);
void GetAllPointObjPt(vector<Dbxy> &PtVec);
void SetSelObjPenNum(int num);
void SelborderObj(bool bNext);
void SetbShowObjIdx(bool b){m_bShowObjIdx = b;};
void SetbShowObjPtCoord(bool b){m_bShowObjPtCoord = b;};
void SelectedObjInsertToIdx(int idx);
void ReverseSelObj();
void SelFirstObj();
void SetbDrawObj(bool b){m_bDrawObj = b;};
bool IsbDrawObj(){return m_bDrawObj;};
void ResetAllMarkObj();
void Rotato(double Angle);
void CreatCircleByThreePt();
void OffsetRotatoObj(COffsetRotatoPar OffsetRotatoPar);
void MoveScanObj(DIRECTION dir,double Dis);
void CreatOneLineObj(double Len);
void ResetAllObjScaned();
void QuickCreatScanArea(double AreaGap);
void SetAreaCrossPtRange(double val){m_AreaCrossPtRange = val;};
private:
void DrawAllObj(CDC* pDC);
CObjBase * CreatScanAreaObj(CObjBase *pCircle,vector<Dbxy> PointObjVec,double Coordy1,double Coordy2,double ChangeSizeY,DIRECTION Dir);
private:
bool m_bShowObjIdx;//是否显示obj 对象的索引idx
bool m_bShowObjPtCoord;//是否显示obj 对象的节点坐标
bool m_bDrawObj;//是否绘制obj
CObjContainer *m_ObjContainer;//obj 对象容器
CObjContainer m_TmpObjContainer;//临时obj 对象容器(主要用于创建时捕捉)
double m_AreaCrossPtRange;//用于创建扫描区域的交叉点范围
};
extern CLayer gLayer;