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.

47 lines
1.1 KiB
C++

#include "StdAfx.h"
#include "CommandArray.h"
#include "Layer.h"
#include "GlobalFunction.h"
CCommandArray::CCommandArray(void)
{
}
CCommandArray::~CCommandArray(void)
{
}
void CCommandArray::ExcuteExt()
{
CLayer &layer = gLayer;
//先删除阵列基准obj
layer.DelObj(m_BaseObjContainer);
//再导入阵列对象
layer.AddObject(m_ObjContainer);
}
void CCommandArray::UndoExt()
{
CLayer &layer = gLayer;
//删除阵列对象
layer.DelObj(m_ObjContainer);
//导入基准对象
layer.AddObject(m_BaseObjContainer);
}
CString CCommandArray::GetStr()
{
CString str = "_array 阵列-----";
vector<Sptr<CObjBase>> &vec = m_ObjContainer.GetObjVec();
vector<Sptr<CObjBase>>::iterator iter = vec.begin();
vector<Sptr<CObjBase>>::iterator iter_end = vec.end();
if(vec.size()>1)
{
CString str1;
str1.Format("%ld",vec.size());
str +="[数量] : <"+str1+">";
}
return str;
};
//保存基准obj
void CCommandArray::SaveBaseObj(CObjContainer &ObjContainer)
{
ObjContainer.AllObjAddToContainer(m_BaseObjContainer,true);
}