本文整理汇总了C++中LLDynamicArray类的典型用法代码示例。如果您正苦于以下问题:C++ LLDynamicArray类的具体用法?C++ LLDynamicArray怎么用?C++ LLDynamicArray使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLDynamicArray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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());
}
}
}
示例2: dropCallingCard
BOOL LLFloaterIMPanel::dropCallingCard(LLInventoryItem* item, BOOL drop)
{
if (item && item->getCreatorUUID().notNull())
{
if (drop)
{
LLDynamicArray<LLUUID> ids;
ids.put(item->getCreatorUUID());
inviteToSession(ids);
}
return true;
}
// return false if creator uuid is null.
return false;
}
示例3: 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();
}
}
}
示例4: StopSelected
void JCFloaterAnimList::StopSelected(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_ANIMATION_UUID)->getValue().asUUID();
if( ids.find(id) == LLDynamicArray<LLUUID>::FAIL )
{
ids.put(id);
}
}
gAgent.sendAnimationRequests(ids,ANIM_REQUEST_STOP);
}
示例5: offerTeleport
// static
void LLAvatarActions::offerTeleport(const LLUUID& invitee)
{
if (invitee.isNull())
return;
//waiting until Name Cache gets updated with corresponding avatar name
std::string just_to_request_name;
if (!gCacheName->getFullName(invitee, just_to_request_name))
{
gCacheName->get(invitee, FALSE, boost::bind((void (*)(const LLUUID&)) &LLAvatarActions::offerTeleport, invitee));
return;
}
LLDynamicArray<LLUUID> ids;
ids.push_back(invitee);
offerTeleport(ids);
}
示例6: StopSelected
void LLFloaterExploreAnimations::StopSelected(void *userdata )
{
LLFloaterExploreAnimations *self = (LLFloaterExploreAnimations*)userdata;
LLDynamicArray<LLUUID> ids;
std::vector< LLScrollListItem * > items = self->getChild<LLScrollListCtrl>("anim_list")->getAllSelected();
for( std::vector< LLScrollListItem * >::iterator itr = items.begin(); itr != items.end(); itr++ )
{
LLScrollListItem *item = *itr;
const LLUUID &id = item->getValue().asUUID();
if( ids.find(id) == LLDynamicArray<LLUUID>::FAIL )
{
ids.put(id);
}
}
gAgent.sendAnimationRequests(ids,ANIM_REQUEST_STOP);
}
示例7: 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;
}
示例8: store
void LLInventoryClipboard::store(const LLDynamicArray<LLUUID>& inv_objects)
{
reset();
S32 count = inv_objects.count();
for(S32 i = 0; i < count; i++)
{
mObjects.put(inv_objects[i]);
}
}
示例9: inviteToSession
bool LLFloaterIMPanel::inviteToSession(const LLDynamicArray<LLUUID>& ids)
{
LLViewerRegion* region = gAgent.getRegion();
if (!region)
{
return FALSE;
}
S32 count = ids.count();
if( isInviteAllowed() && (count > 0) )
{
llinfos << "LLFloaterIMPanel::inviteToSession() - inviting participants" << llendl;
std::string url = region->getCapability("ChatSessionRequest");
LLSD data;
data["params"] = LLSD::emptyArray();
for (int i = 0; i < count; i++)
{
data["params"].append(ids.get(i));
}
data["method"] = "invite";
data["session-id"] = mSessionUUID;
LLHTTPClient::post(
url,
data,
new LLSessionInviteResponder(
mSessionUUID));
}
else
{
llinfos << "LLFloaterIMPanel::inviteToSession -"
<< " no need to invite agents for "
<< mDialog << llendl;
// successful add, because everyone that needed to get added
// was added.
}
return TRUE;
}
示例10: computeSessionID
// This adds a session to the talk view. The name is the local name of
// the session, dialog specifies the type of session. If the session
// exists, it is brought forward. Specifying id = NULL results in an
// im session to everyone. Returns the uuid of the session.
LLUUID LLIMMgr::addSession(
const std::string& name,
EInstantMessage dialog,
const LLUUID& other_participant_id)
{
//lggtodo
LLUUID session_id = computeSessionID(dialog, other_participant_id);
LLFloaterIMPanel* floater = findFloaterBySession(session_id);
if(!floater)
{
LLDynamicArray<LLUUID> ids;
ids.put(other_participant_id);
floater = createFloater(
session_id,
other_participant_id,
name,
ids,
dialog,
TRUE);
noteOfflineUsers(floater, ids);
LLFloaterChatterBox::showInstance(session_id);
// Only warn for regular IMs - not group IMs
if( dialog == IM_NOTHING_SPECIAL )
{
noteMutedUsers(floater, ids);
}
LLFloaterChatterBox::getInstance(LLSD())->showFloater(floater);
}
else
{
floater->open();
}
//mTabContainer->selectTabPanel(panel);
floater->setInputFocus(TRUE);
return floater->getSessionID();
}
示例11: 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();
}
}
}
示例12: 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))
{
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);
}
}
示例13: noteMutedUsers
void LLIMMgr::noteMutedUsers(LLFloaterIMPanel* floater,
const LLDynamicArray<LLUUID>& ids)
{
// Don't do this if we don't have a mute list.
LLMuteList *ml = LLMuteList::getInstance();
if( !ml )
{
return;
}
S32 count = ids.count();
if(count > 0)
{
for(S32 i = 0; i < count; ++i)
{
if( ml->isMuted(ids.get(i)) )
{
LLUIString muted = sMutedMessage;
floater->addHistoryLine(muted);
break;
}
}
}
}
示例14: addSession
// Adds a session using the given session_id. If the session already exists
// the dialog type is assumed correct. Returns the uuid of the session.
LLUUID LLIMMgr::addSession(
const std::string& name,
EInstantMessage dialog,
const LLUUID& other_participant_id,
const LLDynamicArray<LLUUID>& ids)
{
if (0 == ids.getLength())
{
return LLUUID::null;
}
LLUUID session_id = computeSessionID(
dialog,
other_participant_id);
LLFloaterIMPanel* floater = findFloaterBySession(session_id);
if(!floater)
{
// On creation, use the first element of ids as the
// "other_participant_id"
floater = createFloater(
session_id,
other_participant_id,
name,
ids,
dialog,
TRUE);
if ( !floater ) return LLUUID::null;
noteOfflineUsers(floater, ids);
LLFloaterChatterBox::showInstance(session_id);
// Only warn for regular IMs - not group IMs
if( dialog == IM_NOTHING_SPECIAL )
{
noteMutedUsers(floater, ids);
}
}
else
{
floater->open();
}
//mTabContainer->selectTabPanel(panel);
floater->setInputFocus(TRUE);
return floater->getSessionID();
}
示例15: Add
void WavefrontSaver::Add(const LLVOAvatar* av_vo) //adds attachments, too!
{
offset = -av_vo->getRenderPosition();
avatar_joint_list_t vjv = av_vo->mMeshLOD;
for (avatar_joint_list_t::const_iterator itervj = vjv.begin(); itervj != vjv.end(); ++itervj)
{
const LLViewerJoint* vj = dynamic_cast<LLViewerJoint*>(*itervj);
if (!vj || vj->mMeshParts.empty()) continue;
LLViewerJointMesh* vjm = dynamic_cast<LLViewerJointMesh*>(vj->mMeshParts[0]); //highest LOD
if (!vjm) continue;
vjm->updateJointGeometry();
LLFace* face = vjm->mFace;
if (!face) continue;
//Beware: this is a hack because LLFace has multiple LODs
//'pm' supplies the right number of vertices and triangles!
LLPolyMesh* pm = vjm->getMesh();
if (!pm) continue;
LLXform normfix;
normfix.setRotation(pm->getRotation());
//Special case for balls...I mean eyeballs!
static const std::string eyeLname = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::getInstance()->getMeshEntry(LLAvatarAppearanceDefines::MESH_ID_EYEBALL_LEFT)->mName;
static const std::string eyeRname = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::getInstance()->getMeshEntry(LLAvatarAppearanceDefines::MESH_ID_EYEBALL_RIGHT)->mName;
const std::string name = vj->getName();
if (name == eyeLname || name == eyeRname)
{
LLXform lol;
lol.setPosition(-offset);
Add(Wavefront(face, pm, &lol, &normfix));
}
else
Add(Wavefront(face, pm, NULL, &normfix));
}
for (LLVOAvatar::attachment_map_t::const_iterator iter = av_vo->mAttachmentPoints.begin(); iter != av_vo->mAttachmentPoints.end(); ++iter)
{
LLViewerJointAttachment* ja = iter->second;
if (!ja) continue;
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator itero = ja->mAttachedObjects.begin(); itero != ja->mAttachedObjects.end(); ++itero)
{
LLViewerObject* o = *itero;
if (!o) continue;
LLDynamicArray<LLViewerObject*> prims = LLDynamicArray<LLViewerObject*>();
o->addThisAndAllChildren(prims);
for (LLDynamicArray<LLViewerObject*>::iterator iterc = prims.begin(); iterc != prims.end(); ++iterc)
{
const LLViewerObject* c = *iterc;
if (!c) continue;
if (LLSelectNode* n = LLSelectMgr::getInstance()->getSelection()->findNode(const_cast<LLViewerObject*>(c)))
{
}
else continue;
const LLVolume* vol = c->getVolume();
if (!vol) continue;
LLXform v_form;
v_form.setScale(c->getScale());
v_form.setPosition(c->getRenderPosition());
v_form.setRotation(c->getRenderRotation());
LLXform normfix;
normfix.setRotation(v_form.getRotation());
if (c->isHUDAttachment())
{
v_form.addPosition(-offset);
//Normals of HUD elements are funky
//TO-DO: fix 'em!
}
Add(vol, &v_form, &normfix);
}
}
}
}