63 lines
1.1 KiB
C++
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;
|
|
}
|
|
|