本文整理汇总了C++中LLInventoryItem::getUUID方法的典型用法代码示例。如果您正苦于以下问题:C++ LLInventoryItem::getUUID方法的具体用法?C++ LLInventoryItem::getUUID怎么用?C++ LLInventoryItem::getUUID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLInventoryItem
的用法示例。
在下文中一共展示了LLInventoryItem::getUUID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onBtnCopyToInv
// static
void LLPreview::onBtnCopyToInv(void* userdata)
{
LLPreview* self = (LLPreview*) userdata;
LLInventoryItem *item = self->mAuxItem;
if(item && item->getUUID().notNull())
{
// Copy to inventory
if (self->mNotecardInventoryID.notNull())
{
copy_inventory_from_notecard(self->mObjectID,
self->mNotecardInventoryID, item);
}
else
{
LLPointer<LLInventoryCallback> cb = NULL;
copy_inventory_item(
gAgent.getID(),
item->getPermissions().getOwner(),
item->getUUID(),
LLUUID::null,
std::string(),
cb);
}
}
self->close();
}
示例2: handleInventory
void LLFloaterCompileQueue::handleInventory(LLViewerObject *viewer_object,
InventoryObjectList* inv)
{
// find all of the lsl, leaving off duplicates. We'll remove
// all matching asset uuids on compilation success.
typedef std::multimap<LLUUID, LLPointer<LLInventoryItem> > uuid_item_map;
uuid_item_map asset_item_map;
InventoryObjectList::const_iterator it = inv->begin();
InventoryObjectList::const_iterator end = inv->end();
for ( ; it != end; ++it)
{
if((*it)->getType() == LLAssetType::AT_LSL_TEXT)
{
LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
// Check permissions before allowing the user to retrieve data.
if (item->getPermissions().allowModifyBy(gAgent.getID(), gAgent.getGroupID()) &&
item->getPermissions().allowCopyBy(gAgent.getID(), gAgent.getGroupID()) )
{
LLPointer<LLViewerInventoryItem> script = new LLViewerInventoryItem(item);
mCurrentScripts.put(script);
asset_item_map.insert(std::make_pair(item->getAssetUUID(), item));
}
}
}
if (asset_item_map.empty())
{
// There are no scripts in this object. move on.
nextObject();
}
else
{
// request all of the assets.
uuid_item_map::iterator iter;
for(iter = asset_item_map.begin(); iter != asset_item_map.end(); iter++)
{
LLInventoryItem *itemp = iter->second;
LLScriptQueueData* datap = new LLScriptQueueData(getID(),
itemp->getName(),
viewer_object->getID(),
itemp->getUUID());
//llinfos << "ITEM NAME 2: " << names.get(i) << llendl;
gAssetStorage->getInvItemAsset(viewer_object->getRegion()->getHost(),
gAgent.getID(),
gAgent.getSessionID(),
itemp->getPermissions().getOwner(),
viewer_object->getID(),
itemp->getUUID(),
itemp->getAssetUUID(),
itemp->getType(),
LLFloaterCompileQueue::scriptArrived,
(void*)datap);
}
}
}
示例3: fire
// override
void fire(const LLUUID& inv_item)
{
if(!mTextEditor)
{
// The parent text editor may have vanished by now.
// In that case just quit.
return;
}
LLInventoryItem* item = gInventory.getItem(inv_item);
if(!item)
{
LL_WARNS() << "Item add reported, but not found in inventory!: " << inv_item << LL_ENDL;
}
else
{
// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a
if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE))
{
RlvUtil::notifyBlockedViewXXX(LLAssetType::AT_NOTECARD);
return;
}
// [/RLVa:KB]
// See if we can bring an existing preview to the front
if(!LLPreview::show(item->getUUID(), true))
{
if (gSavedSettings.getBOOL("ShowNewInventory")) // Singu Note: ShowNewInventory is true, not false, when they want a preview
{
// There isn't one, so make a new preview
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
LLRect rect = gSavedSettings.getRect("NotecardEditorRect");
rect.translate(left - rect.mLeft, top - rect.mTop);
LLPreviewNotecard* preview;
preview = new LLPreviewNotecard("preview notecard",
rect,
std::string("Embedded Note: ") + item->getName(),
item->getUUID(),
LLUUID::null,
item->getAssetUUID(),
true,
(LLViewerInventoryItem*)item);
preview->setSourceID(LLUUID::null);
preview->setFocus(TRUE);
// Force to be entirely onscreen.
gFloaterView->adjustToFitScreen(preview, FALSE);
}
}
}
}
示例4: onCopyPasteAction
void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
{
std::string command_name = command.asString();
// since we select this comman inventory item had already arrived .
if("copy_gesture" == command_name)
{
uuid_vec_t ids;
getSelectedIds(ids);
// make sure that clopboard is empty
LLInventoryClipboard::instance().reset();
for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
LLInventoryClipboard::instance().add(item->getUUID());
}
}
}
else if ("paste" == command_name)
{
LLInventoryClipboard& clipbord = LLInventoryClipboard::instance();
LLDynamicArray<LLUUID> ids;
clipbord.retrieve(ids);
if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID))
return;
LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID);
llassert(gesture_dir);
LLPointer<GestureCopiedCallback> cb = new GestureCopiedCallback(this);
for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(gesture_dir && item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
LLStringUtil::format_map_t string_args;
string_args["[COPY_NAME]"] = item->getName();
LL_DEBUGS("Gesture")<< "Copying gesture " << item->getName() << " "<< item->getUUID() << " into "
<< gesture_dir->getName() << " "<< gesture_dir->getUUID() << LL_ENDL;
copy_inventory_item(gAgent.getID(), item->getPermissions().getOwner(), item->getUUID(),
gesture_dir->getUUID(), getString("copy_name", string_args), cb);
}
}
clipbord.reset();
}
else if ("copy_uuid" == command_name)
{
gClipboard.copyFromString(utf8str_to_wstring(mGestureList->getCurrentID().asString()), mGestureList->getCurrentID());
}
}
示例5: onCopyPasteAction
void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
{
std::string command_name = command.asString();
// Since we select this command, the inventory items must have already arrived
if("copy_gesture" == command_name)
{
uuid_vec_t ids;
getSelectedIds(ids);
// Make sure the clipboard is empty
LLClipboard::instance().reset();
for(uuid_vec_t::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
LLClipboard::instance().addToClipboard(item->getUUID(),LLAssetType::AT_GESTURE);
}
}
}
else if ("paste" == command_name)
{
LLDynamicArray<LLUUID> ids;
LLClipboard::instance().pasteFromClipboard(ids);
if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID))
return;
LLInventoryCategory* gesture_dir = gInventory.getCategory(mGestureFolderID);
llassert(gesture_dir);
LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(gesture_copied_cb, _1, this));
for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(gesture_dir && item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
LLStringUtil::format_map_t string_args;
string_args["[COPY_NAME]"] = item->getName();
LL_DEBUGS("Gesture")<< "Copying gesture " << item->getName() << " "<< item->getUUID() << " into "
<< gesture_dir->getName() << " "<< gesture_dir->getUUID() << LL_ENDL;
copy_inventory_item(gAgent.getID(), item->getPermissions().getOwner(), item->getUUID(),
gesture_dir->getUUID(), getString("copy_name", string_args), cb);
}
}
LLClipboard::instance().reset();
}
else if ("copy_uuid" == command_name)
{
LLClipboard::instance().copyToClipboard(mGestureList->getCurrentID(),LLAssetType::AT_GESTURE);
}
}
示例6: handleCopyProtectedItem
// static
bool LLGiveInventory::handleCopyProtectedItem(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
LLSD itmes = notification["payload"]["items"];
LLInventoryItem* item = NULL;
switch(option)
{
case 0: // "Yes"
for (LLSD::array_iterator it = itmes.beginArray(); it != itmes.endArray(); it++)
{
item = gInventory.getItem((*it).asUUID());
if (item)
{
LLGiveInventory::commitGiveInventoryItem(notification["payload"]["agent_id"].asUUID(),
item);
// delete it for now - it will be deleted on the server
// quickly enough.
gInventory.deleteObject(item->getUUID());
gInventory.notifyObservers();
}
else
{
LLNotificationsUtil::add("CannotGiveItem");
}
}
break;
default: // no, cancel, whatever, who cares, not yes.
LLNotificationsUtil::add("TransactionCancelled");
break;
}
return false;
}
示例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: onBtnCopyToInv
// static
void LLPreview::onBtnCopyToInv(void* userdata)
{
LLPreview* self = (LLPreview*) userdata;
LLInventoryItem *item = self->mAuxItem;
if(item && item->getUUID().notNull())
{
// Copy to inventory
if (self->mNotecardInventoryID.notNull())
{
copy_inventory_from_notecard(LLUUID::null,
self->mNotecardObjectID,
self->mNotecardInventoryID,
item);
}
else if (self->mObjectUUID.notNull())
{
// item is in in-world inventory
LLViewerObject* object = gObjectList.findObject(self->mObjectUUID);
LLPermissions perm(item->getPermissions());
if(object
&&(perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID())
&& perm.allowTransferTo(gAgent.getID())))
{
// copy to default folder
set_dad_inventory_item(item, LLUUID::null);
object->moveInventory(LLUUID::null, item->getUUID());
}
}
else
{
LLPointer<LLInventoryCallback> cb = NULL;
copy_inventory_item(
gAgent.getID(),
item->getPermissions().getOwner(),
item->getUUID(),
LLUUID::null,
std::string(),
cb);
}
}
self->closeFloater();
}
示例9: savePresetToNotecard
bool LLWLParamManager::savePresetToNotecard(const std::string & name)
{
// make an empty llsd
LLSD paramsData(LLSD::emptyMap());
LLWLParamKey key(name, LLEnvKey::SCOPE_LOCAL);
if(!hasParamSet(key)) return false;
// fill it with LLSD windlight params
paramsData = mParamList[key].getAll();
// get some XML
std::ostringstream presetsXML;
LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter();
formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY);
// Write it to a notecard
LLNotecard notecard;
notecard.setText(presetsXML.str());
LLInventoryItem *item = gInventory.getItem(mParamList[key].mInventoryID);
if(!item)
{
mParamList[key].mInventoryID = LLUUID::null;
return false;
}
std::string agent_url = gAgent.getRegion()->getCapability("UpdateNotecardAgentInventory");
if(!agent_url.empty())
{
LLTransactionID tid;
LLAssetID asset_id;
tid.generate();
asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
LLVFile file(gVFS, asset_id, LLAssetType::AT_NOTECARD, LLVFile::APPEND);
std::ostringstream stream;
notecard.exportStream(stream);
std::string buffer = stream.str();
S32 size = buffer.length() + 1;
file.setMaxSize(size);
file.write((U8*)buffer.c_str(), size);
LLSD body;
body["item_id"] = item->getUUID();
LLHTTPClient::post(agent_url, body, new LLUpdateAgentInventoryResponder(body, asset_id, LLAssetType::AT_NOTECARD));
}
else
{
LL_WARNS("WindLight") << "Failed to save notecard." << LL_ENDL;
return false;
}
return true;
}
示例10: onSelectionChange
void LLFloaterLandmark::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action)
{
if (items.size())
{
LLFolderViewItem* first_item = items.front();
LLInventoryItem* itemp = gInventory.getItem(first_item->getListener()->getUUID());
mNoCopyLandmarkSelected = FALSE;
if (itemp)
{
if (!itemp->getPermissions().allowCopyBy(gAgent.getID()))
{
mNoCopyLandmarkSelected = TRUE;
}
mImageAssetID = itemp->getUUID();
mIsDirty = TRUE;
}
}
}
示例11: copy_inventory_category
void copy_inventory_category(LLInventoryModel* model,
LLViewerInventoryCategory* cat,
const LLUUID& parent_id,
const LLUUID& root_copy_id)
{
// Create the initial folder
LLUUID new_cat_uuid = gInventory.createNewCategory(parent_id, LLFolderType::FT_NONE, cat->getName());
model->notifyObservers();
// We need to exclude the initial root of the copy to avoid recursively copying the copy, etc...
LLUUID root_id = (root_copy_id.isNull() ? new_cat_uuid : root_copy_id);
// Get the content of the folder
LLInventoryModel::cat_array_t* cat_array;
LLInventoryModel::item_array_t* item_array;
gInventory.getDirectDescendentsOf(cat->getUUID(),cat_array,item_array);
// Copy all the items
LLInventoryModel::item_array_t item_array_copy = *item_array;
for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++)
{
LLInventoryItem* item = *iter;
copy_inventory_item(
gAgent.getID(),
item->getPermissions().getOwner(),
item->getUUID(),
new_cat_uuid,
std::string(),
LLPointer<LLInventoryCallback>(NULL));
}
// Copy all the folders
LLInventoryModel::cat_array_t cat_array_copy = *cat_array;
for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++)
{
LLViewerInventoryCategory* category = *iter;
if (category->getUUID() != root_id)
{
copy_inventory_category(model, category, new_cat_uuid, root_id);
}
}
}
示例12: handleDragAndDropToTrash
bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data , EAcceptance* accept)
{
*accept = ACCEPT_NO;
switch (cargo_type)
{
case DAD_LANDMARK:
case DAD_CATEGORY:
{
bool is_enabled = isActionEnabled("delete");
if (is_enabled) *accept = ACCEPT_YES_MULTI;
if (is_enabled && drop)
{
// don't call onClipboardAction("delete")
// this lead to removing (N * 2 - 1) items if drag N>1 items into trash. EXT-6757
// So, let remove items one by one.
LLInventoryItem* item = static_cast<LLInventoryItem*>(cargo_data);
if (item)
{
LLFolderViewItem* fv_item = mCurrentSelectedList
? mCurrentSelectedList->getItemByID(item->getUUID())
: NULL;
if (fv_item)
{
// is Item Removable checked inside of remove()
fv_item->remove();
}
}
}
}
break;
default:
break;
}
updateVerbs();
return true;
}
示例13: fire
// override
void fire(const LLUUID& inv_item)
{
if(!mTextEditor)
{
// The parent text editor may have vanished by now.
// In that case just quit.
return;
}
LLInventoryItem* item = gInventory.getItem(inv_item);
if(!item)
{
LL_WARNS() << "Item add reported, but not found in inventory!: " << inv_item << LL_ENDL;
}
else
{
if(!gSavedSettings.getBOOL("ShowNewInventory"))
{
LLFloaterReg::showInstance("preview_notecard", LLSD(item->getUUID()), TAKE_FOCUS_YES);
}
}
}
示例14: handleDragAndDrop
BOOL LLFloaterAO::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg)
{
BOOL handled = TRUE;
switch(cargo_type)
{
case DAD_NOTECARD:
{
// Pop off to Lua
LLInventoryItem* item = (LLInventoryItem*)cargo_data;
if (item && gInventory.getItem(item->getAssetUUID()))
{
// @hook OnAONotecard(asset_id)
LUA_CALL("OnAONotecard") << item->getAssetUUID() << LUA_END;
}
*accept = ACCEPT_YES_COPY_MULTI;
break;
}
case DAD_ANIMATION:
{
LLInventoryItem* item = (LLInventoryItem*)cargo_data;
if (item
&& gInventory.getItem(item->getUUID()))
{
if (drop)
{
if (cargo_type == DAD_ANIMATION)
{
std::string anim_name = item->getName();
if (anim_name == "")
return true;
LLUUID id(LLAO::getAssetIDByName(anim_name));
#ifdef AO_DEBUG
llinfos << "Actually adding animation, this should be refreshed. Count:" << LLAO::mAnimationOverrides[mCurrentAnimType].size() << llendl;
#endif
LLAO::mAnimationOverrides[mCurrentAnimType].append(anim_name);
#ifdef AO_DEBUG
llinfos << "Added animation. Count:" << LLAO::mAnimationOverrides[mCurrentAnimType].size() << llendl;
#endif
//LLAO::mTimer->reset();
onCommitAnim(NULL,this);
}
refresh();
}
*accept = ACCEPT_YES_COPY_MULTI;
}
else
{
// Not in user's inventory means it was in object inventory
*accept = ACCEPT_NO;
}
break;
}
default:
*accept = ACCEPT_NO;
if (tooltip_msg.empty())
{
tooltip_msg.assign("Only animations can be added to the AO.");
}
break;
}
return handled;
}
示例15: buildNewViews
LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id)
{
LLInventoryObject const* objectp = gInventory.getObject(id);
LLUUID root_id = mFolderRoot.get()->getListener()->getUUID();
LLFolderViewFolder* parent_folder = NULL;
LLFolderViewItem* itemp = NULL;
if (id == root_id)
{
parent_folder = mFolderRoot.get();
}
else if (objectp)
{
const LLUUID &parent_id = objectp->getParentUUID();
parent_folder = (LLFolderViewFolder*)mFolderRoot.get()->getItemByID(parent_id);
if (parent_folder)
{
if (objectp->getType() <= LLAssetType::AT_NONE ||
objectp->getType() >= LLAssetType::AT_COUNT)
{
llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : "
<< ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID()
<< llendl;
return NULL;
}
if ((objectp->getType() == LLAssetType::AT_CATEGORY) &&
(objectp->getActualType() != LLAssetType::AT_LINK_FOLDER))
{
LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(),
objectp->getType(),
LLInventoryType::IT_CATEGORY,
this,
mFolderRoot.get(),
objectp->getUUID());
if (new_listener)
{
LLFolderViewFolder* folderp = createFolderViewFolder(new_listener);
if (folderp)
{
folderp->setItemSortOrder(mFolderRoot.get()->getSortOrder());
}
itemp = folderp;
}
}
else
{
// Build new view for item.
LLInventoryItem* item = (LLInventoryItem*)objectp;
LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(),
item->getActualType(),
item->getInventoryType(),
this,
mFolderRoot.get(),
item->getUUID(),
item->getFlags());
if (new_listener)
{
itemp = createFolderViewItem(new_listener);
}
}
if (itemp)
{
itemp->addToFolder(parent_folder, mFolderRoot.get());
}
}
}
// If this is a folder, add the children of the folder and recursively add any
// child folders.
if (id.isNull()
|| (objectp
&& objectp->getType() == LLAssetType::AT_CATEGORY))
{
LLViewerInventoryCategory::cat_array_t* categories;
LLViewerInventoryItem::item_array_t* items;
mInventory->lockDirectDescendentArrays(id, categories, items);
if(categories)
{
for (LLViewerInventoryCategory::cat_array_t::const_iterator cat_iter = categories->begin();
cat_iter != categories->end();
++cat_iter)
{
const LLViewerInventoryCategory* cat = (*cat_iter);
buildNewViews(cat->getUUID());
}
}
if(items && parent_folder)
{
for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items->begin();
item_iter != items->end();
++item_iter)
{
const LLViewerInventoryItem* item = (*item_iter);
buildNewViews(item->getUUID());
//.........这里部分代码省略.........