//-----------------------------------------------------------------------------+ // Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd. // = FileName : TGGeDbCurveSegEntity Àà // = Version : ver2.0 // = Author : wlw // = CreateDate : 2002-09-09 // = Description: TGGeDbCurveSegEntity ¶¨Òå // = Maintainers: // //-----------------------------------------------------------------------------+ #include "StdAfx.h" #include "TGGeDbCurveSegEntity.h" #include "TchPrivateGlobalFunc.h" #include "TchGlobalCurveFunc.h" TGGeDbCurveSegEntity::TGGeDbCurveSegEntity(const AcDbLine& line) { m_startPoint = line.startPoint(); m_endPoint = line.endPoint(); m_dBulge = 0; } TGGeDbCurveSegEntity::TGGeDbCurveSegEntity(const AcDbArc&arc) { TADSGePoint3d ptCen = arc.center(); TVector3D vtNormal = arc.normal(); ptCen = TchPrivate::Wcs2Ecs(ptCen, vtNormal); TGGeArc ar(ptCen, arc.radius(), arc.startAngle(), arc.endAngle()); TGGeCurveSegment seg; seg = ar; *this = seg; } AcDbEntity *TGGeDbCurveSegEntity::CreateAcDbEntity()const { return AsAcDbCurve(); } void TGGeDbCurveSegEntity::CutBy(const TGGePoly2D &poly,TDPtrList&lstIn,TDPtrList&lstOut,TDPtrList&lstEdge)const { TDPtrList lstSeg,lstIn0,lstOut0,lstEdge0; lstSeg.Append(new TGGeCurveSegment(*this)); PolyClip(lstSeg,poly,lstIn0,lstOut0,lstEdge0); for (long i = 0; i < lstIn0.Length(); i++) { lstIn.Append(new TGGeDbCurveSegEntity(*lstIn0[i])); } for (i = 0; i < lstOut0.Length(); i++) { lstOut.Append(new TGGeDbCurveSegEntity(*lstOut0[i])); } for (i = 0; i < lstEdge0.Length(); i++) { lstEdge.Append(new TGGeDbCurveSegEntity(*lstEdge0[i])); } }