Files
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.1 KiB
C++

#include "StdAfx.h"
#include "globalfunc.h"
#include "ADSGePointDir2d.h"
ADSGePointDir2d::ADSGePointDir2d()
: nDirection(0)
{
}
ADSGePointDir2d::ADSGePointDir2d(ads_real dDrt)
: nDirection(dDrt)
{
}
ADSGePointDir2d::ADSGePointDir2d(const ADSGePointDir2d &src)
{
*this = src;
}
ADSGePointDir2d::~ADSGePointDir2d()
{
}
ADSGePointDir2d & ADSGePointDir2d ::operator = (const ADSGePointDir2d &src)
{
memcpy(this, &src, sizeof(ADSGePointDir2d));
return *this;
}
ADSGePoint3d ADSGePointDir2d ::Polar(ads_real nDist) const
{
ADSGePoint3d ptDest;
ads_polar(&x, nDirection, nDist, ptDest);
return ptDest;
}
void ADSGePointDir2d ::ShowMe()
{
}
void ADSGePointDir2d ::TransformBy(ads_matrix mat)
{
ADSGePoint3d::TransformBy(mat);
AcGeVector3d vt(cos(nDirection), sin(nDirection), 0.0);
vt.transformBy(GlobalFunc::AsAcGeMatrix3d(mat));
nDirection = ads_angle(ADSGePoint3d(), ADSGePoint3d(vt[0], vt[1], vt[2]));
}
ADSGePointDir2d ADSGePointDir2d ::TransformAs(ads_matrix mat) const
{
ADSGePointDir2d ptDir = *this;
ptDir.TransformBy(mat);
return ptDir;
}