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 "CommandJion.h"
|
|
#include "Layer.h"
|
|
#include "GlobalFunction.h"
|
|
|
|
|
|
CCommandJion::CCommandJion(void)
|
|
{
|
|
}
|
|
CCommandJion::~CCommandJion(void)
|
|
{
|
|
}
|
|
//最后一个是合并后的obj
|
|
void CCommandJion::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.end()-1)
|
|
{
|
|
layer.AddObject((*iter));
|
|
}
|
|
else
|
|
{
|
|
layer.DelObj((*iter));
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
void CCommandJion::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.end()-1)
|
|
{
|
|
layer.DelObj((*iter));
|
|
}
|
|
else
|
|
{
|
|
layer.AddObject((*iter));
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
CString CCommandJion::GetStr()
|
|
{
|
|
CString str = "_jion 合并-----";
|
|
return str;
|
|
}
|
|
|