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.
69 lines
1.6 KiB
C++
69 lines
1.6 KiB
C++
#include "StdAfx.h"
|
|
#include "CommandCut.h"
|
|
#include "Layer.h"
|
|
#include "GlobalFunction.h"
|
|
|
|
|
|
CCommandCut::CCommandCut(void)
|
|
{
|
|
}
|
|
CCommandCut::~CCommandCut(void)
|
|
{
|
|
}
|
|
//m_ObjContainer 的第一个为剪切的obj
|
|
//剪切后的obj 可能为0~2 个
|
|
void CCommandCut::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(false);
|
|
if((*iter).IsNull()==false)
|
|
{
|
|
if(iter == vec.begin())
|
|
{
|
|
layer.DelObj((*iter));
|
|
}
|
|
else
|
|
{
|
|
layer.AddObject((*iter));
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
void CCommandCut::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)
|
|
{
|
|
if(iter == vec.begin())
|
|
{
|
|
layer.AddObject((*iter));
|
|
}
|
|
else
|
|
{
|
|
layer.DelObj((*iter));
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
CString CCommandCut::GetStr()
|
|
{
|
|
CString str = "_cut 修剪-----";
|
|
return str;
|
|
}
|
|
|