|
|
|
|
#include "StdAfx.h"
|
|
|
|
|
#include "ObjArc.h"
|
|
|
|
|
#include "GlobalDrawMgr.h"
|
|
|
|
|
#include "DataPoint.h"
|
|
|
|
|
#include "GlobalFunction.h"
|
|
|
|
|
#include "Propertie.h"
|
|
|
|
|
#include "PropertieMgr.h"
|
|
|
|
|
#include "CommandModifiCircle.h"
|
|
|
|
|
#include "CommandMgr.h"
|
|
|
|
|
#include "WorkFileMgr.h"
|
|
|
|
|
#include "DrawSimpleShape.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CObjArc::CObjArc(void)
|
|
|
|
|
{
|
|
|
|
|
m_bDir = true;//Բ<><D4B2><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
CObjArc::~CObjArc(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
CString CObjArc::GetStr()
|
|
|
|
|
{
|
|
|
|
|
CString str = "Բ<EFBFBD><EFBFBD>";
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
void CObjArc::Draw(CDC* pDC,CPen &Pen)
|
|
|
|
|
{
|
|
|
|
|
//Բ<>ĵ<EFBFBD>
|
|
|
|
|
DrawSolidRect(pDC,gDraw->GetObjFirstNodeColor(),gDraw->GetCurPointRect(m_CenterPt.GetPt()));
|
|
|
|
|
|
|
|
|
|
CObjBase::Draw(pDC,Pen);
|
|
|
|
|
}
|
|
|
|
|
void CObjArc::WriteWorkFileExt(vector<CLab> &LabVec)
|
|
|
|
|
{
|
|
|
|
|
CObjBase::WriteWorkFileExt(LabVec);
|
|
|
|
|
Dbxy pt = m_CenterPt.GetPt();
|
|
|
|
|
LabVec.push_back(CLab(LAB_OBJ_ARC_CENTER_X,pt.x));
|
|
|
|
|
LabVec.push_back(CLab(LAB_OBJ_ARC_CENTER_Y,pt.y));
|
|
|
|
|
LabVec.push_back(CLab(LAB_OBJ_ARC_EDGE_CNT,m_EdgeCnt));
|
|
|
|
|
LabVec.push_back(CLab(LAB_OBJ_ARC_DIR,m_bDir));
|
|
|
|
|
}
|
|
|
|
|
void CObjArc::ReadWorkFileExt(CLabVecRang &LabVecRang)
|
|
|
|
|
{
|
|
|
|
|
CObjBase::ReadWorkFileExt(LabVecRang);
|
|
|
|
|
|
|
|
|
|
CWorkFileMgr WorkFileMgr;
|
|
|
|
|
Dbxy pt;
|
|
|
|
|
{
|
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang,LAB_OBJ_ARC_CENTER_X);
|
|
|
|
|
if(Lab.m_ValType != _TYPE_NULL)
|
|
|
|
|
{
|
|
|
|
|
pt.x = Lab.m_Double;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang,LAB_OBJ_ARC_CENTER_Y);
|
|
|
|
|
if(Lab.m_ValType != _TYPE_NULL)
|
|
|
|
|
{
|
|
|
|
|
pt.y = Lab.m_Double;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
m_CenterPt.SetPt(pt);
|
|
|
|
|
{
|
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang,LAB_OBJ_ARC_EDGE_CNT);
|
|
|
|
|
if(Lab.m_ValType != _TYPE_NULL)
|
|
|
|
|
{
|
|
|
|
|
m_EdgeCnt = Lab.m_Int;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang,LAB_OBJ_ARC_DIR);
|
|
|
|
|
if(Lab.m_ValType != _TYPE_NULL)
|
|
|
|
|
{
|
|
|
|
|
m_bDir = Lab.m_Bool;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>Բ<EFBFBD>ĵ<EFBFBD>
|
|
|
|
|
void CObjArc::SetCenterPt(Dbxy pt)
|
|
|
|
|
{
|
|
|
|
|
m_CenterPt.SetPt(pt);
|
|
|
|
|
}
|
|
|
|
|
void CObjArc::Operate(SObjOperatePar &par)
|
|
|
|
|
{
|
|
|
|
|
m_CenterPt.Operate(par);//Բ<>ĵ<EFBFBD>ҲҪ<D2B2><D2AA><EFBFBD><EFBFBD>
|
|
|
|
|
CObjBase::Operate(par);
|
|
|
|
|
}
|
|
|
|
|
//<2F><>ȡ<EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void CObjArc::GetPtData(vector<vector<Dbxy>> &vec)
|
|
|
|
|
{
|
|
|
|
|
CObjBase::GetPtData(vec);
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
int size = vec.size();
|
|
|
|
|
if(size>0)
|
|
|
|
|
{
|
|
|
|
|
vector<Dbxy> &Vec1 = vec[size-1];
|
|
|
|
|
int size1 = Vec1.size();
|
|
|
|
|
if(size1>1)
|
|
|
|
|
{
|
|
|
|
|
for(int k=0;k<size1;k++)
|
|
|
|
|
{
|
|
|
|
|
Dbxy pt = m_CenterPt.GetPt();
|
|
|
|
|
Vec1[k].bArc = true;
|
|
|
|
|
Vec1[k].bDir = m_bDir;
|
|
|
|
|
Vec1[k].Cx = pt.x;
|
|
|
|
|
Vec1[k].Cy = pt.y;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|