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.
71 lines
1.7 KiB
C++
71 lines
1.7 KiB
C++
#include "StdAfx.h"
|
|
#include "ObjPoint.h"
|
|
#include "GlobalDrawMgr.h"
|
|
#include "DrawSimpleShape.h"
|
|
#include "WorkFileLable.h"
|
|
#include "WorkFileMgr.h"
|
|
|
|
CObjPoint::CObjPoint(void)
|
|
{
|
|
}
|
|
CObjPoint::~CObjPoint(void)
|
|
{
|
|
}
|
|
CString CObjPoint::GetStr()
|
|
{
|
|
CString str = "点";
|
|
return str;
|
|
}
|
|
#if 1
|
|
void CObjPoint::WriteWorkFileExt(vector<CLab> &LabVec)
|
|
{
|
|
//数据点
|
|
Dbxy pt = GetRect().GetCenterPt();
|
|
LabVec.push_back(CLab(LAB_POINT_X,pt.x));
|
|
LabVec.push_back(CLab(LAB_POINT_Y,pt.y));
|
|
}
|
|
void CObjPoint::ReadWorkFileExt(CLabVecRang &LabVecRang)
|
|
{
|
|
CWorkFileMgr WorkFileMgr;
|
|
Dbxy pt;
|
|
{//X坐标
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang,LAB_POINT_X);
|
|
if(Lab.m_ValType != _TYPE_NULL)
|
|
{
|
|
pt.x = Lab.m_Double;
|
|
}
|
|
}
|
|
{//Y坐标
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang,LAB_POINT_Y);
|
|
if(Lab.m_ValType != _TYPE_NULL)
|
|
{
|
|
pt.y = Lab.m_Double;
|
|
}
|
|
}
|
|
SetPt(pt);
|
|
}
|
|
#endif
|
|
void CObjPoint::Draw(CDC* pDC,CPen &Pen)
|
|
{
|
|
DbRect Rect(GetRect().GetCenterPt(),gDraw->GetCatchNodeSize()*0.8);
|
|
DrawCrossX(pDC,Pen,Rect);
|
|
}
|
|
void CObjPoint::SetPt(Dbxy pt)
|
|
{
|
|
//添加两个用于操作的点
|
|
double gap = 0.0001;
|
|
CDataPoint DataPoint1(Dbxy(pt.x-gap,pt.y+gap));
|
|
DataPoint1.SetIsNode(true);
|
|
CDataPoint DataPoint2(Dbxy(pt.x+gap,pt.y-gap));
|
|
AddDataPoint(DataPoint1);
|
|
AddDataPoint(DataPoint2);
|
|
}
|
|
//点对象的数据就是一个点
|
|
void CObjPoint::GetPtData(vector<vector<Dbxy>> &vec)
|
|
{
|
|
Dbxy pt = GetRect().GetCenterPt();
|
|
pt.PenNum = m_PenNum;//设置笔号
|
|
vector<Dbxy> VecTmp;
|
|
VecTmp.push_back(pt);
|
|
vec.push_back(VecTmp);
|
|
} |