本文整理汇总了C++中llinventorymodel::cat_array_t::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ cat_array_t::push_back方法的具体用法?C++ cat_array_t::push_back怎么用?C++ cat_array_t::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类llinventorymodel::cat_array_t
的用法示例。
在下文中一共展示了cat_array_t::push_back方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveInvCache
//static
void LLLocalInventory::saveInvCache(std::string filename, LLFolderView* folder)
{
LLInventoryModel* model = &gInventory;
std::set<LLUUID> selected_items;
folder->getSelectionList(selected_items);
if(selected_items.size() < 1)
{
// No items selected? Wtfboom
return;
}
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
// Make complete lists of child categories and items
std::set<LLUUID>::iterator sel_iter = selected_items.begin();
std::set<LLUUID>::iterator sel_end = selected_items.end();
for( ; sel_iter != sel_end; ++sel_iter)
{
LLInventoryCategory* cat = model->getCategory(*sel_iter);
if(cat)
{
climb(cat, cats, items);
}
}
// And what about items inside a folder that wasn't selected?
// I guess I will just add selected items, so long as they aren't already added
for(sel_iter = selected_items.begin(); sel_iter != sel_end; ++sel_iter)
{
LLInventoryItem* item = model->getItem(*sel_iter);
if(item)
{
if(std::find(items.begin(), items.end(), item) == items.end())
{
items.push_back(LLPointer<LLViewerInventoryItem>((LLViewerInventoryItem*)item));
LLInventoryCategory* parent = model->getCategory(item->getParentUUID());
if(std::find(cats.begin(), cats.end(), parent) == cats.end())
{
cats.push_back(LLPointer<LLViewerInventoryCategory>((LLViewerInventoryCategory*)parent));
}
}
}
}
LLInventoryModel::saveToFile(filename, cats, items);
}
示例2: getPath
// Checked: 2010-08-30 (RLVa-1.2.1c) | Modified: RLVa-1.2.1c
bool RlvInventory::getPath(const uuid_vec_t& idItems, LLInventoryModel::cat_array_t& folders) const
{
// Sanity check - can't do anything without a shared root
const LLViewerInventoryCategory* pRlvRoot = RlvInventory::instance().getSharedRoot();
if (!pRlvRoot)
return false;
folders.clear();
for (uuid_vec_t::const_iterator itItem = idItems.begin(); itItem != idItems.end(); ++itItem)
{
const LLInventoryItem* pItem = gInventory.getItem(*itItem);
if ( (pItem) && (gInventory.isObjectDescendentOf(pItem->getUUID(), pRlvRoot->getUUID())) )
{
// If the containing folder is a folded folder we need its parent
LLViewerInventoryCategory* pFolder = gInventory.getCategory(pItem->getParentUUID());
if (RlvInventory::instance().isFoldedFolder(pFolder, true))
pFolder = gInventory.getCategory(pFolder->getParentUUID());
folders.push_back(pFolder);
}
}
return (folders.count() != 0);
}