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

63 lines
1.6 KiB
C++

//-----------------------------------------------------------------------------+
// Copyright (C), 1998-2007, SH Software Co. Ltd.
// = FileName : XDcCurveSegment 类
// = Version : ver2.0
// = Author : zjq
// = CreateDate : 2002-09-09
// = Description: XDcCurveSegment 定义
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#include "StdAfx.h"
#include "XDcCurveSegment.h"
#include "XPrivateGlobalFunc.h"
#include "XGlobalCurveFunc.h"
XDcCurveSegment::XDcCurveSegment(const AcDbLine& line)
{
m_startPoint = line.startPoint();
m_endPoint = line.endPoint();
m_dBulge = 0;
}
XDcCurveSegment::XDcCurveSegment(const AcDbArc&arc)
{
XPoint ptCen = arc.center();
XVector3D vtNormal = arc.normal();
ptCen = XPrivate::Wcs2Ecs(ptCen, vtNormal);
XArc ar(ptCen, arc.radius(), arc.startAngle(), arc.endAngle());
XCurveSegment seg;
seg = ar;
*this = seg;
}
AcDbEntity *XDcCurveSegment::CreateAcDbEntity()const
{
return AsAcDbCurve();
}
void XDcCurveSegment::CutBy(const XPoly2D &poly,DList<XDcObject>&lstIn,DList<XDcObject>&lstOut,DList<XDcObject>&lstEdge)const
{
DList<XCurveSegment> lstSeg,lstIn0,lstOut0,lstEdge0;
lstSeg.Append(new XCurveSegment(*this));
PolyClip(lstSeg,poly,lstIn0,lstOut0,lstEdge0);
for (long i = 0; i < lstIn0.Length(); i++)
{
lstIn.Append(new XDcCurveSegment(*lstIn0[i]));
}
for (int i = 0; i < lstOut0.Length(); i++)
{
lstOut.Append(new XDcCurveSegment(*lstOut0[i]));
}
for (int i = 0; i < lstEdge0.Length(); i++)
{
lstEdge.Append(new XDcCurveSegment(*lstEdge0[i]));
}
}