Files
envi-code/SourceCode/Code2026/AdsXRx/AecDbGripAngleDim.cpp
T
2026-09-28 15:28:50 +08:00

81 lines
1.9 KiB
C++

//-----------------------------------------------------------------------------+
// Copyright (C), 1998-2007, SH Software Co. Ltd.
// = FileName : AecDbGripAngleDim.cpp
// = Version : ver2.0
// = Author : zjq
// = CreateDate : 2002-09-09
// = Description: ¼Ðµã½Ç¶È±ê×¢ÀàµÄ¶¨Òå
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#include "StdAfx.h"
#include "AecDbGripAngleDim.h"
#if ARX > 17
AecDbGripAngleDim::AecDbGripAngleDim(int flag,bool bHover)
:AecDbGripDim(flag,bHover)
{
}
AecDbGripAngleDim::~AecDbGripAngleDim()
{
}
void AecDbGripAngleDim::SetData(AcGePoint3d ptCenter,AcGePoint3d ptStart,AcGePoint3d ptEnd,AcGePoint3d ptArc)
{
m_ptCenter = ptCenter;
m_ptStart = ptStart;
m_ptEnd = ptEnd;
m_ptArc = ptArc;
}
AcDbDimension* AecDbGripAngleDim::CreateDimEnt()const
{
return new AcDb3PointAngularDimension;
}
void AecDbGripAngleDim::SetData(AcGePoint3d ptCenter,AcGePoint3d ptStart,AcGePoint3d ptEnd)
{
AcGePoint3d ptMid;
Midpoint(ptStart,ptEnd,ptMid);
AcGeVector3d vt1 = ptStart - ptCenter,vt2 = ptEnd - ptCenter, vt3 = ptMid - ptCenter;
m_ptCenter = ptCenter;
m_ptStart = ptCenter + vt1.normal();
m_ptEnd = ptCenter + vt2.normal();
m_ptArc = ptCenter + vt3.normal() * vt1.length();
}
void AecDbGripAngleDim::SetData(XCurveSegment arc,double dist)
{
m_ptCenter = arc.GetArc().GetCenterPt().AsAcGePoint3d();
m_ptStart = arc.GetStartPoint().AsAcGePoint3d();
m_ptEnd = arc.GetEndPoint().AsAcGePoint3d();
if(dist<0)
{
dist = m_fDimScale * 0.5;
}
m_ptArc = arc.Offset(dist,OFFSET_RIGHT).MidPoint().AsAcGePoint3d();
}
void AecDbGripAngleDim::UpdateDimEnt()
{
AecDbGripDim::UpdateDimEnt();
AcDb3PointAngularDimension*pDim = AcDb3PointAngularDimension::cast(DimEnt());
if(pDim == NULL)
{
return;
}
pDim->setCenterPoint(m_ptCenter);
pDim->setArcPoint(m_ptArc);
pDim->setXLine1Point(m_ptStart);
pDim->setXLine2Point(m_ptEnd);
}
#endif