Files
envi-code/SourceCode/Code2026/Dimension/GeDbCurveSegEntity.cpp
T
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

51 lines
1.2 KiB
C++

#include "StdAfx.h"
#include "GeDbCurveSegEntity.h"
#include "globalFunc.h"
GeDbCurveSegEntity::GeDbCurveSegEntity(const AcDbLine& line)
{
m_startPoint = line.startPoint();
m_endPoint = line.endPoint();
m_dBulge = 0;
}
GeDbCurveSegEntity::GeDbCurveSegEntity(const AcDbArc&arc)
{
ADSGePoint3d ptCen = arc.center();
TVector3D vtNormal = arc.normal();
ptCen = GlobalFunc::Wcs2Ecs(ptCen, vtNormal);
GeArc ar(ptCen, arc.radius(), arc.startAngle(), arc.endAngle());
GeCurveSegment seg;
seg = ar;
*this = seg;
}
AcDbEntity *GeDbCurveSegEntity::CreateAcDbEntity()const
{
return AsAcDbCurve();
}
void GeDbCurveSegEntity::CutBy(const GePoly2D &poly,PtrList<GeDbCurveEntity>&lstIn,PtrList<GeDbCurveEntity>&lstOut,PtrList<GeDbCurveEntity>&lstEdge)const
{
PtrList<GeCurveSegment> lstSeg,lstIn0,lstOut0,lstEdge0;
lstSeg.Append(new GeCurveSegment(*this));
GlobalFunc::PolyClip(lstSeg,poly,lstIn0,lstOut0,lstEdge0);
for (long i = 0; i < lstIn0.Length(); i++)
{
lstIn.Append(new GeDbCurveSegEntity(*lstIn0[i]));
}
for (i = 0; i < lstOut0.Length(); i++)
{
lstOut.Append(new GeDbCurveSegEntity(*lstOut0[i]));
}
for (i = 0; i < lstEdge0.Length(); i++)
{
lstEdge.Append(new GeDbCurveSegEntity(*lstEdge0[i]));
}
}