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.

90 lines
2.7 KiB
C

#pragma once
#include "GlobalDefine.h"
#include "ObjContainer.h"
#include "GlobalFunction.h"
enum SCAN_TRACK_E
{
_SCAN_TRACK_S_L_R=0,//S <20><>ɨ<EFBFBD><C9A8>-<2D><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_SCAN_TRACK_S_R_L,//S <20><>ɨ<EFBFBD><C9A8>-<2D><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>
_SCAN_TRACK_U_D,//<2F><><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8>-<2D>ϵ<EFBFBD><CFB5><EFBFBD>
_SCAN_TRACK_D_U,//<2F><><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8>-<2D>µ<EFBFBD><C2B5><EFBFBD>
_SCAN_TRACK_S_U_D,//S <20><>ɨ<EFBFBD><C9A8>-<2D><><EFBFBD><EFBFBD>-<2D>ϵ<EFBFBD><CFB5><EFBFBD>
_SCAN_TRACK_S_D_U,//S <20><>ɨ<EFBFBD><C9A8>-<2D><><EFBFBD><EFBFBD>-<2D>µ<EFBFBD><C2B5><EFBFBD>
_SCAN_TRACK_L_R,//<2F><><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_SCAN_TRACK_R_L,//<2F><><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8>-<2D>ҵ<EFBFBD><D2B5><EFBFBD>
};
//ɨ<><C9A8><EFBFBD><EFBFBD>
class CScanLine
{
public:
CScanLine(Dbxy StartPt,Dbxy EndPt)
{
m_StartPt = StartPt;
m_EndPt = EndPt;
m_bFirstLine = false;//<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>
};
CScanLine(void)
{
};
~CScanLine(void){};
Dbxy GetStartPt(){return m_StartPt;};
Dbxy GetEndPt(){return m_EndPt;};
void SetStartPt(Dbxy pt){m_StartPt = pt;};
void SetEndPt(Dbxy pt){m_EndPt = pt;};
double GetLength(){return CalDistance(m_StartPt,m_EndPt);};
void SetbFirstLine(){m_bFirstLine = true;};
bool IsbFirstLine(){return m_bFirstLine;};
void SetPenNum(int n){m_PenNum = n;};
int GetPenNum(){return m_PenNum;};
private:
Dbxy m_StartPt;//<2F><><EFBFBD><EFBFBD>
Dbxy m_EndPt;//<2F>յ<EFBFBD>
bool m_bFirstLine;//<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>
int m_PenNum;//<2F>ʺ<EFBFBD>
};
//ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
class CObjFillMgr
{
public:
CObjFillMgr(void);
~CObjFillMgr(void);
void FillAllSelObj();
void FillAllSelObjByIdx(int idx);
void SetFillOffset(double val){m_FillOffset = val;};
void SetFillAngle(double val){m_FillAngle = val;};
void SetbDelEdgeObj(bool b){m_bDelEdgeObj = b;};
bool GetAngle(double &Angle,int PenNum);
SCAN_TRACK_E GetCurScanType(){return m_CurScanType;};
void SetStartFillIdx(int idx){m_StartFillIdx = idx;};
private:
void CreatCmd();
void FillObjAddToLayer();
void CreatFillLineByObj();
void CreatObjFillData(CObjContainer &ObjContainer);
void AdjustScanLine1();
void AdjustScanLine2();
bool CreatScanLineByObjFill();
void CreatObjByScanLine();
void ScanLineCoverWafer(Dbxy &pt1,Dbxy &pt2,bool bDir,int PenNum);
void UpdateCurScanType();
public:
double m_FillOffset;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>mm
double m_FillAngle;//<2F><><EFBFBD><EFBFBD><EFBFBD>Ƕ<EFBFBD>(360 <20><>)
bool m_bDelEdgeObj;//<2F>Ƿ<EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>obj
bool m_bCreatConnectLine;//<2F>Ƿ񴴽<C7B7><F1B4B4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int m_StartFillIdx;//<2F>ӵڼ<D3B5><DABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD>ʼ
SCAN_TRACK_E m_CurScanType;//<2F><>ǰ<EFBFBD><C7B0>ɨ<EFBFBD>ʽ
vector<CScanLine> m_ScanLineVec;//ɨ<><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CObjContainer m_ObjContainer;
};
extern CObjFillMgr gObjFillMgr;