#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); } }