Files
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

73 lines
1.5 KiB
C++

//-----------------------------------------------------------------------------+
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
// = FileName : TADSPointDir2d 类
// = Version : ver2.0
// = Author : wlw
// = CreateDate : 2002-09-09
// = Description: TADSPointDir2d 类定义
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#include "StdAfx.h"
#include "TADSGePointDir2d.h"
#include "tchprivateglobalfunc.h"
TADSGePointDir2d::TADSGePointDir2d()
: nDirection(0)
{
}
TADSGePointDir2d::TADSGePointDir2d(ads_real dDrt)
: nDirection(dDrt)
{
}
TADSGePointDir2d::TADSGePointDir2d(const TADSGePointDir2d &src)
{
*this = src;
}
TADSGePointDir2d::~TADSGePointDir2d()
{
}
TADSGePointDir2d & TADSGePointDir2d ::operator = (const TADSGePointDir2d &src)
{
memcpy(this, &src, sizeof(TADSGePointDir2d));
return *this;
}
TADSGePoint3d TADSGePointDir2d ::Polar(ads_real nDist) const
{
TADSGePoint3d ptDest;
ads_polar(&x, nDirection, nDist, ptDest);
return ptDest;
}
void TADSGePointDir2d ::ShowMe()
{
}
void TADSGePointDir2d ::TransformBy(ads_matrix mat)
{
TADSGePoint3d::TransformBy(mat);
AcGeVector3d vt(cos(nDirection), sin(nDirection), 0.0);
vt.transformBy(TchPrivate::AsAcGeMatrix3d(mat));
nDirection = ads_angle(TADSGePoint3d(), TADSGePoint3d(vt[0], vt[1], vt[2]));
}
TADSGePointDir2d TADSGePointDir2d ::TransformAs(ads_matrix mat) const
{
TADSGePointDir2d ptDir = *this;
ptDir.TransformBy(mat);
return ptDir;
}