73 lines
1.3 KiB
C++
73 lines
1.3 KiB
C++
//-----------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, SH Software Co. Ltd.
|
|
// = FileName : TADSPointDir2d Àà
|
|
// = Version : ver2.0
|
|
// = Author : zjq
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: TADSPointDir2d ÀඨÒå
|
|
// = Maintainers:
|
|
//
|
|
//-----------------------------------------------------------------------------+
|
|
#include "StdAfx.h"
|
|
#include "XPointDir2d.h"
|
|
#include "XPrivateGlobalFunc.h"
|
|
|
|
XPointDir2d::XPointDir2d()
|
|
: nDirection(0)
|
|
{
|
|
|
|
}
|
|
|
|
XPointDir2d::XPointDir2d(ads_real dDrt)
|
|
: nDirection(dDrt)
|
|
{
|
|
|
|
}
|
|
|
|
XPointDir2d::XPointDir2d(const XPointDir2d &src)
|
|
{
|
|
*this = src;
|
|
}
|
|
|
|
XPointDir2d::~XPointDir2d()
|
|
{
|
|
|
|
}
|
|
|
|
XPointDir2d & XPointDir2d ::operator = (const XPointDir2d &src)
|
|
{
|
|
memcpy(this, &src, sizeof(XPointDir2d));
|
|
return *this;
|
|
}
|
|
|
|
XPoint XPointDir2d ::Polar(ads_real nDist) const
|
|
{
|
|
XPoint ptDest;
|
|
ads_polar(&x, nDirection, nDist, ptDest);
|
|
return ptDest;
|
|
}
|
|
|
|
void XPointDir2d ::ShowMe()
|
|
{
|
|
|
|
}
|
|
|
|
void XPointDir2d ::TransformBy(ads_matrix mat)
|
|
{
|
|
XPoint::TransformBy(mat);
|
|
|
|
AcGeVector3d vt(cos(nDirection), sin(nDirection), 0.0);
|
|
vt.transformBy(XPrivate::AsAcGeMatrix3d(mat));
|
|
|
|
nDirection = ads_angle(XPoint(), XPoint(vt[0], vt[1], vt[2]));
|
|
}
|
|
|
|
XPointDir2d XPointDir2d ::TransformAs(ads_matrix mat) const
|
|
{
|
|
XPointDir2d ptDir = *this;
|
|
ptDir.TransformBy(mat);
|
|
|
|
return ptDir;
|
|
}
|
|
|