61 lines
1.6 KiB
C++
61 lines
1.6 KiB
C++
//-------------------------------------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TAdvanceSampler 类
|
|
// = Version : ver2.0
|
|
// = Author : wlw
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: TAdvanceSampler 定义
|
|
// = Maintainers:
|
|
//
|
|
//-------------------------------------------------------------------------------------------------------+
|
|
#include "StdAfx.h"
|
|
#include "TAdvanceSampler.h"
|
|
#include "TGGiScreenDrawStream.h"
|
|
#include "TchGlobalFunc.h"
|
|
#include "tchprivateglobalfunc.h"
|
|
|
|
TADSGePoint3d TAdvanceSampler::g_ptLastTemp;
|
|
TADSGePoint3d TAdvanceSampler::g_ptBase;
|
|
int TAdvanceSampler::g_nCtrlFlag = 0;
|
|
double TAdvanceSampler::g_nDirection = 0.0;
|
|
|
|
TAdvanceSampler::~TAdvanceSampler()
|
|
{
|
|
|
|
}
|
|
|
|
void TAdvanceSampler::Init(TADSGePoint3d ptBase, int nFlag)
|
|
{
|
|
g_ptBase = g_ptLastTemp = ptBase;
|
|
g_nCtrlFlag = nFlag;
|
|
g_nDirection = 0.0;
|
|
}
|
|
|
|
int TAdvanceSampler::MoveSampler(ads_point pt0, ads_matrix mat)
|
|
{
|
|
// Move操作时,没有基点,正交不起作用
|
|
TADSGePoint3d pt;
|
|
if(g_nCtrlFlag)
|
|
{
|
|
TchExport::CapturePoint(g_ptBase, pt0, pt); //使得正交(Ortho)和捕捉(SNAP)起作用
|
|
}
|
|
else
|
|
{
|
|
TchExport::CapturePoint(NULL, pt0, pt); //使得正交(Ortho)和捕捉(SNAP)起作用
|
|
}
|
|
|
|
|
|
if(g_nCtrlFlag)
|
|
{
|
|
TGGiScreenDrawStream dc(-1);
|
|
dc << TGGeLine(g_ptBase, g_ptLastTemp);
|
|
dc << TGGeLine(g_ptBase, pt);
|
|
g_ptLastTemp = pt;
|
|
}
|
|
g_nDirection = ads_angle(g_ptBase, pt);
|
|
|
|
pt = TchPrivate::Ucs2Wcs(pt);
|
|
TchPrivate::Ucs2Wcs(g_ptBase).GetMoveMatrix(pt, mat);
|
|
return RTNORM;
|
|
}
|