92 lines
1.8 KiB
C++
92 lines
1.8 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);
|
|
}
|
|
}
|
|
|
|
|
|
|