//-----------------------------------------------------------------------------+ // 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&lstIn,DList&lstOut,DList&lstEdge)const { DList 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])); } }