本文整理汇总了C++中LLDynamicArray::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ LLDynamicArray::begin方法的具体用法?C++ LLDynamicArray::begin怎么用?C++ LLDynamicArray::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLDynamicArray
的用法示例。
在下文中一共展示了LLDynamicArray::begin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RevokeSelected
void JCFloaterAnimList::RevokeSelected(void *userdata )
{
JCFloaterAnimList *self = (JCFloaterAnimList*)userdata;
LLDynamicArray<LLUUID> ids;
std::vector< LLScrollListItem * > items = self->mAnimList->getAllSelected();
for( std::vector< LLScrollListItem * >::iterator itr = items.begin(); itr != items.end(); itr++ )
{
LLScrollListItem *item = *itr;
const LLUUID &id = item->getColumn(LIST_OBJECT_UUID)->getValue().asUUID();
if( ids.find(id) == LLDynamicArray<LLUUID>::FAIL )
{
ids.put(id);
}
}
if( !ids.empty() )
{
for(LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
{
LLUUID id = *itr;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RevokePermissions);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_Data);
msg->addUUIDFast(_PREHASH_ObjectID, id);
msg->addU32Fast(_PREHASH_ObjectPermissions, U32_MAX);
gAgent.sendReliableMessage();
}
}
}
示例2: isActionEnabled
bool LLFloaterGesture::isActionEnabled(const LLSD& command)
{
// paste copy_uuid edit_gesture
std::string command_name = command.asString();
if("paste" == command_name)
{
if(!LLClipboard::instance().hasContents())
return false;
LLDynamicArray<LLUUID> ids;
LLClipboard::instance().pasteFromClipboard(ids);
for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
{
return true;
}
}
return false;
}
else if("copy_uuid" == command_name || "edit_gesture" == command_name)
{
return mGestureList->getAllSelected().size() == 1;
}
return true;
}
示例3: onClickMute
//static
void LLFloaterAvatarList::onClickMute(void *userdata)
{
LLFloaterAvatarList *self = (LLFloaterAvatarList*)userdata;
LLDynamicArray<LLUUID> ids = self->mAvatarList->getSelectedIDs();
if (ids.size() > 0)
{
for (LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
{
LLUUID agent_id = *itr;
std::string agent_name;
if (gCacheName->getFullName(agent_id, agent_name))
{
if (LLMuteList::getInstance()->isMuted(agent_id))
{
LLMute mute(agent_id, agent_name, LLMute::AGENT);
LLMuteList::getInstance()->remove(mute);
}
else
{
LLMute mute(agent_id, agent_name, LLMute::AGENT);
LLMuteList::getInstance()->add(mute);
}
}
}
}
}
示例4: handleRemove
// static
void LLFloaterFriends::handleRemove(S32 option, void* user_data)
{
LLDynamicArray<LLUUID>* ids = static_cast<LLDynamicArray<LLUUID>*>(user_data);
for(LLDynamicArray<LLUUID>::iterator itr = ids->begin(); itr != ids->end(); ++itr)
{
LLUUID id = (*itr);
const LLRelationship* ip = LLAvatarTracker::instance().getBuddyInfo(id);
if(ip)
{
switch(option)
{
case 0: // YES
if( ip->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS))
{
LLAvatarTracker::instance().empower(id, FALSE);
LLAvatarTracker::instance().notifyObservers();
}
LLAvatarTracker::instance().terminateBuddy(id);
LLAvatarTracker::instance().notifyObservers();
gInventory.addChangedMask(LLInventoryObserver::LABEL | LLInventoryObserver::CALLING_CARD, LLUUID::null);
gInventory.notifyObservers();
break;
case 1: // NO
default:
llinfos << "No removal performed." << llendl;
break;
}
}
}
delete ids;
}
示例5: onClickRemove
// static
void LLPanelFriends::onClickRemove(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
//llinfos << "LLPanelFriends::onClickRemove()" << llendl;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
LLSD args;
if(ids.size() > 0)
{
std::string msgType = "RemoveFromFriends";
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
std::string first, last;
if(gCacheName->getName(agent_id, first, last))
{
if (LLAvatarNameCache::useDisplayNames() && !gSavedSettings.getBOOL("LegacyNamesForFriends"))
{
LLAvatarName avatar_name;
if (LLAvatarNameCache::get(agent_id, &avatar_name))
{
// Always show "Display Name [Legacy Name]" for security reasons
first = avatar_name.getNames();
size_t i = first.find(" ");
if (i != std::string::npos)
{
last = first.substr(i + 1);
first = first.substr(0, i);
}
else
{
last = "";
}
}
}
args["FIRST_NAME"] = first;
args["LAST_NAME"] = last;
}
}
else
{
msgType = "RemoveMultipleFromFriends";
}
LLSD payload;
for (LLDynamicArray<LLUUID>::iterator it = ids.begin();
it != ids.end();
++it)
{
payload["ids"].append(*it);
}
LLNotifications::instance().add(msgType,
args,
payload,
&handleRemove);
}
}
示例6: refreshRightsChangeList
void LLFloaterFriends::refreshRightsChangeList()
{
if (!sInstance) return;
LLDynamicArray<LLUUID> friends = getSelectedIDs();
S32 num_selected = friends.size();
bool can_offer_teleport = num_selected >= 1;
bool selected_friends_online = true;
LLTextBox* processing_label = LLUICtrlFactory::getTextBoxByName(this, "process_rights_label");
if(!mAllowRightsChange)
{
if(processing_label)
{
processing_label->setVisible(true);
// ignore selection for now
friends.clear();
num_selected = 0;
}
}
else if(processing_label)
{
processing_label->setVisible(false);
}
const LLRelationship* friend_status = NULL;
for(LLDynamicArray<LLUUID>::iterator itr = friends.begin(); itr != friends.end(); ++itr)
{
friend_status = LLAvatarTracker::instance().getBuddyInfo(*itr);
if (friend_status)
{
if(!friend_status->isOnline())
{
can_offer_teleport = false;
selected_friends_online = false;
}
}
else // missing buddy info, don't allow any operations
{
can_offer_teleport = false;
}
}
if (num_selected == 0) // nothing selected
{
childSetEnabled("im_btn", FALSE);
childSetEnabled("offer_teleport_btn", FALSE);
}
else // we have at least one friend selected...
{
// only allow IMs to groups when everyone in the group is online
// to be consistent with context menus in inventory and because otherwise
// offline friends would be silently dropped from the session
childSetEnabled("im_btn", selected_friends_online || num_selected == 1);
childSetEnabled("offer_teleport_btn", can_offer_teleport);
}
}
示例7: onClickRemove
// static
void LLPanelFriends::onClickRemove(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
//llinfos << "LLPanelFriends::onClickRemove()" << llendl;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
LLSD args;
if(ids.size() > 0)
{
std::string msgType = "RemoveFromFriends";
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
// [Ansariel: Display name support]
//std::string first, last;
//if(gCacheName->getName(agent_id, first, last))
//{
// args["FIRST_NAME"] = first;
// args["LAST_NAME"] = last;
//}
LLAvatarName avatar_name;
if (LLAvatarNameCache::get(agent_id, &avatar_name))
{
std::string fullname;
static const LLCachedControl<S32> phoenix_name_system("PhoenixNameSystem", 0);
switch (phoenix_name_system)
{
case 0 : fullname = avatar_name.getLegacyName(); break;
case 1 : fullname = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break;
case 2 : fullname = avatar_name.mDisplayName; break;
default : fullname = avatar_name.getCompleteName(); break;
}
args["NAME"] = fullname;
}
// [/Ansariel: Display name support]
}
else
{
msgType = "RemoveMultipleFromFriends";
}
LLSD payload;
for (LLDynamicArray<LLUUID>::iterator it = ids.begin();
it != ids.end();
++it)
{
payload["ids"].append(*it);
}
LLNotifications::instance().add(msgType,
args,
payload,
&handleRemove);
}
}
示例8: doCommand
void FloaterAvatarList::doCommand(avlist_command_t cmd)
{
LLDynamicArray<LLUUID> ids = sInstance->mAvatarList->getSelectedIDs();
for(LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
{
LLUUID avid = *itr;
cmd(avid);
}
}
示例9: serialize
void ScriptCounter::serialize(LLDynamicArray<LLViewerObject*> objects)
{
init();
status = COUNTING;
for(LLDynamicArray<LLViewerObject*>::iterator itr = objects.begin(); itr != objects.end(); ++itr)
{
LLViewerObject* object = *itr;
if (object)
subserialize(object);
}
if(invqueries == 0)
init();
}
示例10: getSelectedNames
std::string FloaterAvatarList::getSelectedNames(const std::string& separator)
{
std::string ret = "";
LLDynamicArray<LLUUID> ids = mAvatarList->getSelectedIDs();
for(LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
{
LLUUID avid = *itr;
if (!ret.empty()) ret += separator;
ret += keyasname(avid);
}
return ret;
}
示例11: 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());
}
}
示例12: 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);
}
}
示例13: onClickMark
//static
void LLFloaterAvatarList::onClickMark(void *userdata)
{
LLFloaterAvatarList *self = (LLFloaterAvatarList*)userdata;
LLDynamicArray<LLUUID> ids = self->mAvatarList->getSelectedIDs();
for (LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
{
LLUUID avid = *itr;
LLAvatarListEntry *entry = self->getAvatarEntry(avid);
if (entry != NULL)
{
entry->toggleMark();
}
}
}
示例14: doCommand
void LLFloaterAvatarList::doCommand(void (*func)(const LLUUID &avatar, const std::string &name))
{
LLDynamicArray<LLUUID> ids = mAvatarList->getSelectedIDs();
for (LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
{
LLUUID avid = *itr;
LLAvatarListEntry *entry = getAvatarEntry(avid);
if (entry != NULL)
{
llinfos << "Executing command on " << entry->getName() << llendl;
func(avid, entry->getName());
}
}
}
示例15: getSelectedNames
std::string LLFloaterAvatarList::getSelectedNames(const std::string& separator)
{
std::string ret = "";
LLDynamicArray<LLUUID> ids = mAvatarList->getSelectedIDs();
for (LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
{
LLUUID avid = *itr;
LLAvatarListEntry *entry = getAvatarEntry(avid);
if (entry != NULL)
{
if (!ret.empty()) ret += separator;
ret += entry->getName();
}
}
return ret;
}