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.

44 lines
852 B
C++

#include "StdAfx.h"
#include "CommandMoveNode.h"
CCommandMoveNode::CCommandMoveNode(void)
{
}
CCommandMoveNode::~CCommandMoveNode(void)
{
}
CString CCommandMoveNode::GetStr()
{
CString str = "_moveNode 移动节点";
return str;
}
void CCommandMoveNode::SetPar(int idx,Dbxy OldPt,Dbxy NewPt)
{
m_NodeIdx = idx;//操作node 节点的索引值
m_OldPt = OldPt;//旧的坐标
m_NewPt = NewPt;//新的坐标
}
void CCommandMoveNode::ExcuteExt()
{
SetNode(true);
}
void CCommandMoveNode::UndoExt()
{
SetNode(false);
}
void CCommandMoveNode::SetNode(bool bExcute)
{
CObjBase *pBase = m_ObjContainer.GetCurOpObj();
if(pBase)
{
if(bExcute)
{
pBase->SetNodePtByIdx(m_NodeIdx,m_NewPt);
}
else
{
pBase->SetNodePtByIdx(m_NodeIdx,m_OldPt);
}
}
}