本文整理汇总了C++中llinventorymodel::item_array_t类的典型用法代码示例。如果您正苦于以下问题:C++ item_array_t类的具体用法?C++ item_array_t怎么用?C++ item_array_t使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了item_array_t类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: dropCategory
BOOL LLIMFloater::dropCategory(LLInventoryCategory* category, BOOL drop)
{
BOOL rv = isInviteAllowed();
if(rv && category)
{
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
LLUniqueBuddyCollector buddies;
gInventory.collectDescendentsIf(category->getUUID(),
cats,
items,
LLInventoryModel::EXCLUDE_TRASH,
buddies);
S32 count = items.count();
if(count == 0)
{
rv = FALSE;
}
else if(drop)
{
uuid_vec_t ids;
ids.reserve(count);
for(S32 i = 0; i < count; ++i)
{
ids.push_back(items.get(i)->getCreatorUUID());
}
inviteToSession(ids);
}
}
return rv;
}
开发者ID:JohnMcCaffery,项目名称:Armadillo-Phoenix,代码行数:31,代码来源:llimfloater.cpp
示例2: dropCategory
BOOL LLFloaterIMPanel::dropCategory(LLInventoryCategory* category, BOOL drop)
{
if (category)
{
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
LLUniqueBuddyCollector buddies;
gInventory.collectDescendentsIf(category->getUUID(),
cats,
items,
LLInventoryModel::EXCLUDE_TRASH,
buddies);
S32 count = items.count();
if(count == 0)
{
return false;
}
else if(drop)
{
LLDynamicArray<LLUUID> ids;
for(S32 i = 0; i < count; ++i)
{
ids.put(items.get(i)->getCreatorUUID());
}
inviteToSession(ids);
}
}
return true;
}
开发者ID:mightymarc,项目名称:SWAMPWATER,代码行数:29,代码来源:llimpanel.cpp
示例3: syncFriendsFolder
void LLFriendCardsManager::syncFriendsFolder()
{
LLAvatarTracker::buddy_map_t all_buddies;
LLAvatarTracker::instance().copyBuddyList(all_buddies);
// 1. Remove Friend Cards for non-friends
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
gInventory.collectDescendents(findFriendAllSubfolderUUIDImpl(), cats, items, LLInventoryModel::EXCLUDE_TRASH);
LLInventoryModel::item_array_t::const_iterator it;
for (it = items.begin(); it != items.end(); ++it)
{
lldebugs << "Check if buddy is in list: " << (*it)->getName() << " " << (*it)->getCreatorUUID() << llendl;
if (NULL == get_ptr_in_map(all_buddies, (*it)->getCreatorUUID()))
{
lldebugs << "NONEXISTS, so remove it" << llendl;
removeFriendCardFromInventory((*it)->getCreatorUUID());
}
}
// 2. Add missing Friend Cards for friends
LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin();
llinfos << "try to build friends, count: " << all_buddies.size() << llendl;
for(; buddy_it != all_buddies.end(); ++buddy_it)
{
const LLUUID& buddy_id = (*buddy_it).first;
addFriendCardToInventory(buddy_id);
}
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:31,代码来源:llfriendcard.cpp
示例4: getIncludedItems
void LLMakeOutfitDialog::getIncludedItems(LLInventoryModel::item_array_t& item_list)
{
LLInventoryModel::cat_array_t *cats;
LLInventoryModel::item_array_t *items;
gInventory.getDirectDescendentsOf(LLAppearanceMgr::instance().getCOF(), cats, items);
for (LLInventoryModel::item_array_t::const_iterator iter = items->begin(); iter != items->end(); ++iter)
{
LLViewerInventoryItem* item = (*iter);
if (!item)
continue;
if (item->isWearableType())
{
LLWearableType::EType type = item->getWearableType();
if (type < LLWearableType::WT_COUNT && childGetValue(mCheckBoxList[type].first).asBoolean())
{
item_list.push_back(item);
}
}
else
{
LLViewerJointAttachment* attachment = gAgentAvatarp->getWornAttachmentPoint(item->getLinkedUUID());
if (attachment && childGetValue(std::string("checkbox_")+attachment->getName()).asBoolean())
{
item_list.push_back(item);
}
}
}
}
开发者ID:aragornarda,项目名称:SingularityViewer,代码行数:28,代码来源:llmakeoutfitdialog.cpp
示例5: updateAttachments
void LLCOFMgr::updateAttachments()
{
/*const*/ LLVOAvatar* pAvatar = gAgentAvatarp;
if (!pAvatar)
return;
const LLUUID idCOF = getCOF();
// Grab all attachment links currently in COF
LLInventoryModel::item_array_t items;
getDescendentsOfAssetType(idCOF, items, LLAssetType::AT_OBJECT, true);
// Include attachments which should be in COF but don't have their link created yet
uuid_vec_t::iterator itPendingAttachLink = m_PendingAttachLinks.begin();
while (itPendingAttachLink != m_PendingAttachLinks.end())
{
const LLUUID& idItem = *itPendingAttachLink;
if ( (!pAvatar->isWearingAttachment(idItem)) || (isLinkInCOF(idItem)) )
{
itPendingAttachLink = m_PendingAttachLinks.erase(itPendingAttachLink);
continue;
}
LLViewerInventoryItem* pItem = gInventory.getItem(idItem);
if (pItem)
items.push_back(pItem);
++itPendingAttachLink;
}
// Don't remove attachments until avatar is fully loaded (should reduce random attaching/detaching/reattaching at log-on)
LLAgentWearables::userUpdateAttachments(items, !pAvatar->isFullyLoaded());
}
开发者ID:jakit,项目名称:PartyHatViewer,代码行数:33,代码来源:cofmgr.cpp
示例6: 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();
}
}
开发者ID:hades187,项目名称:singu,代码行数:28,代码来源:llfloateroutbox.cpp
示例7: isLinkInCOF
bool LLCOFMgr::isLinkInCOF(const LLUUID& idItem)
{
LLInventoryModel::cat_array_t folders;
LLInventoryModel::item_array_t items;
LLLinkedItemIDMatches f(gInventory.getLinkedItemID(idItem));
gInventory.collectDescendentsIf(getCOF(), folders, items, LLInventoryModel::EXCLUDE_TRASH, f);
return (!items.empty());
}
开发者ID:jakit,项目名称:PartyHatViewer,代码行数:8,代码来源:cofmgr.cpp
示例8: isItemInAnyFriendsList
bool LLFriendCardsManager::isItemInAnyFriendsList(const LLViewerInventoryItem* item)
{
if (item->getType() != LLAssetType::AT_CALLINGCARD)
return false;
LLInventoryModel::item_array_t items;
findMatchedFriendCards(item->getCreatorUUID(), items);
return items.count() > 0;
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:10,代码来源:llfriendcard.cpp
示例9: refreshList
void LLInventoryItemsList::refreshList(const LLInventoryModel::item_array_t item_array)
{
getIDs().clear();
LLInventoryModel::item_array_t::const_iterator it = item_array.begin();
for( ; item_array.end() != it; ++it)
{
getIDs().push_back((*it)->getUUID());
}
mNeedsRefresh = true;
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:10,代码来源:llinventoryitemslist.cpp
示例10: removeFriendCardFromInventory
void LLFriendCardsManager::removeFriendCardFromInventory(const LLUUID& avatarID)
{
LLInventoryModel::item_array_t items;
findMatchedFriendCards(avatarID, items);
LLInventoryModel::item_array_t::const_iterator it;
for (it = items.begin(); it != items.end(); ++ it)
{
gInventory.removeItem((*it)->getUUID());
}
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:11,代码来源:llfriendcard.cpp
示例11: saveCurrentWearables
void LLFloaterCustomize::saveCurrentWearables()
{
LLWearableType::EType cur = getCurrentWearableType();
for(U32 i = 0;i < gAgentWearables.getWearableCount(cur);++i)
{
LLViewerWearable* wearable = gAgentWearables.getViewerWearable(cur,i);
if(wearable && wearable->isDirty())
{
/*
===============================================================================================
Copy-pasted some code from LLPanelEditWearable::saveChanges instead of just calling saveChanges, as
we only have one 'active' panel per wearable type, not per layer. The panels just update when
layer of focus is changed. Easier just to do it right here manually.
===============================================================================================
*/
// Find an existing link to this wearable's inventory item, if any, and its description field.
if(gAgentAvatarp->isUsingServerBakes())
{
LLInventoryItem *link_item = NULL;
std::string description;
LLInventoryModel::item_array_t links =
LLAppearanceMgr::instance().findCOFItemLinks(wearable->getItemID());
if (links.size()>0)
{
link_item = links.get(0).get();
if (link_item && link_item->getIsLinkType())
{
description = link_item->getActualDescription();
}
}
// Make another copy of this link, with the same
// description. This is needed to bump the COF
// version so texture baking service knows appearance has changed.
if (link_item)
{
// Create new link
link_inventory_item( gAgent.getID(),
link_item->getLinkedUUID(),
LLAppearanceMgr::instance().getCOF(),
link_item->getName(),
description,
LLAssetType::AT_LINK,
NULL);
// Remove old link
gInventory.purgeObject(link_item->getUUID());
}
}
gAgentWearables.saveWearable( cur, i );
}
}
}
开发者ID:aragornarda,项目名称:SingularityViewer,代码行数:52,代码来源:llfloatercustomize.cpp
示例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;
}
}
开发者ID:HanHeld,项目名称:SingularityViewerFeb2016,代码行数:15,代码来源:llfloatermarketplacelistings.cpp
示例13: removeCOFItemLinks
void LLCOFMgr::removeCOFItemLinks(const LLUUID& idItem)
{
gInventory.addChangedMask(LLInventoryObserver::LABEL, idItem);
LLInventoryModel::cat_array_t folders;
LLInventoryModel::item_array_t items;
gInventory.collectDescendents(getCOF(), folders, items, LLInventoryModel::EXCLUDE_TRASH);
for (S32 idxItem = 0; idxItem < items.count(); idxItem++)
{
const LLInventoryItem* pItem = items.get(idxItem).get();
if ( (pItem->getIsLinkType()) && (idItem == pItem->getLinkedUUID()) )
gInventory.purgeObject(pItem->getUUID());
}
}
开发者ID:jakit,项目名称:PartyHatViewer,代码行数:15,代码来源:cofmgr.cpp
示例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);
}
}
开发者ID:nathanmarck,项目名称:VoodooNxg,代码行数:30,代码来源:lllocalinventory.cpp
示例15: getItemIDs
// Checked: 2013-10-12 (RLVa-1.4.9)
bool RlvCommandOptionGetPath::getItemIDs(LLWearableType::EType wtType, uuid_vec_t& idItems)
{
uuid_vec_t::size_type cntItemsPrev = idItems.size();
LLInventoryModel::cat_array_t folders; LLInventoryModel::item_array_t items;
LLFindWearablesOfType f(wtType);
gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), folders, items, false, f);
for (LLInventoryModel::item_array_t::const_iterator itItem = items.begin(); itItem != items.end(); ++itItem)
{
const LLViewerInventoryItem* pItem = *itItem;
if (pItem)
idItems.push_back(pItem->getLinkedUUID());
}
return (cntItemsPrev != idItems.size());
}
开发者ID:Frans,项目名称:SingularityViewer,代码行数:17,代码来源:rlvhelper.cpp
示例16: purgeBOFLink
void LLCOFMgr::purgeBOFLink()
{
LLInventoryModel::cat_array_t* pFolders;
LLInventoryModel::item_array_t* pItems;
gInventory.getDirectDescendentsOf(getCOF(), pFolders, pItems);
for (S32 idxItem = 0, cntItem = pItems->count(); idxItem < cntItem; idxItem++)
{
const LLViewerInventoryItem* pItem = pItems->get(idxItem).get();
if ( (!pItem) || (LLAssetType::AT_LINK_FOLDER != pItem->getActualType()) )
continue;
const LLViewerInventoryCategory* pLinkFolder = pItem->getLinkedCategory();
if ( (pLinkFolder) && (LLFolderType::FT_OUTFIT == pLinkFolder->getPreferredType()) )
gInventory.purgeObject(pItem->getUUID());
}
}
开发者ID:jakit,项目名称:PartyHatViewer,代码行数:16,代码来源:cofmgr.cpp
示例17: findFriendAllSubfolderUUIDImpl
const LLUUID& LLFriendCardsManager::findFriendCardInventoryUUIDImpl(const LLUUID& avatarID)
{
LLUUID friendAllSubfolderUUID = findFriendAllSubfolderUUIDImpl();
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
LLInventoryModel::item_array_t::const_iterator it;
// it is not necessary to check friendAllSubfolderUUID against NULL. It will be processed by collectDescendents
gInventory.collectDescendents(friendAllSubfolderUUID, cats, items, LLInventoryModel::EXCLUDE_TRASH);
for (it = items.begin(); it != items.end(); ++it)
{
if ((*it)->getCreatorUUID() == avatarID)
return (*it)->getUUID();
}
return LLUUID::null;
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:17,代码来源:llfriendcard.cpp
示例18: getDirectDescendentsCount
// Checked: 2009-05-26 (RLVa-0.2.0d) | Modified: RLVa-0.2.0d
S32 RlvInventory::getDirectDescendentsCount(const LLInventoryCategory* pFolder, LLAssetType::EType filterType)
{
S32 cntType = 0;
if (pFolder)
{
LLInventoryModel::cat_array_t* pFolders; LLInventoryModel::item_array_t* pItems;
gInventory.getDirectDescendentsOf(pFolder->getUUID(), pFolders, pItems);
if (pItems)
{
for (S32 idxItem = 0, cntItem = pItems->count(); idxItem < cntItem; idxItem++)
if (pItems->get(idxItem)->getType() == filterType)
cntType++;
}
}
return cntType;
}
开发者ID:zantrua,项目名称:SingularityViewer,代码行数:18,代码来源:rlvinventory.cpp
示例19: addCategory
bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t cb)
{
S32 version = LLViewerInventoryCategory::VERSION_UNKNOWN;
S32 current_num_known_descendents = LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN;
bool can_be_added = true;
LLViewerInventoryCategory* category = gInventory.getCategory(cat_id);
// If category could not be retrieved it might mean that
// inventory is unusable at the moment so the category is
// stored with VERSION_UNKNOWN and DESCENDENT_COUNT_UNKNOWN,
// it may be updated later.
if (category)
{
// Inventory category version is used to find out if some changes
// to a category have been made.
version = category->getVersion();
LLInventoryModel::cat_array_t* cats;
LLInventoryModel::item_array_t* items;
gInventory.getDirectDescendentsOf(cat_id, cats, items);
if (!cats || !items)
{
LL_WARNS() << "Category '" << category->getName() << "' descendents corrupted, fetch failed." << LL_ENDL;
// NULL means the call failed -- cats/items map doesn't exist (note: this does NOT mean
// that the cat just doesn't have any items or subfolders).
// Unrecoverable, so just return "false" meaning that the category can't be observed.
can_be_added = false;
llassert(cats != NULL && items != NULL);
}
else
{
current_num_known_descendents = cats->size() + items->size();
}
}
if (can_be_added)
{
mCategoryMap.insert(category_map_value_t(
cat_id,LLCategoryData(cat_id, cb, version, current_num_known_descendents)));
}
return can_be_added;
}
开发者ID:gabeharms,项目名称:firestorm,代码行数:44,代码来源:llinventoryobserver.cpp
示例20: buildGestureList
void LLFloaterGesture::buildGestureList()
{
S32 scroll_pos = mGestureList->getScrollPos();
uuid_vec_t selected_items;
getSelectedIds(selected_items);
LL_DEBUGS("Gesture")<< "Rebuilding gesture list "<< LL_ENDL;
// mGestureList->deleteAllItems(); // <FS:ND/> Don't recreate the list over and over.
LLGestureMgr::item_map_t::const_iterator it;
const LLGestureMgr::item_map_t& active_gestures = LLGestureMgr::instance().getActiveGestures();
for (it = active_gestures.begin(); it != active_gestures.end(); ++it)
{
addGesture(it->first,it->second, mGestureList);
}
// <FS:PP> FIRE-5646: Option to show only active gestures
// if (gInventory.isCategoryComplete(mGestureFolderID))
if (gInventory.isCategoryComplete(mGestureFolderID) && !gSavedPerAccountSettings.getBOOL("FSShowOnlyActiveGestures"))
// </FS:PP> FIRE-5646: Option to show only active gestures
{
LLIsType is_gesture(LLAssetType::AT_GESTURE);
LLInventoryModel::cat_array_t categories;
LLInventoryModel::item_array_t items;
gInventory.collectDescendentsIf(mGestureFolderID, categories, items,
LLInventoryModel::EXCLUDE_TRASH, is_gesture);
for (LLInventoryModel::item_array_t::iterator it = items.begin(); it!= items.end(); ++it)
{
LLInventoryItem* item = it->get();
if (active_gestures.find(item->getUUID()) == active_gestures.end())
{
// if gesture wasn't loaded yet, we can display only name
addGesture(item->getUUID(), NULL, mGestureList);
}
}
}
// attempt to preserve scroll position through re-builds
// since we do re-build whenever something gets dirty
for(uuid_vec_t::iterator it = selected_items.begin(); it != selected_items.end(); it++)
{
mGestureList->selectByID(*it);
}
mGestureList->setScrollPos(scroll_pos);
}
开发者ID:JohnMcCaffery,项目名称:Armadillo-Phoenix,代码行数:44,代码来源:llfloatergesture.cpp
注:本文中的llinventorymodel::item_array_t类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论