Files
envi-code/SourceCode/Code2026/Dimension/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

84 lines
1.4 KiB
C++

#include "StdAfx.h"
#include "DragPickEntSet.h"
#include "globalFunc.h"
using namespace GlobalFunc;
void DragPickEntSet::_DragPickSet()
{
tempEnt[0] = tempEnt[1] = NULL;
}
DragPickEntSet::DragPickEntSet(const ADSGePoint3d &loc, int tag)
: PickEntSet(tag)
{
_DragPickSet();
EntitySet ent;
if (ent.Make(RTDXF0,_T("POINT"), 10, &loc.x, NULL) == RTNORM)
{
ent > tempEnt;
Get(_T("L"));
}
}
DragPickEntSet::DragPickEntSet(const ADSGePoint3d &loc, const PickEntSet &picks, int tag)
: PickEntSet(tag)
{
_DragPickSet();
EntitySet 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 ADSGePoint3d &src, ADSGePoint3d &res) const
{
return EntToMove((TLong_ptr *)name, src, res);
}
int DragPickEntSet::Rotate(const ADSGePoint3d &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 DragPickEntSet::Scale(const ADSGePoint3d &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);
}
}