|
|
|
|
#include "StdAfx.h"
|
|
|
|
|
#include "ObjPline.h"
|
|
|
|
|
#include "GlobalDrawMgr.h"
|
|
|
|
|
#include "DataPoint.h"
|
|
|
|
|
#include "GlobalFunction.h"
|
|
|
|
|
#include "Propertie.h"
|
|
|
|
|
#include "PropertieMgr.h"
|
|
|
|
|
#include "WorkFileMgr.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CObjPline::CObjPline(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
CObjPline::~CObjPline(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
CString CObjPline::GetStr()
|
|
|
|
|
{
|
|
|
|
|
CString str = "<EFBFBD><EFBFBD><EFBFBD>߶<EFBFBD>";
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
CMFCPropertyGridProperty *CObjPline::CreatSpecialGridProperty(CModule *pModule)
|
|
|
|
|
{
|
|
|
|
|
CString PropertyName;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CString Description;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
CString Name;
|
|
|
|
|
//-------------------------------------------------------------------------------//
|
|
|
|
|
PropertyName = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
CMFCPropertyGridProperty* pGroup = new CMFCPropertyGridProperty(PropertyName);
|
|
|
|
|
//-------------------------------------------------------------------------------//
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_CutOffset.x);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_DOUBLE);
|
|
|
|
|
pPropertie->SetpModule(pModule);
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD>и<EFBFBD>ƫ<EFBFBD><EFBFBD>X");
|
|
|
|
|
Description = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD>и<EFBFBD>ƫ<EFBFBD><EFBFBD>x(<28><>λ:mm)");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName,(_variant_t)m_CutOffset.x, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
gDrawPropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_CutOffset.y);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_DOUBLE);
|
|
|
|
|
pPropertie->SetpModule(pModule);
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD>и<EFBFBD>ƫ<EFBFBD><EFBFBD>Y");
|
|
|
|
|
Description = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD>и<EFBFBD>ƫ<EFBFBD><EFBFBD>y(<28><>λ:mm)");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName,(_variant_t)m_CutOffset.y, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
gDrawPropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
return pGroup;
|
|
|
|
|
}
|
|
|
|
|
void CObjPline::WriteWorkFileExt(vector<CLab> &LabVec)
|
|
|
|
|
{
|
|
|
|
|
CObjBase::WriteWorkFileExt(LabVec);
|
|
|
|
|
LabVec.push_back(CLab(LAB_OBJ_RECT_OFFSET_X,m_CutOffset.x));
|
|
|
|
|
LabVec.push_back(CLab(LAB_OBJ_RECT_OFFSET_Y,m_CutOffset.y));
|
|
|
|
|
}
|
|
|
|
|
void CObjPline::ReadWorkFileExt(CLabVecRang &LabVecRang)
|
|
|
|
|
{
|
|
|
|
|
CObjBase::ReadWorkFileExt(LabVecRang);
|
|
|
|
|
|
|
|
|
|
CWorkFileMgr WorkFileMgr;
|
|
|
|
|
{
|
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang,LAB_OBJ_RECT_OFFSET_X);
|
|
|
|
|
if(Lab.m_ValType != _TYPE_NULL)
|
|
|
|
|
{
|
|
|
|
|
m_CutOffset.x = Lab.m_Double;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
CLab Lab = WorkFileMgr.FindLab(LabVecRang,LAB_OBJ_RECT_OFFSET_Y);
|
|
|
|
|
if(Lab.m_ValType != _TYPE_NULL)
|
|
|
|
|
{
|
|
|
|
|
m_CutOffset.y = Lab.m_Double;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#if 1
|
|
|
|
|
//ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߶<EFBFBD>point1 <20><><EFBFBD><EFBFBD><EFBFBD>½ǵĵ<C7B5>
|
|
|
|
|
void CObjPline::Creat(Dbxy point1,double w,double h)
|
|
|
|
|
{
|
|
|
|
|
//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>
|
|
|
|
|
DelAllPt();
|
|
|
|
|
|
|
|
|
|
Dbxy point2(point1.x+w,point1.y+h);
|
|
|
|
|
CreatRect(point1,point2);
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1>
|
|
|
|
|
void CObjPline::Creat(Dbxy point1,Dbxy point2)
|
|
|
|
|
{
|
|
|
|
|
//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>
|
|
|
|
|
DelAllPt();
|
|
|
|
|
{
|
|
|
|
|
CDataPoint DataPoint(point1);
|
|
|
|
|
DataPoint.SetIsNode(true);
|
|
|
|
|
AddDataPoint(DataPoint);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
CDataPoint DataPoint(point2);
|
|
|
|
|
DataPoint.SetIsNode(true);
|
|
|
|
|
AddDataPoint(DataPoint);
|
|
|
|
|
}
|
|
|
|
|
AddMidNodePoint(point1,point2);
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>obj <20><><EFBFBD><EFBFBD><EFBFBD>߶εĺ<CEB5><C4BA><EFBFBD>(bReverse Ϊtrue ʱ<><CAB1><EFBFBD><EFBFBD>)
|
|
|
|
|
void CObjPline::AddObj(Sptr<CObjBase> &pObj,bool bReverse)
|
|
|
|
|
{
|
|
|
|
|
if(bReverse)
|
|
|
|
|
{
|
|
|
|
|
vector<CDataPoint>&vec = pObj->GetPtContainer();
|
|
|
|
|
int size = vec.size();
|
|
|
|
|
for(int i=size-1;i>=0;i--)
|
|
|
|
|
{
|
|
|
|
|
AddDataPoint(vec[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
vector<CDataPoint>&vec = pObj->GetPtContainer();
|
|
|
|
|
int size = vec.size();
|
|
|
|
|
for(int i=0;i<size;i++)
|
|
|
|
|
{
|
|
|
|
|
AddDataPoint(vec[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߶ε<DFB6><CEB5>м<EFBFBD><D0BC><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><D7BD>
|
|
|
|
|
void CObjPline::CreatMidNode()
|
|
|
|
|
{
|
|
|
|
|
m_NodePtContainer.DelAllPt();
|
|
|
|
|
|
|
|
|
|
vector<CDataPoint>&vec = GetPtContainer();
|
|
|
|
|
int size = vec.size();
|
|
|
|
|
for(int i=0;i<size;i++)
|
|
|
|
|
{
|
|
|
|
|
if(i>0)
|
|
|
|
|
{
|
|
|
|
|
AddMidNodePoint(vec[i-1].GetPt(),vec[i].GetPt());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>м<EFBFBD><D0BC>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void CObjPline::AddMidNodePoint(Dbxy point1,Dbxy point2)
|
|
|
|
|
{
|
|
|
|
|
Dbxy pt = CenterPtOfTwoPoint(point1,point2);
|
|
|
|
|
CDataPoint DataPoint(pt);
|
|
|
|
|
DataPoint.SetIsNode(true);
|
|
|
|
|
AddNodePt(DataPoint);
|
|
|
|
|
}
|
|
|
|
|
void CObjPline::CreatRect(DbRect rect)
|
|
|
|
|
{
|
|
|
|
|
Dbxy point1(rect.L,rect.B);
|
|
|
|
|
Dbxy point2(rect.R,rect.T);
|
|
|
|
|
CreatRect(point1,point2);
|
|
|
|
|
}
|
|
|
|
|
void CObjPline::CreatRect(Dbxy point1,Dbxy point2)
|
|
|
|
|
{
|
|
|
|
|
Dbxy pt = point1;
|
|
|
|
|
{
|
|
|
|
|
CDataPoint DataPoint(pt);
|
|
|
|
|
DataPoint.SetIsNode(true);
|
|
|
|
|
AddDataPoint(DataPoint);
|
|
|
|
|
}
|
|
|
|
|
pt.y = point2.y;
|
|
|
|
|
{
|
|
|
|
|
CDataPoint DataPoint(pt);
|
|
|
|
|
DataPoint.SetIsNode(true);
|
|
|
|
|
AddDataPoint(DataPoint);
|
|
|
|
|
}
|
|
|
|
|
AddMidNodePoint(point1,pt);
|
|
|
|
|
AddMidNodePoint(point2,pt);
|
|
|
|
|
pt = point2;
|
|
|
|
|
{
|
|
|
|
|
CDataPoint DataPoint(pt);
|
|
|
|
|
DataPoint.SetIsNode(true);
|
|
|
|
|
AddDataPoint(DataPoint);
|
|
|
|
|
}
|
|
|
|
|
pt.y = point1.y;
|
|
|
|
|
{
|
|
|
|
|
CDataPoint DataPoint(pt);
|
|
|
|
|
DataPoint.SetIsNode(true);
|
|
|
|
|
AddDataPoint(DataPoint);
|
|
|
|
|
}
|
|
|
|
|
AddMidNodePoint(point1,pt);
|
|
|
|
|
AddMidNodePoint(point2,pt);
|
|
|
|
|
pt = point1;
|
|
|
|
|
{
|
|
|
|
|
CDataPoint DataPoint(pt);
|
|
|
|
|
DataPoint.SetIsNode(true);
|
|
|
|
|
AddDataPoint(DataPoint);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|