当前位置: 首页>>代码示例>>C++>>正文


C++ ObjectVector::push_back方法代码示例

本文整理汇总了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();
    }
}    
开发者ID:EternalWind,项目名称:Ogitor-Facade,代码行数:35,代码来源:OgitorsRootRegExp.cpp

示例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();
    }
}
开发者ID:EternalWind,项目名称:Ogitor-Facade,代码行数:36,代码来源:OgitorsRootRegExp.cpp

示例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++;
    }
}
开发者ID:jacmoe,项目名称:ogitor,代码行数:12,代码来源:MultiSelEditor.cpp

示例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;
}
开发者ID:naderman,项目名称:spoac,代码行数:12,代码来源:STM.cpp

示例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();
    }
}
开发者ID:EternalWind,项目名称:Ogitor-Facade,代码行数:48,代码来源:OgitorsRootRegExp.cpp

示例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();
    }
}
开发者ID:EternalWind,项目名称:Ogitor-Facade,代码行数:22,代码来源:OgitorsRootRegExp.cpp


注:本文中的ObjectVector::push_back方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。