本文整理汇总了C++中LLViewerObject::getID方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerObject::getID方法的具体用法?C++ LLViewerObject::getID怎么用?C++ LLViewerObject::getID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerObject
的用法示例。
在下文中一共展示了LLViewerObject::getID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: subserialize
void ScriptCounter::subserialize(LLViewerObject* linkset)
{
LLViewerObject* object = linkset;
LLDynamicArray<LLViewerObject*> count_objects;
count_objects.put(object);
LLViewerObject::child_list_t child_list = object->getChildren();
for (LLViewerObject::child_list_t::iterator i = child_list.begin(); i != child_list.end(); ++i)
{
LLViewerObject* child = *i;
if(!child->isAvatar())
count_objects.put(child);
}
S32 object_index = 0;
while ((object_index < count_objects.count()))
{
object = count_objects.get(object_index++);
LLUUID id = object->getID();
objIDS.insert(id.asString());
llinfos << "Counting scripts in prim " << object->getID().asString() << llendl;
object->registerInventoryListener(sInstance,NULL);
object->dirtyInventory();
object->requestInventory();
invqueries += 1;
}
}
示例2: stopSpin
void LLToolGrab::stopSpin()
{
mSpinGrabbing = FALSE;
LLViewerObject* objectp = mGrabPick.getObject();
if (!objectp)
{
return;
}
LLMessageSystem *msg = gMessageSystem;
switch(mMode)
{
case GRAB_ACTIVE_CENTER:
case GRAB_NONPHYSICAL:
case GRAB_LOCKED:
msg->newMessageFast(_PREHASH_ObjectSpinStop);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() );
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addUUIDFast(_PREHASH_ObjectID, objectp->getID() );
msg->sendMessage( objectp->getRegion()->getHost() );
break;
case GRAB_NOOBJECT:
case GRAB_INACTIVE:
default:
// do nothing
break;
}
}
示例3: removeFromLocalIDTable
BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object)
{
if(object.getRegion())
{
U32 local_id = object.mLocalID;
LLHost region_host = object.getRegion()->getHost();
U32 ip = region_host.getAddress();
U32 port = region_host.getPort();
U64 ipport = (((U64)ip) << 32) | (U64)port;
U32 index = sIPAndPortToIndex[ipport];
U64 indexid = (((U64)index) << 32) | (U64)local_id;
std::map<U64, LLUUID>::iterator iter = sIndexAndLocalIDToUUID.find(indexid);
if (iter == sIndexAndLocalIDToUUID.end())
{
return FALSE;
}
// Found existing entry
if (iter->second == object.getID())
{ // Full UUIDs match, so remove the entry
sIndexAndLocalIDToUUID.erase(iter);
return TRUE;
}
// UUIDs did not match - this would zap a valid entry, so don't erase it
//llinfos << "Tried to erase entry where id in table ("
// << iter->second << ") did not match object " << object.getID() << llendl;
}
return FALSE;
}
示例4: addUsers
void LLPanelGroupInvite::addUsers(std::vector<LLUUID>& agent_ids)
{
std::vector<std::string> names;
for (S32 i = 0; i < (S32)agent_ids.size(); i++)
{
LLUUID agent_id = agent_ids[i];
LLViewerObject* dest = gObjectList.findObject(agent_id);
if(dest && dest->isAvatar())
{
std::string fullname;
LLStringUtil::format_map_t args;
LLNameValue* nvfirst = dest->getNVPair("FirstName");
LLNameValue* nvlast = dest->getNVPair("LastName");
if(nvfirst && nvlast)
{
args["[FIRST]"] = nvfirst->getString();
args["[LAST]"] = nvlast->getString();
fullname = nvfirst->getString();
fullname += " ";
fullname += nvlast->getString();
}
if (!fullname.empty())
{
names.push_back(fullname);
}
else
{
llwarns << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << llendl;
names.push_back("(Unknown)");
}
}
}
mImplementation->addUsers(names, agent_ids);
}
示例5: getObjectInfo
void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)
{
// TODO --
// 1 need to send to correct simulator if object is not
// in same simulator as agent
// 2 display info in widget window that gives feedback that
// we have recorded the object info
// 3 can pick avatar ==> might want to indicate when a picked
// object is an avatar, attachment, or other category
mObjectID = object_id;
if (LLUUID::null != mObjectID)
{
// get object info for the user's benefit
LLViewerObject* objectp = NULL;
objectp = gObjectList.findObject( mObjectID );
if (objectp)
{
if ( objectp->isAttachment() )
{
objectp = (LLViewerObject*)objectp->getRoot();
mObjectID = objectp->getID();
}
// correct the region and position information
LLViewerRegion *regionp = objectp->getRegion();
if (regionp)
{
getChild<LLUICtrl>("sim_field")->setValue(regionp->getName());
LLVector3d global_pos;
global_pos.setVec(objectp->getPositionRegion());
setPosBox(global_pos);
}
if (objectp->isAvatar())
{
setFromAvatarID(mObjectID);
}
else
{
// we have to query the simulator for information
// about this object
LLMessageSystem* msg = gMessageSystem;
U32 request_flags = COMPLAINT_REPORT_REQUEST;
msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_RequestFlags, request_flags );
msg->addUUIDFast(_PREHASH_ObjectID, mObjectID);
LLViewerRegion* regionp = objectp->getRegion();
msg->sendReliable( regionp->getHost() );
}
}
}
}
示例6: addUsers
void LLPanelGroupBulk::addUsers(uuid_vec_t& agent_ids)
{
std::vector<std::string> names;
for (S32 i = 0; i < (S32)agent_ids.size(); i++)
{
std::string fullname;
LLUUID agent_id = agent_ids[i];
LLViewerObject* dest = gObjectList.findObject(agent_id);
if(dest && dest->isAvatar())
{
LLNameValue* nvfirst = dest->getNVPair("FirstName");
LLNameValue* nvlast = dest->getNVPair("LastName");
if(nvfirst && nvlast)
{
fullname = LLCacheName::buildFullName(
nvfirst->getString(), nvlast->getString());
}
if (!fullname.empty())
{
names.push_back(fullname);
}
else
{
llwarns << "llPanelGroupBulk: Selected avatar has no name: " << dest->getID() << llendl;
names.push_back("(Unknown)");
}
}
else
{
//looks like user try to invite offline friend
//for offline avatar_id gObjectList.findObject() will return null
//so we need to do this additional search in avatar tracker, see EXT-4732
//if (LLAvatarTracker::instance().isBuddy(agent_id)) // Singu Note: We may be using this from another avatar list like group profile, disregard friendship status.
{
LLAvatarName av_name;
if (!LLAvatarNameCache::get(agent_id, &av_name))
{
// actually it should happen, just in case
LLAvatarNameCache::get(LLUUID(agent_id), boost::bind(&LLPanelGroupBulk::addUserCallback, this, _1, _2));
// for this special case!
//when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence
// removed id will be added in callback
agent_ids.erase(agent_ids.begin() + i);
}
else
{
std::string name;
LLAvatarNameCache::getPNSName(av_name, name);
names.push_back(name);
}
}
}
}
mImplementation->mListFullNotificationSent = false;
mImplementation->addUsers(names, agent_ids);
}
示例7: addUsers
void LLPanelGroupInvite::addUsers(std::vector<LLUUID>& agent_ids)
{
std::vector<std::string> names;
for (S32 i = 0; i < (S32)agent_ids.size(); i++)
{
LLUUID agent_id = agent_ids[i];
LLViewerObject* dest = gObjectList.findObject(agent_id);
std::string fullname;
if(dest && dest->isAvatar())
{
LLNameValue* nvfirst = dest->getNVPair("FirstName");
LLNameValue* nvlast = dest->getNVPair("LastName");
if(nvfirst && nvlast)
{
fullname = std::string(nvfirst->getString()) + " " + std::string(nvlast->getString());
}
if (!fullname.empty())
{
names.push_back(fullname);
}
else
{
llwarns << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << llendl;
names.push_back("(Unknown)");
}
}
else
{
//looks like user try to invite offline friend
//for offline avatar_id gObjectList.findObject() will return null
//so we need to do this additional search in avatar tracker, see EXT-4732
if (LLAvatarTracker::instance().isBuddy(agent_id))
{
if (!gCacheName->getFullName(agent_id, fullname))
{
// actually it should happen, just in case
gCacheName->get(LLUUID(agent_id), false, boost::bind(
&LLPanelGroupInvite::addUserCallback, this, _1, _2,
_3));
// for this special case!
//when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence
// removed id will be added in callback
agent_ids.erase(agent_ids.begin() + i);
}
else
{
names.push_back(fullname);
}
}
}
}
mImplementation->addUsers(names, agent_ids);
}
示例8: getLinkSet
LLSD FSFloaterObjectExport::getLinkSet(LLSelectNode* node)
{
LLSD linkset;
LLViewerObject* object = node->getObject();
LLUUID object_id = object->getID();
// root prim
linkset.append(object_id);
addPrim(object, true);
// child prims
LLViewerObject::const_child_list_t& child_list = object->getChildren();
for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
iter != child_list.end(); ++iter)
{
LLViewerObject* child = *iter;
linkset.append(child->getID());
addPrim(child, false);
}
return linkset;
}
示例9: postBuild
BOOL LLFloaterAttachments::postBuild(void)
{
if(!mSelection) return TRUE;
if(mSelection->getRootObjectCount() < 1) return TRUE;
childSetCommitCallback("attachment_list", onCommitAttachmentList, this);
childSetAction("inventory_btn", onClickInventory, this);
childSetAction("textures_btn", onClickTextures, this);
childSetAction("view_children_btn", onClickViewChildren, this);
LLViewerObject* avatar = NULL;
for (LLObjectSelection::valid_root_iterator iter = mSelection->valid_root_begin();
iter != mSelection->valid_root_end(); iter++)
{
LLSelectNode* nodep = *iter;
LLViewerObject* objectp = nodep->getObject();
LLViewerObject* parentp = objectp->getSubParent();
if(parentp)
{
if(parentp->isAvatar())
{
// parent is an avatar
avatar = parentp;
break;
}
}
if(objectp->isAvatar())
{
avatar = objectp;
break;
}
}
if(avatar)
{
std::string av_name;
gCacheName->getFullName(avatar->getID(), av_name);
if(!av_name.empty())
setTitle(av_name + " HUDs");
selectAgentHudPrims(avatar);
}
return TRUE;
}
示例10: moveToInventory
void LLFloaterOpenObject::moveToInventory(bool wear)
{
if (mObjectSelection->getRootObjectCount() != 1)
{
gViewerWindow->alertXml("OnlyCopyContentsOfSingleItem");
return;
}
LLSelectNode* node = mObjectSelection->getFirstRootNode();
if (!node) return;
LLViewerObject* object = node->getObject();
if (!object) return;
LLUUID object_id = object->getID();
std::string name = node->mName;
// Either create a sub-folder of clothing, or of the root folder.
LLUUID parent_category_id;
if (wear)
{
parent_category_id = gInventory.findCategoryUUIDForType(
LLAssetType::AT_CLOTHING);
}
else
{
parent_category_id = gAgent.getInventoryRootID();
}
LLUUID category_id = gInventory.createNewCategory(parent_category_id,
LLAssetType::AT_NONE,
name);
LLCatAndWear* data = new LLCatAndWear;
data->mCatID = category_id;
data->mWear = wear;
// Copy and/or move the items into the newly created folder.
// Ignore any "you're going to break this item" messages.
BOOL success = move_inv_category_world_to_agent(object_id, category_id, TRUE,
callbackMoveInventory,
(void*)data);
if (!success)
{
delete data;
data = NULL;
gViewerWindow->alertXml("OpenObjectCannotCopy");
}
}
示例11: getPartSource
LLUUID LLVOPartGroup::getPartSource(S32 idx)
{
LLUUID ret = LLUUID::null;
if (idx < (S32) mViewerPartGroupp->mParticles.size())
{
LLViewerPart* part = mViewerPartGroupp->mParticles[idx];
if (part && part->mPartSourcep.notNull() &&
part->mPartSourcep->mSourceObjectp.notNull())
{
LLViewerObject* source = part->mPartSourcep->mSourceObjectp;
ret = source->getID();
}
}
return ret;
}
示例12: moveToInventory
void LLFloaterOpenObject::moveToInventory(bool wear)
{
if (mObjectSelection->getRootObjectCount() != 1)
{
LLNotificationsUtil::add("OnlyCopyContentsOfSingleItem");
return;
}
LLSelectNode* node = mObjectSelection->getFirstRootNode();
if (!node) return;
LLViewerObject* object = node->getObject();
if (!object) return;
LLUUID object_id = object->getID();
std::string name = node->mName;
// Either create a sub-folder of clothing, or of the root folder.
LLUUID parent_category_id;
if (wear)
{
parent_category_id = gInventory.findCategoryUUIDForType(
LLFolderType::FT_CLOTHING);
}
else
{
parent_category_id = gInventory.getRootFolderID();
}
LLCategoryCreate* cat_data = new LLCategoryCreate(object_id, wear);
LLUUID category_id = gInventory.createNewCategory(parent_category_id,
LLFolderType::FT_NONE,
name,
callbackCreateInventoryCategory,
(void*)cat_data);
//If we get a null category ID, we are using a capability in createNewCategory and we will
//handle the following in the callbackCreateInventoryCategory routine.
if ( category_id.notNull() )
{
LLSD result;
result["folder_id"] = category_id;
//Reduce redundant code by just calling the callback. Dur.
callbackCreateInventoryCategory(result,cat_data);
}
}
示例13: onClickCopyObjKey
void LLPanelPermissions::onClickCopyObjKey(void* data)
{
//NAMESHORT - Was requested on the forums, was going to integrate a textbox with the ID, but due to lack of room on the floater,
//We now have a copy button :>
//Madgeek - Hacked together method to copy more than one key, separated by comma.
std::string output;
std::string separator = gSavedSettings.getString("PhoenixCopyObjKeySeparator");
for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++)
{
LLSelectNode* selectNode = *iter;
LLViewerObject* object = selectNode->getObject();
if (object)
{
if (!output.empty()) output.append(separator);
output.append(object->getID().asString());
}
}
if (!output.empty()) gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(output));
}
示例14: gather_keys
std::string gather_keys(iterator iter, iterator end)
{
//NAMESHORT - Was requested on the forums, was going to integrate a textbox with the ID, but due to lack of room on the floater,
//We now have a copy button :>
//Madgeek - Hacked together method to copy more than one key, separated by comma.
//At some point the separator was changed to read from the xml settings - I'll probably try to make this openly changable from settings. -HgB
//Lirusaito - Tweaked to copy selected prim(s) when EditLinkedParts, main functionality moved into gather_keys
std::string output;
std::string separator = gSavedSettings.getString("AscentDataSeparator");
for (; iter != end; ++iter)
{
LLSelectNode* selectNode = *iter;
LLViewerObject* object = selectNode->getObject();
if (object)
{
if (!output.empty()) output.append(separator);
output.append(object->getID().asString());
}
}
return output;
}
示例15: payViaObject
// static
void LLFloaterPay::payViaObject(money_callback callback, LLSafeHandle<LLObjectSelection> selection)
{
// Object that lead to the selection, may be child
LLViewerObject* object = selection->getPrimaryObject();
if (!object)
return;
LLFloaterPay *floater = LLFloaterReg::showTypedInstance<LLFloaterPay>("pay_object", LLSD(object->getID()));
if (!floater)
return;
floater->setCallback(callback);
// Hold onto the selection until we close
floater->mObjectSelection = selection;
LLSelectNode* node = selection->getFirstRootNode();
if (!node)
{
//FIXME: notify user object no longer exists
floater->closeFloater();
return;
}
LLHost target_region = object->getRegion()->getHost();
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RequestPayPrice);
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addUUIDFast(_PREHASH_ObjectID, object->getID());
msg->sendReliable(target_region);
msg->setHandlerFuncFast(_PREHASH_PayPriceReply, processPayPriceReply,(void **)floater);
LLUUID owner_id;
BOOL is_group = FALSE;
node->mPermissions->getOwnership(owner_id, is_group);
floater->childSetText("object_name_text",node->mName);
floater->finishPayUI(owner_id, is_group);
}