Files
envi-code/SourceCode/Code2026/AdsXRx/DragPickEntSet.cpp
T
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.8 KiB
C++

//-------------------------------------------------------------------------------------------------------+
// Copyright (C), 1998-2007, SH Software Co. Ltd.
// = FileName : DragPickEntSet 类
// = Version : ver2.0
// = Author : zjq
// = CreateDate : 2002-09-09
// = Description: DragPickEntSet 定义
// = Maintainers:
//
//-------------------------------------------------------------------------------------------------------+
#include "StdAfx.h"
#include "DragPickEntSet.h"
#include "XGlobalFunc.h"
void DragPickEntSet::_DragPickSet()
{
tempEnt[0] = tempEnt[1] = NULL;
}
DragPickEntSet::DragPickEntSet(const XPoint &loc, int tag)
: PickSet(tag)
{
_DragPickSet();
Entity ent;
if (ent.Make(RTDXF0,_T("POINT"), 10, &loc.x, NULL) == RTNORM)
{
ent > tempEnt;
Get(_T("L"));
}
}
DragPickEntSet::DragPickEntSet(const XPoint &loc, const PickSet &picks, int tag)
: PickSet(tag)
{
_DragPickSet();
Entity 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];
}
}
}
DragPickEntSet::~DragPickEntSet()
{
if (tempEnt[0] && tempEnt[1])
{
ads_entdel(tempEnt);
}
}
int DragPickEntSet::Move(const XPoint &src, XPoint &res) const
{
return AT_move((LONG_PTR *)name, src, res);
}
int DragPickEntSet::Rotate(const XPoint &src, ads_real *res) const
{
ads_real ang;
if (res)
{
return AT_rotate((LONG_PTR *)name, src, res);
}
else
{
return AT_rotate((LONG_PTR *)name, src, &ang);
}
}
int DragPickEntSet::Scale(const XPoint &src, ads_real *res) const
{
ads_real nScl;
if (res)
{
return AT_scale((LONG_PTR *)name, src, res);
}
else
{
return AT_scale((LONG_PTR *)name, src, &nScl);
}
}