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++
68 lines
1.6 KiB
C++
#include "StdAfx.h"
|
|
#include "CommandBreakNode.h"
|
|
#include "Layer.h"
|
|
#include "GlobalFunction.h"
|
|
|
|
|
|
CCommandBreakNode::CCommandBreakNode(void)
|
|
{
|
|
}
|
|
CCommandBreakNode::~CCommandBreakNode(void)
|
|
{
|
|
}
|
|
//第一个是打断之前的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 打断节点-----";
|
|
return str;
|
|
}
|
|
|