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.

68 lines
1.6 KiB
C++

#include "StdAfx.h"
#include "CommandBreakNode.h"
#include "Layer.h"
#include "GlobalFunction.h"
CCommandBreakNode::CCommandBreakNode(void)
{
}
CCommandBreakNode::~CCommandBreakNode(void)
{
}
//<2F><>һ<EFBFBD><D2BB><EFBFBD>Ǵ<EFBFBD><C7B4><EFBFBD>֮ǰ<D6AE><C7B0>obj
void CCommandBreakNode::ExcuteExt()
{
CLayer &layer = gLayer;
vector<Sptr<CObjBase>> &vec = m_ObjContainer.GetObjVec();
vector<Sptr<CObjBase>>::iterator iter = vec.begin();
vector<Sptr<CObjBase>>::iterator iter_end = vec.end();
for(;iter!=iter_end;iter++)
{
if((*iter).IsNull()==false)
{
(*iter)->SetSelected(true);
if((*iter).IsNull()==false)
{
if(iter == vec.begin())
{
layer.DelObj((*iter));
}
else
{
layer.AddObject((*iter));
}
}
}
}
}
void CCommandBreakNode::UndoExt()
{
CLayer &layer = gLayer;
vector<Sptr<CObjBase>> &vec = m_ObjContainer.GetObjVec();
vector<Sptr<CObjBase>>::iterator iter = vec.begin();
vector<Sptr<CObjBase>>::iterator iter_end = vec.end();
for(;iter!=iter_end;iter++)
{
if((*iter).IsNull()==false)
{
(*iter)->SetSelected(true);
if(iter == vec.begin())
{
layer.AddObject((*iter));
}
else
{
layer.DelObj((*iter));
}
}
}
}
CString CCommandBreakNode::GetStr()
{
CString str = "_break <20><><EFBFBD>Ͻڵ<CFBD>-----";
return str;
}