本文整理汇总了C++中ObjectVector::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectVector::push_back方法的具体用法?C++ ObjectVector::push_back怎么用?C++ ObjectVector::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectVector
的用法示例。
在下文中一共展示了ObjectVector::push_back方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RegExpByProperty
//-----------------------------------------------------------------------------------------
void OgitorsRoot::RegExpByProperty(const Ogre::String& nameregexp, bool inverse, const ObjectVector& list_in, ObjectVector& list_out)
{
list_out.clear();
try
{
const boost::regex e(nameregexp.c_str());
OgitorsPropertyVector pvec;
for(unsigned int i = 0;i < list_in.size();i++)
{
pvec = list_in[i]->getProperties()->getPropertyVector();
bool add_list = false;
for(unsigned int k = 0;k < pvec.size();k++)
{
if(regex_match(pvec[k]->getName().c_str(), e))
{
add_list = true;
break;
}
}
if(add_list != inverse)
list_out.push_back(list_in[i]);
}
}
catch(...)
{
list_out.clear();
}
}
示例2: GetObjectListByName
//-----------------------------------------------------------------------------------------
void OgitorsRoot::GetObjectListByName(unsigned int type, const Ogre::String& nameregexp, bool inverse, ObjectVector& list)
{
list.clear();
try
{
const boost::regex e(nameregexp.c_str());
NameObjectPairList::iterator list_st, list_ed;
if(type == 0)
{
list_st = mNameList.begin();
list_ed = mNameList.end();
}
else
{
list_st = mNamesByType[type].begin();
list_ed = mNamesByType[type].end();
}
while(list_st != list_ed)
{
if(regex_match(list_st->first.c_str(), e) != inverse)
{
list.push_back(list_st->second);
}
list_st++;
}
}
catch(...)
{
list.clear();
}
}
示例3: getSelection
//--------------------------------------------------------------------------------
void CMultiSelEditor::getSelection(ObjectVector& list)
{
list.clear();
NameObjectPairList::const_iterator it = mSelectedObjects.begin();
while(it != mSelectedObjects.end())
{
list.push_back(it->second);
it++;
}
}
示例4: vectorFromIds
ObjectVector STM::vectorFromIds(const std::vector<std::string>& ids)
{
ObjectVector vector;
std::vector<std::string>::const_iterator id;
for (id = ids.begin(); id != ids.end(); ++id)
{
vector.push_back(get(*id));
}
return vector;
}
示例5: GetObjectListByCustomProperty
//-----------------------------------------------------------------------------------------
void OgitorsRoot::GetObjectListByCustomProperty(unsigned int type, const Ogre::String& nameregexp, bool inverse, ObjectVector& list)
{
list.clear();
try
{
const boost::regex e(nameregexp.c_str());
NameObjectPairList::iterator list_st, list_ed;
if(type == 0)
{
list_st = mNameList.begin();
list_ed = mNameList.end();
}
else
{
list_st = mNamesByType[type].begin();
list_ed = mNamesByType[type].end();
}
OgitorsPropertyVector pvec;
while(list_st != list_ed)
{
pvec = list_st->second->getCustomProperties()->getPropertyVector();
bool add_list = false;
for(unsigned int k = 0;k < pvec.size();k++)
{
if(regex_match(pvec[k]->getName().c_str(), e))
{
add_list = true;
break;
}
}
if(add_list != inverse)
list.push_back(list_st->second);
list_st++;
}
}
catch(...)
{
list.clear();
}
}
示例6: RegExpByName
//-----------------------------------------------------------------------------------------
void OgitorsRoot::RegExpByName(const Ogre::String& nameregexp, bool inverse, const ObjectVector& list_in, ObjectVector& list_out)
{
list_out.clear();
try
{
const boost::regex e(nameregexp.c_str());
for(unsigned int i = 0;i < list_in.size();i++)
{
if(regex_match(list_in[i]->getName().c_str(), e) != inverse)
{
list_out.push_back(list_in[i]);
}
}
}
catch(...)
{
list_out.clear();
}
}