|
|
|
|
#include "StdAfx.h"
|
|
|
|
|
#include "ObjPline.h"
|
|
|
|
|
#include "GlobalDrawMgr.h"
|
|
|
|
|
#include "DataPoint.h"
|
|
|
|
|
#include "GlobalFunction.h"
|
|
|
|
|
|
|
|
|
|
CObjPline::CObjPline(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
CObjPline::~CObjPline(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
CString CObjPline::GetStr()
|
|
|
|
|
{
|
|
|
|
|
CString str = "<EFBFBD><EFBFBD><EFBFBD>߶<EFBFBD>";
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
#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();
|
|
|
|
|
|
|
|
|
|
if(point1 == point2)//<2F><>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
CDataPoint DataPoint(point1);
|
|
|
|
|
DataPoint.SetIsNode(true);
|
|
|
|
|
AddDataPoint(DataPoint);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
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
|
|
|
|
|
#if 1//ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
#endif
|