62 lines
1.7 KiB
C++
62 lines
1.7 KiB
C++
//-----------------------------------------------------------------------------+
|
|
// 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<TGGeDbCurveEntity>&lstIn,TDPtrList<TGGeDbCurveEntity>&lstOut,TDPtrList<TGGeDbCurveEntity>&lstEdge)const
|
|
{
|
|
TDPtrList<TGGeCurveSegment> 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]));
|
|
}
|
|
} |