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

92 lines
1.9 KiB
C++

//-------------------------------------------------------------------------------------------------------+
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
// = FileName : TDragPickEntSet 类
// = Version : ver2.0
// = Author : wlw
// = CreateDate : 2002-09-09
// = Description: TDragPickEntSet 定义
// = Maintainers:
//
//-------------------------------------------------------------------------------------------------------+
#include "StdAfx.h"
#include "TDragPickEntSet.h"
#include "TchGlobalFunc.h"
void TDragPickEntSet::_DragPickSet()
{
tempEnt[0] = tempEnt[1] = NULL;
}
TDragPickEntSet::TDragPickEntSet(const TADSGePoint3d &loc, int tag)
: TPickEntSet(tag)
{
_DragPickSet();
TEntitySet ent;
if (ent.Make(RTDXF0,_T("POINT"), 10, &loc.x, NULL) == RTNORM)
{
ent > tempEnt;
Get(_T("L"));
}
}
TDragPickEntSet::TDragPickEntSet(const TADSGePoint3d &loc, const TPickEntSet &picks, int tag)
: TPickEntSet(tag)
{
_DragPickSet();
TEntitySet ent;
if (ent.Make(RTDXF0,_T("POINT"), 10, &loc.x, NULL) == RTNORM)
{
ent > tempEnt;
Get(_T("L"));
long len = picks.Length();
for (long i = 0; i < len; i++)
{
(*this) += picks[i];
}
}
}
TDragPickEntSet::~TDragPickEntSet()
{
if (tempEnt[0] && tempEnt[1])
{
ads_entdel(tempEnt);
}
}
int TDragPickEntSet::Move(const TADSGePoint3d &src, TADSGePoint3d &res) const
{
return EntToMove((TLong_ptr *)name, src, res);
}
int TDragPickEntSet::Rotate(const TADSGePoint3d &src, ads_real *res) const
{
ads_real ang;
if (res)
{
return EntToRotate((TLong_ptr *)name, src, res);
}
else
{
return EntToRotate((TLong_ptr *)name, src, &ang);
}
}
int TDragPickEntSet::Scale(const TADSGePoint3d &src, ads_real *res) const
{
ads_real nScl;
if (res)
{
return EntToScale((TLong_ptr *)name, src, res);
}
else
{
return EntToScale((TLong_ptr *)name, src, &nScl);
}
}