//-------------------------------------------------------------------------------------------------------+ // 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); } }