You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.6 KiB
C++
71 lines
1.6 KiB
C++
#include "StdAfx.h"
|
|
#include "CommandStretch.h"
|
|
|
|
|
|
CCommandStretch::CCommandStretch(void)
|
|
{
|
|
m_bSetXY = false;//是否同时设置XY 方向
|
|
}
|
|
CCommandStretch::~CCommandStretch(void)
|
|
{
|
|
}
|
|
CString CCommandStretch::GetStr()
|
|
{
|
|
CString str1 = "_stretch 拉伸-------- [方向] : <";
|
|
CString str2;
|
|
if(m_Par.xy == _X)
|
|
str2 = "X> [旧尺寸] : <";
|
|
else
|
|
str2 = "Y> [旧尺寸] : <";
|
|
CString str3;
|
|
str3.Format("%lf",m_Par.OldSize);
|
|
CString str4 = "> [新尺寸] : <";
|
|
CString str5;
|
|
str5.Format("%lf",m_Par.NewSize);
|
|
CString str6 = ">";
|
|
return str1+str2+str3+str4+str5+str6;
|
|
};
|
|
void CCommandStretch::SetOperateParY(SObjOperatePar par)
|
|
{
|
|
m_bSetXY = true;//是否同时设置XY 方向
|
|
m_ParY = par;
|
|
};
|
|
void CCommandStretch::ExcuteExt()
|
|
{
|
|
if(m_bSetXY)
|
|
{
|
|
m_ObjContainer.OperateObj(m_Par,true);
|
|
m_ObjContainer.OperateObj(m_ParY,true);
|
|
}
|
|
else
|
|
{
|
|
m_ObjContainer.OperateObj(m_Par,true);
|
|
}
|
|
}
|
|
void CCommandStretch::UndoExt()
|
|
{
|
|
SObjOperatePar par = m_Par;
|
|
par.OpType = _OP_STRETCH;
|
|
par.BasePt = m_Par.BasePt;
|
|
par.OldSize = m_Par.NewSize;
|
|
par.Diff = m_Par.Diff*(-1);
|
|
par.xy = m_Par.xy;
|
|
|
|
SObjOperatePar parY = m_ParY;
|
|
parY.OpType = _OP_STRETCH;
|
|
parY.BasePt = m_ParY.BasePt;
|
|
parY.OldSize = m_ParY.NewSize;
|
|
parY.Diff = m_ParY.Diff*(-1);
|
|
parY.xy = m_ParY.xy;
|
|
|
|
if(m_bSetXY)
|
|
{
|
|
m_ObjContainer.OperateObj(par,true);
|
|
m_ObjContainer.OperateObj(parY,true);
|
|
}
|
|
else
|
|
{
|
|
m_ObjContainer.OperateObj(par,true);
|
|
}
|
|
}
|