Files
envi-code/SourceCode/Code2026/tg_shs/shs_geLib/TADSGePointDir2d.cpp
T
2026-09-28 15:28:50 +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;
}