本文整理汇总了C++中llinventorymodel::cat_array_t类的典型用法代码示例。如果您正苦于以下问题:C++ cat_array_t类的具体用法?C++ cat_array_t怎么用?C++ cat_array_t使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了cat_array_t类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getDirectDescendentsFolderCount
// Checked: 2011-10-06 (RLVa-1.4.2a) | Added: RLVa-1.4.2a
S32 RlvInventory::getDirectDescendentsFolderCount(const LLInventoryCategory* pFolder)
{
LLInventoryModel::cat_array_t* pFolders = NULL; LLInventoryModel::item_array_t* pItems = NULL;
if (pFolder)
gInventory.getDirectDescendentsOf(pFolder->getUUID(), pFolders, pItems);
return (pFolders) ? pFolders->size() : 0;
}
示例2:
// Checked: 2011-10-06 (RLVa-1.4.2a) | Modified: RLVa-1.4.2a
const LLUUID& RlvInventory::getSharedRootID() const
{
if ( (m_idRlvRoot.isNull()) && (gInventory.isInventoryUsable()) )
{
LLInventoryModel::cat_array_t* pFolders; LLInventoryModel::item_array_t* pItems;
gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), pFolders, pItems);
if (pFolders)
{
// NOTE: we might have multiple #RLV folders (pick the first one with sub-folders; otherwise the last one with no sub-folders)
const LLViewerInventoryCategory* pFolder;
for (S32 idxFolder = 0, cntFolder = pFolders->count(); idxFolder < cntFolder; idxFolder++)
{
if ( ((pFolder = pFolders->get(idxFolder)) != NULL) && (cstrSharedRoot == pFolder->getName()) )
{
m_idRlvRoot = pFolder->getUUID();
if (getDirectDescendentsFolderCount(pFolder) > 0)
break;
}
}
if ( (m_idRlvRoot.notNull()) && (!gInventory.containsObserver((RlvInventory*)this)) )
gInventory.addObserver((RlvInventory*)this);
}
}
return m_idRlvRoot;
}
示例3: findMatchedFriendCards
void LLFriendCardsManager::findMatchedFriendCards(const LLUUID& avatarID, LLInventoryModel::item_array_t& items) const
{
LLInventoryModel::cat_array_t cats;
LLUUID friendFolderUUID = findFriendFolderUUIDImpl();
LLViewerInventoryCategory* friendFolder = gInventory.getCategory(friendFolderUUID);
if (NULL == friendFolder)
return;
LLParticularBuddyCollector matchFunctor(avatarID);
LLInventoryModel::cat_array_t subFolders;
subFolders.push_back(friendFolder);
while (subFolders.count() > 0)
{
LLViewerInventoryCategory* cat = subFolders.get(0);
subFolders.remove(0);
gInventory.collectDescendentsIf(cat->getUUID(), cats, items,
LLInventoryModel::EXCLUDE_TRASH, matchFunctor);
move_from_to_arrays(cats, subFolders);
}
}
示例4: getSharedFolder
// Checked: 2010-02-28 (RLVa-1.2.0a) | Modified: RLVa-1.0.1a
LLViewerInventoryCategory* RlvInventory::getSharedFolder(const LLUUID& idParent, const std::string& strFolderName) const
{
LLInventoryModel::cat_array_t* pFolders; LLInventoryModel::item_array_t* pItems;
gInventory.getDirectDescendentsOf(idParent, pFolders, pItems);
if ( (!pFolders) || (strFolderName.empty()) )
return NULL;
// If we can't find an exact match then we'll settle for a "contains" match
LLViewerInventoryCategory* pPartial = NULL;
//LLStringUtil::toLower(strFolderName); <- everything was already converted to lower case before
std::string strName;
for (S32 idxFolder = 0, cntFolder = pFolders->count(); idxFolder < cntFolder; idxFolder++)
{
LLViewerInventoryCategory* pFolder = pFolders->get(idxFolder);
strName = pFolder->getName();
if (strName.empty())
continue;
LLStringUtil::toLower(strName);
if (strFolderName == strName)
return pFolder; // Found an exact match, no need to keep on going
else if ( (!pPartial) && (RLV_FOLDER_PREFIX_HIDDEN != strName[0]) && (std::string::npos != strName.find(strFolderName)) )
pPartial = pFolder; // Found a partial (non-hidden) match, but we might still find an exact one (first partial match wins)
}
return pPartial;
}
示例5: fetchSharedInventory
// Checked: 2010-02-28 (RLVa-1.1.3a) | Modified: RLVa-1.0.0h
void RlvInventory::fetchSharedInventory()
{
// Sanity check - don't fetch if we're already fetching, or if we don't have a shared root
const LLViewerInventoryCategory* pRlvRoot = getSharedRoot();
if ( (m_fFetchStarted) || (!pRlvRoot) )
return;
// Grab all the folders under the shared root
LLInventoryModel::cat_array_t folders; LLInventoryModel::item_array_t items;
gInventory.collectDescendents(pRlvRoot->getUUID(), folders, items, FALSE);
// Add them to the "to fetch" list
uuid_vec_t fetchFolders;
fetchFolders.push_back(pRlvRoot->getUUID());
for (S32 idxFolder = 0, cntFolder = folders.count(); idxFolder < cntFolder; idxFolder++)
fetchFolders.push_back(folders.get(idxFolder)->getUUID());
// Now fetch them all in one go
RlvSharedInventoryFetcher* pFetcher = new RlvSharedInventoryFetcher(fetchFolders);
RLV_INFOS << "Starting fetch of " << fetchFolders.size() << " shared folders" << RLV_ENDL;
pFetcher->startFetch();
m_fFetchStarted = true;
if (pFetcher->isFinished())
pFetcher->done();
else
gInventory.addObserver(pFetcher);
}
示例6: hasUniqueVersionFolder
// Tell if a listing has one only version folder
bool hasUniqueVersionFolder(const LLUUID& folder_id)
{
LLInventoryModel::cat_array_t* categories;
LLInventoryModel::item_array_t* items;
gInventory.getDirectDescendentsOf(folder_id, categories, items);
return (categories->size() == 1);
}
示例7: updateFolderCount
void LLFloaterOutbox::updateFolderCount()
{
if (mOutboxInventoryPanel.get() && mOutboxId.notNull())
{
S32 item_count = 0;
if (mOutboxId.notNull())
{
LLInventoryModel::cat_array_t * cats;
LLInventoryModel::item_array_t * items;
gInventory.getDirectDescendentsOf(mOutboxId, cats, items);
item_count = cats->count() + items->count();
}
mOutboxItemCount = item_count;
}
else
{
// If there's no outbox, the number of items in it should be set to 0 for consistency
mOutboxItemCount = 0;
}
if (!mImportBusy)
{
updateFolderCountStatus();
}
}
示例8: computeDifference
//////////////////////////////////////////////////////////////////////////
// Private methods
//////////////////////////////////////////////////////////////////////////
void LLOutfitsList::computeDifference(
const LLInventoryModel::cat_array_t& vcats,
uuid_vec_t& vadded,
uuid_vec_t& vremoved)
{
uuid_vec_t vnew;
// Creating a vector of newly collected sub-categories UUIDs.
for (LLInventoryModel::cat_array_t::const_iterator iter = vcats.begin();
iter != vcats.end();
iter++)
{
vnew.push_back((*iter)->getUUID());
}
uuid_vec_t vcur;
// Creating a vector of currently displayed sub-categories UUIDs.
for (outfits_map_t::const_iterator iter = mOutfitsMap.begin();
iter != mOutfitsMap.end();
iter++)
{
vcur.push_back((*iter).first);
}
LLCommonUtils::computeDifference(vnew, vcur, vadded, vremoved);
}
示例9: move_from_to_arrays
void move_from_to_arrays(LLInventoryModel::cat_array_t& from, LLInventoryModel::cat_array_t& to)
{
while (from.count() > 0)
{
to.put(from.get(0));
from.remove(0);
}
}
示例10: findFSBridgeContainerCategory
LLUUID FSLSLBridge::findFSBridgeContainerCategory()
{
llinfos << "Retrieving FSBridge container category (" << FS_BRIDGE_CONTAINER_FOLDER << ")" << llendl;
if (mBridgeContainerFolderID.notNull())
{
llinfos << "Returning FSBridge container category UUID from instance: " << mBridgeContainerFolderID << llendl;
return mBridgeContainerFolderID;
}
LLUUID LibRootID = gInventory.getLibraryRootFolderID();
if (LibRootID.notNull())
{
LLInventoryModel::item_array_t* items;
LLInventoryModel::cat_array_t* cats;
gInventory.getDirectDescendentsOf(LibRootID, cats, items);
if (cats)
{
S32 count = cats->count();
for (S32 i = 0; i < count; ++i)
{
if (cats->get(i)->getName() == "Objects")
{
LLUUID LibObjectsCatID = cats->get(i)->getUUID();
if (LibObjectsCatID.notNull())
{
LLInventoryModel::item_array_t* objects_items;
LLInventoryModel::cat_array_t* objects_cats;
gInventory.getDirectDescendentsOf(LibObjectsCatID, objects_cats, objects_items);
if (objects_cats)
{
S32 objects_count = objects_cats->count();
for (S32 j = 0; j < objects_count; ++j)
{
if (objects_cats->get(j)->getName() == FS_BRIDGE_CONTAINER_FOLDER)
{
mBridgeContainerFolderID = objects_cats->get(j)->getUUID();
llinfos << "FSBridge container category found in library. UUID: " << mBridgeContainerFolderID << llendl;
gInventory.fetchDescendentsOf(mBridgeContainerFolderID);
return mBridgeContainerFolderID;
}
}
}
}
}
}
}
}
llwarns << "FSBridge container category not found in library!" << llendl;
return LLUUID();
}
示例11: findSharedFolders
// Checked: 2010-04-07 (RLVa-1.2.0a) | Modified: RLVa-1.0.0h
bool RlvInventory::findSharedFolders(const std::string& strCriteria, 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();
LLInventoryModel::item_array_t items;
RlvCriteriaCategoryCollector f(strCriteria);
gInventory.collectDescendentsIf(pRlvRoot->getUUID(), folders, items, FALSE, f);
return (folders.count() != 0);
}
示例12: getFolderCount
S32 LLFloaterMarketplaceListings::getFolderCount()
{
if (mPanelListings && mRootFolderId.notNull())
{
LLInventoryModel::cat_array_t * cats;
LLInventoryModel::item_array_t * items;
gInventory.getDirectDescendentsOf(mRootFolderId, cats, items);
return (cats->size() + items->size());
}
else
{
return 0;
}
}
示例13: collectLandmarkFolders
static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats)
{
LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK);
// Add descendent folders of the "Landmarks" category.
LLInventoryModel::item_array_t items; // unused
LLIsType is_category(LLAssetType::AT_CATEGORY);
gInventory.collectDescendentsIf(
landmarks_id,
cats,
items,
LLInventoryModel::EXCLUDE_TRASH,
is_category);
// Add the "My Favorites" category.
LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
LLViewerInventoryCategory* favorites_cat = gInventory.getCategory(favorites_id);
if (!favorites_cat)
{
LL_WARNS() << "Cannot find the favorites folder" << LL_ENDL;
}
else
{
cats.push_back(favorites_cat);
}
}
示例14: climb
// static
void LLLocalInventory::climb(LLInventoryCategory* cat,
LLInventoryModel::cat_array_t& cats,
LLInventoryModel::item_array_t& items)
{
LLInventoryModel* model = &gInventory;
// Add this category
cats.push_back(LLPointer<LLViewerInventoryCategory>((LLViewerInventoryCategory*)cat));
LLInventoryModel::cat_array_t *direct_cats;
LLInventoryModel::item_array_t *direct_items;
model->getDirectDescendentsOf(cat->getUUID(), direct_cats, direct_items);
// Add items
LLInventoryModel::item_array_t::iterator item_iter = direct_items->begin();
LLInventoryModel::item_array_t::iterator item_end = direct_items->end();
for( ; item_iter != item_end; ++item_iter)
{
items.push_back(*item_iter);
}
// Do subcategories
LLInventoryModel::cat_array_t::iterator cat_iter = direct_cats->begin();
LLInventoryModel::cat_array_t::iterator cat_end = direct_cats->end();
for( ; cat_iter != cat_end; ++cat_iter)
{
climb(*cat_iter, cats, items);
}
}
示例15: done
void LLFloaterGesture::done()
{
//this method can be called twice: for GestureFolder and once after loading all sudir of GestureFolder
if (gInventory.isCategoryComplete(mGestureFolderID))
{
LL_DEBUGS("Gesture")<< "mGestureFolderID loaded" << LL_ENDL;
// we load only gesture folder without childred.
LLInventoryModel::cat_array_t* categories;
LLInventoryModel::item_array_t* items;
uuid_vec_t unloaded_folders;
LL_DEBUGS("Gesture")<< "Get subdirs of Gesture Folder...." << LL_ENDL;
gInventory.getDirectDescendentsOf(mGestureFolderID, categories, items);
if (categories->empty())
{
gInventory.removeObserver(this);
LL_INFOS("Gesture")<< "Gesture dos NOT contains sub-directories."<< LL_ENDL;
return;
}
LL_DEBUGS("Gesture")<< "There are " << categories->size() << " Folders "<< LL_ENDL;
for (LLInventoryModel::cat_array_t::iterator it = categories->begin(); it != categories->end(); it++)
{
if (!gInventory.isCategoryComplete(it->get()->getUUID()))
{
unloaded_folders.push_back(it->get()->getUUID());
LL_DEBUGS("Gesture")<< it->get()->getName()<< " Folder added to fetchlist"<< LL_ENDL;
}
}
if (!unloaded_folders.empty())
{
LL_DEBUGS("Gesture")<< "Fetching subdirectories....." << LL_ENDL;
setFetchIDs(unloaded_folders);
startFetch();
}
else
{
LL_DEBUGS("Gesture")<< "All Gesture subdirectories have been loaded."<< LL_ENDL;
gInventory.removeObserver(this);
buildGestureList();
}
}
else
{
LL_WARNS("Gesture")<< "Gesture list was NOT loaded"<< LL_ENDL;
}
}