本文整理汇总了C++中llinventorymodel::item_array_t::end方法的典型用法代码示例。如果您正苦于以下问题:C++ item_array_t::end方法的具体用法?C++ item_array_t::end怎么用?C++ item_array_t::end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类llinventorymodel::item_array_t
的用法示例。
在下文中一共展示了item_array_t::end方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
}
}
示例2: 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);
}
}
示例3: 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;
}
示例4: 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);
}
示例5: 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());
}
}
示例6: 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;
}
示例7: 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);
}
示例8: get_is_parent_to_worn_item
BOOL get_is_parent_to_worn_item(const LLUUID& id)
{
const LLViewerInventoryCategory* cat = gInventory.getCategory(id);
if (!cat)
{
return FALSE;
}
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
LLInventoryCollectAllItems collect_all;
gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), cats, items, LLInventoryModel::EXCLUDE_TRASH, collect_all);
for (LLInventoryModel::item_array_t::const_iterator it = items.begin(); it != items.end(); ++it)
{
const LLViewerInventoryItem * const item = *it;
llassert(item->getIsLinkType());
LLUUID linked_id = item->getLinkedUUID();
const LLViewerInventoryItem * const linked_item = gInventory.getItem(linked_id);
if (linked_item)
{
LLUUID parent_id = linked_item->getParentUUID();
while (!parent_id.isNull())
{
LLInventoryCategory * parent_cat = gInventory.getCategory(parent_id);
if (cat == parent_cat)
{
return TRUE;
}
parent_id = parent_cat->getParentUUID();
}
}
}
return FALSE;
}
示例9: collectFriendsLists
void LLFriendCardsManager::collectFriendsLists(folderid_buddies_map_t& folderBuddiesMap) const
{
folderBuddiesMap.clear();
LLInventoryModel::cat_array_t* listFolders;
LLInventoryModel::item_array_t* items;
// get folders in the Friend folder. Items should be NULL due to Cards should be in lists.
gInventory.getDirectDescendentsOf(findFriendFolderUUIDImpl(), listFolders, items);
if (NULL == listFolders)
return;
LLInventoryModel::cat_array_t::const_iterator itCats; // to iterate Friend Lists (categories)
LLInventoryModel::item_array_t::const_iterator itBuddy; // to iterate Buddies in each List
LLInventoryModel::cat_array_t* fakeCatsArg;
for (itCats = listFolders->begin(); itCats != listFolders->end(); ++itCats)
{
if (items)
items->clear();
// *HACK: Only Friends/All content will be shown for now
// *TODO: Remove this hack, implement sorting if it will be needded by spec.
if ((*itCats)->getUUID() != findFriendAllSubfolderUUIDImpl())
continue;
gInventory.getDirectDescendentsOf((*itCats)->getUUID(), fakeCatsArg, items);
if (NULL == items)
continue;
uuid_vec_t buddyUUIDs;
for (itBuddy = items->begin(); itBuddy != items->end(); ++itBuddy)
{
buddyUUIDs.push_back((*itBuddy)->getCreatorUUID());
}
folderBuddiesMap.insert(make_pair((*itCats)->getUUID(), buddyUUIDs));
}
}
示例10: loadInvCache
//static
void LLLocalInventory::loadInvCache(std::string filename)
{
std::string extension = gDirUtilp->getExtension(filename);
std::string inv_filename = filename;
if(extension == "gz")
{
LLUUID random;
random.generate();
inv_filename = filename.substr(0, filename.length() - 3) + "." + random.asString();
if(!gunzip_file(filename, inv_filename))
{
// failure... message?
return;
}
}
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
bool is_cache_obsolete = false;
if(LLInventoryModel::loadFromFile(inv_filename, cats, items, is_cache_obsolete))
{
// create a container category for everything
LLViewerInventoryCategory* container = new LLViewerInventoryCategory(gAgent.getID());
container->rename(gDirUtilp->getBaseFileName(filename, false));
LLUUID container_id;
container_id.generate();
container->setUUID(container_id);
container->setParent(gSystemFolderRoot);
container->setPreferredType(LLFolderType::FT_NONE);
LLInventoryModel::update_map_t container_update;
++container_update[container->getParentUUID()];
gInventory.accountForUpdate(container_update);
gInventory.updateCategory(container);
gInventory.notifyObservers();
LLViewerInventoryCategory* orphaned_items = new LLViewerInventoryCategory(gAgent.getID());
orphaned_items->rename("Orphaned Items");
LLUUID orphaned_items_id;
orphaned_items_id.generate();
orphaned_items->setUUID(orphaned_items_id);
orphaned_items->setParent(container_id);
orphaned_items->setPreferredType(LLFolderType::FT_NONE);
LLInventoryModel::update_map_t orphaned_items_update;
++orphaned_items_update[orphaned_items->getParentUUID()];
gInventory.accountForUpdate(orphaned_items_update);
gInventory.updateCategory(orphaned_items);
gInventory.notifyObservers();
//conflict handling
std::map<LLUUID,LLUUID> conflicting_cats;
int dropped_cats = 0;
int dropped_items = 0;
// Add all categories
LLInventoryModel::cat_array_t::iterator cat_iter = cats.begin();
LLInventoryModel::cat_array_t::iterator cat_end = cats.end();
for(; cat_iter != cat_end; ++cat_iter)
{
// Conditionally change its parent
// Note: Should I search for missing parent id's?
//if the parent is null, it goes in the very root of the tree!
if((*cat_iter)->getParentUUID().isNull())
{
(*cat_iter)->setParent(container_id);
}
// If the parent exists and outside of pretend inventory, generate a new uuid
else if(gInventory.getCategory((*cat_iter)->getParentUUID()))
{
if(!gInventory.isObjectDescendentOf((*cat_iter)->getParentUUID(), gSystemFolderRoot, TRUE))
{
std::map<LLUUID,LLUUID>::iterator itr = conflicting_cats.find((*cat_iter)->getParentUUID());
if(itr == conflicting_cats.end())
{
dropped_cats++;
continue;
}
(*cat_iter)->setParent(itr->second);
}
} else {
//well balls, this is orphaned.
(*cat_iter)->setParent(orphaned_items_id);
}
// If this category already exists, generate a new uuid
if(gInventory.getCategory((*cat_iter)->getUUID()))
{
LLUUID cat_random;
cat_random.generate();
conflicting_cats[(*cat_iter)->getUUID()] = cat_random;
(*cat_iter)->setUUID(cat_random);
}
LLInventoryModel::update_map_t update;
++update[(*cat_iter)->getParentUUID()];
gInventory.accountForUpdate(update);
gInventory.updateCategory(*cat_iter);
//.........这里部分代码省略.........
示例11: 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());
}
示例12: refreshAll
// Checked: 2010-03-18 (RLVa-1.2.0)
void RlvFloaterLocks::refreshAll() const
{
LLScrollListCtrl* pLockList = getChild<LLScrollListCtrl>("lock_list");
pLockList->operateOnAll(LLCtrlListInterface::OP_DELETE);
if (!isAgentAvatarValid())
return;
//
// Set-up a row we can just reuse
//
LLSD sdRow;
LLSD& sdColumns = sdRow["columns"];
sdColumns[0]["column"] = "lock_type"; sdColumns[0]["type"] = "text";
sdColumns[1]["column"] = "lock_addrem"; sdColumns[1]["type"] = "text";
sdColumns[2]["column"] = "lock_target"; sdColumns[2]["type"] = "text";
sdColumns[3]["column"] = "lock_origin"; sdColumns[3]["type"] = "text";
//
// List attachment locks
//
sdColumns[0]["value"] = "Attachment";
sdColumns[1]["value"] = "rem";
const RlvAttachmentLocks::rlv_attachobjlock_map_t& attachObjRem = gRlvAttachmentLocks.getAttachObjLocks();
for (RlvAttachmentLocks::rlv_attachobjlock_map_t::const_iterator itAttachObj = attachObjRem.begin();
itAttachObj != attachObjRem.end(); ++itAttachObj)
{
sdColumns[2]["value"] = rlvGetItemNameFromObjID(itAttachObj->first);
sdColumns[3]["value"] = rlvGetItemNameFromObjID(itAttachObj->second);
pLockList->addElement(sdRow, ADD_BOTTOM);
}
//
// List attachment point locks
//
sdColumns[0]["value"] = "Attachment Point";
sdColumns[1]["value"] = "add";
const RlvAttachmentLocks::rlv_attachptlock_map_t& attachPtAdd = gRlvAttachmentLocks.getAttachPtLocks(RLV_LOCK_ADD);
for (RlvAttachmentLocks::rlv_attachptlock_map_t::const_iterator itAttachPt = attachPtAdd.begin();
itAttachPt != attachPtAdd.end(); ++itAttachPt)
{
const LLViewerJointAttachment* pAttachPt =
get_if_there(gAgentAvatarp->mAttachmentPoints, itAttachPt->first, static_cast<LLViewerJointAttachment*>(NULL));
sdColumns[2]["value"] = pAttachPt->getName();
sdColumns[3]["value"] = rlvGetItemNameFromObjID(itAttachPt->second);
pLockList->addElement(sdRow, ADD_BOTTOM);
}
sdColumns[1]["value"] = "rem";
const RlvAttachmentLocks::rlv_attachptlock_map_t& attachPtRem = gRlvAttachmentLocks.getAttachPtLocks(RLV_LOCK_REMOVE);
for (RlvAttachmentLocks::rlv_attachptlock_map_t::const_iterator itAttachPt = attachPtRem.begin();
itAttachPt != attachPtRem.end(); ++itAttachPt)
{
const LLViewerJointAttachment* pAttachPt =
get_if_there(gAgentAvatarp->mAttachmentPoints, itAttachPt->first, static_cast<LLViewerJointAttachment*>(NULL));
sdColumns[2]["value"] = pAttachPt->getName();
sdColumns[3]["value"] = rlvGetItemNameFromObjID(itAttachPt->second);
pLockList->addElement(sdRow, ADD_BOTTOM);
}
//
// List wearable type locks
//
sdColumns[0]["value"] = "Wearable Type";
sdColumns[1]["value"] = "add";
const RlvWearableLocks::rlv_wearabletypelock_map_t& wearableTypeAdd = gRlvWearableLocks.getWearableTypeLocks(RLV_LOCK_ADD);
for (RlvWearableLocks::rlv_wearabletypelock_map_t::const_iterator itWearableType = wearableTypeAdd.begin();
itWearableType != wearableTypeAdd.end(); ++itWearableType)
{
sdColumns[2]["value"] = LLWearableType::getTypeLabel(itWearableType->first);
sdColumns[3]["value"] = rlvGetItemNameFromObjID(itWearableType->second);
pLockList->addElement(sdRow, ADD_BOTTOM);
}
sdColumns[1]["value"] = "rem";
const RlvWearableLocks::rlv_wearabletypelock_map_t& wearableTypeRem = gRlvWearableLocks.getWearableTypeLocks(RLV_LOCK_REMOVE);
for (RlvWearableLocks::rlv_wearabletypelock_map_t::const_iterator itWearableType = wearableTypeRem.begin();
itWearableType != wearableTypeRem.end(); ++itWearableType)
{
sdColumns[2]["value"] = LLWearableType::getTypeName(itWearableType->first);
sdColumns[3]["value"] = rlvGetItemNameFromObjID(itWearableType->second);
pLockList->addElement(sdRow, ADD_BOTTOM);
}
//
// List "nostrip" (soft) locks
//
sdColumns[1]["value"] = "nostrip";
sdColumns[3]["value"] = "(Agent)";
LLInventoryModel::cat_array_t folders; LLInventoryModel::item_array_t items;
//.........这里部分代码省略.........
示例13: buildLandmarkIDLists
void LLFloaterWorldMap::buildLandmarkIDLists()
{
LLCtrlListInterface *list = mListLandmarkCombo;
if (!list) return;
// Delete all but the "None" entry
S32 list_size = list->getItemCount();
if (list_size > 1)
{
list->selectItemRange(1, -1);
list->operateOnSelection(LLCtrlListInterface::OP_DELETE);
}
mLandmarkItemIDList.reset();
mLandmarkAssetIDList.reset();
// Get all of the current landmarks
mLandmarkAssetIDList.put( LLUUID::null );
mLandmarkItemIDList.put( LLUUID::null );
mLandmarkAssetIDList.put( sHomeID );
mLandmarkItemIDList.put( sHomeID );
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
LLIsType is_landmark(LLAssetType::AT_LANDMARK);
gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
cats,
items,
LLInventoryModel::EXCLUDE_TRASH,
is_landmark);
std::sort(items.begin(), items.end(), LLViewerInventoryItem::comparePointers());
std::list<LLInventoryItem*> usedLMs;
BOOL filterLandmarks = gSavedSettings.getBOOL("WorldmapFilterDuplicateLandmarks");
S32 count = items.count();
for(S32 i = 0; i < count; ++i)
{
LLInventoryItem* item = items.get(i);
if (filterLandmarks)
{
bool skip = false;
for (std::list<LLInventoryItem*>::iterator it = usedLMs.begin(); it != usedLMs.end(); ++it)
{
if ((*it)->getAssetUUID() == item->getAssetUUID())
{
skip = true;
break;
}
}
if (skip) continue;
usedLMs.push_front(item);
}
list->addSimpleElement(item->getName(), ADD_BOTTOM, item->getUUID());
mLandmarkAssetIDList.put( item->getAssetUUID() );
mLandmarkItemIDList.put( item->getUUID() );
}
list->selectFirstItem();
}