当前位置: 首页>>代码示例>>C++>>正文


C++ LLSelectNode类代码示例

本文整理汇总了C++中LLSelectNode的典型用法代码示例。如果您正苦于以下问题:C++ LLSelectNode类的具体用法?C++ LLSelectNode怎么用?C++ LLSelectNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LLSelectNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: childSetCommitCallback

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;
}
开发者ID:Logear,项目名称:PartyHatViewer,代码行数:51,代码来源:llfloaterattachments.cpp

示例2: updateSelection

void FSFloaterObjectExport::updateSelection()
{
	LLObjectSelectionHandle object_selection = LLSelectMgr::getInstance()->getSelection();
	LLSelectNode* node = object_selection->getFirstRootNode();
	
	if (node && !node->mValid && node->getObject()->getID() == mCurrentObjectID)
	{
		return;
	}
		
	mObjectSelection = object_selection;
	dirty();
	refresh();
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:14,代码来源:fsfloaterexport.cpp

示例3: 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");
	}
}
开发者ID:Boy,项目名称:netbook,代码行数:48,代码来源:llfloateropenobject.cpp

示例4: 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);
	}
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:46,代码来源:llfloateropenobject.cpp

示例5: update

void LLInspectObject::update()
{
	// Performance optimization, because we listen to updates from select mgr
	// but we're never destroyed.
	if (!getVisible()) return;

	LLObjectSelection* selection = LLSelectMgr::getInstance()->getSelection();
	if (!selection) return;

	LLSelectNode* nodep = selection->getFirstRootNode();
	if (!nodep) return;

	updateButtons(nodep);
	updateName(nodep);
	updateDescription(nodep);
	updateCreator(nodep);
	updatePrice(nodep);
	
	LLViewerObject* obj = nodep->getObject();
	if(!obj)
		return;
	
	if ( mObjectFace < 0 
		||  mObjectFace >= obj->getNumTEs() )
	{
		return;
	}
	
	// Does this face have media?
	const LLTextureEntry* tep = obj->getTE(mObjectFace);
	if (!tep)
		return;
	
	mMediaEntry = tep->hasMedia() ? tep->getMediaData() : NULL;
	if(!mMediaEntry)
		return;
	
	mMediaImpl = LLViewerMedia::getMediaImplFromTextureID(mMediaEntry->getMediaID());
	
	updateMediaCurrentURL();
	updateSecureBrowsing();
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:42,代码来源:llinspectobject.cpp

示例6: 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));
}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:20,代码来源:llpanelpermissions.cpp

示例7: 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;
}
开发者ID:SimFederal,项目名称:SingularityViewer,代码行数:21,代码来源:llpanelpermissions.cpp

示例8: showFloaterWithSelectionObjects

void LLFloaterPathfindingObjects::showFloaterWithSelectionObjects()
{
	mObjectsToBeSelected.clear();

	LLObjectSelectionHandle selectedObjectsHandle = LLSelectMgr::getInstance()->getSelection();
	if (selectedObjectsHandle.notNull())
	{
		LLObjectSelection *selectedObjects = selectedObjectsHandle.get();
		if (!selectedObjects->isEmpty())
		{
			for (LLObjectSelection::valid_iterator objectIter = selectedObjects->valid_begin();
				objectIter != selectedObjects->valid_end(); ++objectIter)
			{
				LLSelectNode *object = *objectIter;
				LLViewerObject *viewerObject = object->getObject();
				mObjectsToBeSelected.push_back(viewerObject->getID());
			}
		}
	}
	mHasObjectsToBeSelected = true;

	if (!getVisible())
	{
		open();
		setVisibleAndFrontmost();
	}
	else
	{
		rebuildObjectsScrollList();
		if (isMinimized())
		{
			setMinimized(FALSE);
		}
		setVisibleAndFrontmost();
	}
	setFocus(TRUE);
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:37,代码来源:llfloaterpathfindingobjects.cpp

示例9: getString

void LLPanelPermissions::refresh()
{
	LLStringUtil::format_map_t argsCurrency;
	argsCurrency["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();

	LLButton*	BtnDeedToGroup = getChild<LLButton>("button deed");
	if(BtnDeedToGroup)
	{	
		std::string deedText;
		if (gSavedSettings.getWarning("DeedObject"))
		{
			deedText = getString("text deed continued");
		}
		else
		{
			deedText = getString("text deed");
		}
		BtnDeedToGroup->setLabelSelected(deedText);
		BtnDeedToGroup->setLabelUnselected(deedText);
	}
	BOOL root_selected = TRUE;
	LLSelectNode* nodep = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
	S32 object_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount();
	if(!nodep || 0 == object_count)
	{
		nodep = LLSelectMgr::getInstance()->getSelection()->getFirstNode();
		object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
		root_selected = FALSE;
	}

	//BOOL attachment_selected = LLSelectMgr::getInstance()->getSelection()->isAttachment();
	//attachment_selected = false;
	LLViewerObject* objectp = NULL;
	if(nodep) objectp = nodep->getObject();
	if(!nodep || !objectp)// || attachment_selected)
	{
		// ...nothing selected
		childSetEnabled("perm_modify",false);
		childSetText("perm_modify",LLStringUtil::null);

		childSetEnabled("Creator:",false);
		childSetText("Creator Name",LLStringUtil::null);
		childSetEnabled("Creator Name",false);
		childSetEnabled("button creator profile",false);

		childSetEnabled("Owner:",false);
		childSetText("Owner Name",LLStringUtil::null);
		childSetEnabled("Owner Name",false);
		childSetEnabled("button owner profile",false);

		childSetEnabled("Last Owner:",false);
		childSetText("Last Owner Name",LLStringUtil::null);
		childSetEnabled("Last Owner Name",false);
		childSetEnabled("button last owner profile",false);

		childSetEnabled("Group:",false);
		childSetText("Group Name",LLStringUtil::null);
		childSetEnabled("Group Name",false);
		childSetEnabled("button set group",false);

		childSetText("Object Name",LLStringUtil::null);
		childSetEnabled("Object Name",false);
		childSetEnabled("Name:",false);
		childSetText("Group Name",LLStringUtil::null);
		childSetEnabled("Group Name",false);
		childSetEnabled("Description:",false);
		childSetText("Object Description",LLStringUtil::null);
		childSetEnabled("Object Description",false);

		childSetEnabled("Permissions:",false);
		
		childSetValue("checkbox share with group",FALSE);
		childSetEnabled("checkbox share with group",false);
		childSetEnabled("button deed",false);

		childSetValue("checkbox allow everyone move",FALSE);
		childSetEnabled("checkbox allow everyone move",false);
		childSetValue("checkbox allow everyone copy",FALSE);
		childSetEnabled("checkbox allow everyone copy",false);

		//Next owner can:
		childSetEnabled("Next owner can:",false);
		childSetValue("checkbox next owner can modify",FALSE);
		childSetEnabled("checkbox next owner can modify",false);
		childSetValue("checkbox next owner can copy",FALSE);
		childSetEnabled("checkbox next owner can copy",false);
		childSetValue("checkbox next owner can transfer",FALSE);
		childSetEnabled("checkbox next owner can transfer",false);

		//checkbox for sale
		childSetValue("checkbox for sale",FALSE);
		childSetEnabled("checkbox for sale",false);

		//checkbox include in search
		childSetValue("search_check", FALSE);
		childSetEnabled("search_check", false);
		
		LLRadioGroup*	RadioSaleType = getChild<LLRadioGroup>("sale type");
		if(RadioSaleType)
		{
//.........这里部分代码省略.........
开发者ID:PhoenixDesmoulins,项目名称:imprudence,代码行数:101,代码来源:llpanelpermissions.cpp

示例10: getChildView

void LLFloaterInspect::refresh()
{
	LLUUID creator_id;
	std::string creator_name;
	S32 pos = mObjectList->getScrollPos();
	getChildView("button owner")->setEnabled(false);
	getChildView("button creator")->setEnabled(false);
	LLUUID selected_uuid;
	S32 selected_index = mObjectList->getFirstSelectedIndex();
	if(selected_index > -1)
	{
		LLScrollListItem* first_selected =
			mObjectList->getFirstSelected();
		if (first_selected)
		{
			selected_uuid = first_selected->getUUID();
		}
	}
	mObjectList->operateOnAll(LLScrollListCtrl::OP_DELETE);
	//List all transient objects, then all linked objects

	for (LLObjectSelection::valid_iterator iter = mObjectSelection->valid_begin();
		 iter != mObjectSelection->valid_end(); iter++)
	{
		LLSelectNode* obj = *iter;
		LLSD row;
		std::string owner_name, creator_name, last_owner_name;

		if (obj->mCreationDate == 0)
		{	// Don't have valid information from the server, so skip this one
			continue;
		}

		// Singu Note: Diverge from LL and handle datetime column in a sortable manner later on

		const LLUUID& idOwner = obj->mPermissions->getOwner();
		const LLUUID& idCreator = obj->mPermissions->getCreator();
		// <edit>
		const LLUUID& idLastOwner = obj->mPermissions->getLastOwner();
		// </edit>
		LLAvatarName av_name;

		// Only work with the names if we actually get a result
		// from the name cache. If not, defer setting the
		// actual name and set a placeholder.
		if (LLAvatarNameCache::get(idOwner, &av_name))
		{
//			owner_name = av_name.getNSName();
// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
			bool fRlvFilterOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && (idOwner != gAgent.getID()) &&
				(!obj->mPermissions->isGroupOwned());
			owner_name = (!fRlvFilterOwner) ? av_name.getNSName() : RlvStrings::getAnonym(av_name);
// [/RLVa:KB]
		}
		else
		{
			owner_name = LLTrans::getString("RetrievingData");
			if (mOwnerNameCacheConnection.find(idOwner) == mOwnerNameCacheConnection.end())
				mOwnerNameCacheConnection.emplace(idOwner, LLAvatarNameCache::get(idOwner, boost::bind(&LLFloaterInspect::onGetOwnerNameCallback, this, _1)));
		}

		// <edit>
		if (LLAvatarNameCache::get(idLastOwner, &av_name))
		{
//			last_owner_name = av_name.getNSName();
// [RLVa:LF] - Copied from the above creator check Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
			LLAvatarNameCache::get(idLastOwner, &av_name);
			bool fRlvFilterLastOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && idLastOwner != gAgent.getID() &&
				(obj->mPermissions->getOwner() == idLastOwner || RlvUtil::isNearbyAgent(idLastOwner));
			last_owner_name = (!fRlvFilterLastOwner) ? av_name.getNSName() : RlvStrings::getAnonym(av_name);
// [/RLVa:LF]
		}
		else
		{
			last_owner_name = LLTrans::getString("RetrievingData");
			if (mLastOwnerNameCacheConnection.find(idLastOwner) == mLastOwnerNameCacheConnection.end())
				mLastOwnerNameCacheConnection.emplace(idLastOwner,  LLAvatarNameCache::get(idLastOwner, boost::bind(&LLFloaterInspect::onGetLastOwnerNameCallback, this, _1)));
		}
		// </edit>

		if (LLAvatarNameCache::get(idCreator, &av_name))
		{
//			creator_name = av_name.getNSName();
// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
			const LLUUID& idCreator = obj->mPermissions->getCreator();
			LLAvatarNameCache::get(idCreator, &av_name);
			bool fRlvFilterCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && (idCreator != gAgent.getID()) &&
				( (obj->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator)) );
			creator_name = (!fRlvFilterCreator) ? av_name.getNSName() : RlvStrings::getAnonym(av_name);
// [/RLVa:KB]
		}
		else
		{
			creator_name = LLTrans::getString("RetrievingData");
			if (mCreatorNameCacheConnection.find(idCreator) == mCreatorNameCacheConnection.end())
				mCreatorNameCacheConnection.emplace(idCreator, LLAvatarNameCache::get(idCreator, boost::bind(&LLFloaterInspect::onGetCreatorNameCallback, this, _1)));
		}

		row["id"] = obj->getObject()->getID();
		row["columns"][0]["column"] = "object_name";
//.........这里部分代码省略.........
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:101,代码来源:llfloaterinspect.cpp

示例11: cmdline_printchat

void ScriptCounter::serializeSelection(bool delScript)
{
	LLDynamicArray<LLViewerObject*> catfayse;
	foo=LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
	sstr.str("");
	invqueries=0;
	doDelete=false;
	scriptcount=0;
	objIDS.clear();
	delUUIDS.clear();
	objectCount=0;
	countingDone=false;
	reqObjectID.setNull();
	if(foo)
	{
		if(foo->isAvatar())
		{
			LLVOAvatar* av=find_avatar_from_object(foo);
			if(av)
			{
				for (LLVOAvatar::attachment_map_t::iterator iter = av->mAttachmentPoints.begin();
					iter != av->mAttachmentPoints.end();
					++iter)
				{
					LLViewerJointAttachment* attachment = iter->second;
					if (!attachment->getValid())
						continue ;
					LLViewerObject* object = attachment->getObject();
					if(object)
					{
						catfayse.put(object);
						objectCount++;
					}
				}
			}
		}
		else
		{
			for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin();
					 iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++)
			{
				LLSelectNode* selectNode = *iter;
				LLViewerObject* object = selectNode->getObject();
				if(object)
				{
					catfayse.put(object);
					objectCount++;
				}
			}
			doDelete=delScript;
		}
		F32 throttle = gSavedSettings.getF32("OutBandwidth");
		if((throttle == 0.f) || (throttle > 128000.f))
		{
			gMessageSystem->mPacketRing.setOutBandwidth(128000);
			gMessageSystem->mPacketRing.setUseOutThrottle(TRUE);
		}
		cmdline_printchat("Counting scripts. Please wait.");
		if((objectCount == 1) && !(foo->isAvatar()))
		{
			LLViewerObject *reqObject=((LLViewerObject*)foo->getRoot());
			if(reqObject->isAvatar())
			{
				for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin();
					 iter != LLSelectMgr::getInstance()->getSelection()->end(); iter++ )
				{			
					LLSelectNode *nodep = *iter;
					LLViewerObject* objectp = nodep->getObject();
					if (objectp->isRootEdit())
					{
						reqObjectID=objectp->getID();
						LLMessageSystem* msg = gMessageSystem;
						msg->newMessageFast(_PREHASH_ObjectSelect);
						msg->nextBlockFast(_PREHASH_AgentData);
						msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
						msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
						msg->nextBlockFast(_PREHASH_ObjectData);
						msg->addU32Fast(_PREHASH_ObjectLocalID, objectp->getLocalID());
						msg->sendReliable(gAgent.getRegionHost());
						break;
					}
				}
			}
			else
			{
				reqObjectID=reqObject->getID();
				LLMessageSystem* msg = gMessageSystem;
				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, 0 );
				msg->addUUIDFast(_PREHASH_ObjectID, reqObjectID);
				gAgent.sendReliableMessage();
			}
		}
		serialize(catfayse);
	}
}
开发者ID:EmeraldViewer,项目名称:EmeraldViewer,代码行数:100,代码来源:scriptcounter.cpp

示例12: childSetEnabled

void LLFloaterInspect::refresh()
{
	LLUUID creator_id;
	std::string creator_name;
	S32 pos = mObjectList->getScrollPos();
	childSetEnabled("button owner", false);
	childSetEnabled("button_last_owner", false);
	childSetEnabled("button creator", false);
	LLUUID selected_uuid;
	S32 selected_index = mObjectList->getFirstSelectedIndex();
	if(selected_index > -1)
	{
		LLScrollListItem* first_selected =
			mObjectList->getFirstSelected();
		if (first_selected)
		{
			selected_uuid = first_selected->getUUID();
		}
	}
	mObjectList->operateOnAll(LLScrollListCtrl::OP_DELETE);
	//List all transient objects, then all linked objects

	for (LLObjectSelection::valid_iterator iter = mObjectSelection->valid_begin();
		 iter != mObjectSelection->valid_end(); iter++)
	{
		LLSelectNode* obj = *iter;
		LLSD row;
		char time[MAX_STRING];
		std::string owner_name, creator_name, last_owner_name;

		if (obj->mCreationDate == 0)
		{	// Don't have valid information from the server, so skip this one
			continue;
		}

		time_t timestamp = (time_t) (obj->mCreationDate/1000000);
		LLStringUtil::copy(time, ctime(&timestamp), MAX_STRING);
		time[24] = '\0';
		gCacheName->getFullName(obj->mPermissions->getOwner(), owner_name);
		gCacheName->getFullName(obj->mPermissions->getCreator(), creator_name);
		gCacheName->getFullName(obj->mPermissions->getLastOwner(), last_owner_name);
		row["id"] = obj->getObject()->getID();
		row["columns"][0]["column"] = "object_name";
		row["columns"][0]["type"] = "text";
		// make sure we're either at the top of the link chain
		// or top of the editable chain, for attachments
		if (!(obj->getObject()->isRoot() || obj->getObject()->isRootEdit()))
		{
			row["columns"][0]["value"] = std::string("   ") + obj->mName;
		}
		else
		{
			row["columns"][0]["value"] = obj->mName;
		}
		S32 i = 1;
		row["columns"][i]["column"] = "owner_name";
		row["columns"][i]["type"] = "text";
		row["columns"][i]["value"] = owner_name;
		++i;
		row["columns"][i]["column"] = "last_owner_name";
		row["columns"][i]["type"] = "text";
		row["columns"][i]["value"] = last_owner_name;
		++i;
		row["columns"][i]["column"] = "creator_name";
		row["columns"][i]["type"] = "text";
		row["columns"][i]["value"] = creator_name;
		++i;
		row["columns"][i]["column"] = "face_num";
		row["columns"][i]["type"] = "text";
		row["columns"][i]["value"] = llformat("%d", obj->getObject()->getNumFaces());
		++i;
		row["columns"][i]["column"] = "vertex_num";
		row["columns"][i]["type"] = "text";
		row["columns"][i]["value"] = llformat("%d", obj->getObject()->getNumVertices());
		++i;
		// inventory silliness
		S32 scripts = 0;
		S32 total_inv = 0;
		std::map<LLUUID, std::pair<S32, S32> >::iterator itr = mInventoryNums.find(obj->getObject()->getID());
		if (itr != mInventoryNums.end())
		{
			scripts = itr->second.first;
			total_inv = itr->second.second;
		}
		else if (std::find(mQueue.begin(), mQueue.end(), obj->getObject()->getID()) == mQueue.end())
		{
			mQueue.push_back(obj->getObject()->getID());
			registerVOInventoryListener(obj->getObject(), NULL);
			requestVOInventory();
		}
		row["columns"][i]["column"] = "script_num";
		row["columns"][i]["type"] = "text";
		row["columns"][i]["value"] = llformat("%d", scripts);
		++i;
		row["columns"][i]["column"] = "inv_num";
		row["columns"][i]["type"] = "text";
		row["columns"][i]["value"] = llformat("%d", total_inv);
		++i;
		row["columns"][i]["column"] = "creation_date";
		row["columns"][i]["type"] = "text";
//.........这里部分代码省略.........
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:101,代码来源:llfloaterinspect.cpp

示例13: getString

void LLPanelPermissions::refresh()
{

	LLStringUtil::format_map_t argsCurrency;
	argsCurrency["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol();

	LLButton*	BtnDeedToGroup = getChild<LLButton>("button deed");
	if(BtnDeedToGroup)
	{	
		std::string deedText;
		if (gSavedSettings.getWarning("DeedObject"))
		{
			deedText = getString("text deed continued");
		}
		else
		{
			deedText = getString("text deed");
		}
		BtnDeedToGroup->setLabelSelected(deedText);
		BtnDeedToGroup->setLabelUnselected(deedText);
	}
	BOOL root_selected = TRUE;
	LLSelectNode* nodep = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
	S32 object_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount();
	if(!nodep || 0 == object_count)
	{
		nodep = LLSelectMgr::getInstance()->getSelection()->getFirstNode();
		object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
		root_selected = FALSE;
	}

	//BOOL attachment_selected = LLSelectMgr::getInstance()->getSelection()->isAttachment();
	//attachment_selected = false;
	LLViewerObject* objectp = NULL;
	if(nodep) objectp = nodep->getObject();
	if(!nodep || !objectp)// || attachment_selected)
	{
		// ...nothing selected
		disableAll();
		return;
	}

	// figure out a few variables
	const BOOL is_one_object = (object_count == 1);

	// BUG: fails if a root and non-root are both single-selected.
	BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() 
							&& LLSelectMgr::getInstance()->selectGetRootsModify()) 
							|| LLSelectMgr::getInstance()->selectGetModify();
	BOOL is_nonpermanent_enforced = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() 
						   && LLSelectMgr::getInstance()->selectGetRootsNonPermanentEnforced())
		|| LLSelectMgr::getInstance()->selectGetNonPermanentEnforced();
	const LLFocusableElement* keyboard_focus_view = gFocusMgr.getKeyboardFocus();

	S32 string_index = 0;
	std::string MODIFY_INFO_STRINGS[] =
	{
		getString("text modify info 1"),
		getString("text modify info 2"),
		getString("text modify info 3"),
		getString("text modify info 4"),
		getString("text modify info 5"),
		getString("text modify info 6")
	};
	if(!is_perm_modify)
	{
		string_index += 2;
	}
	else if (!is_nonpermanent_enforced)
	{
		string_index += 4;
	}
	if(!is_one_object)
	{
		++string_index;
	}
	getChildView("perm_modify")->setEnabled(TRUE);
	getChild<LLUICtrl>("perm_modify")->setValue(MODIFY_INFO_STRINGS[string_index]);

	std::string pfAttrName;

	if ((LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() 
		&& LLSelectMgr::getInstance()->selectGetRootsNonPathfinding())
		|| LLSelectMgr::getInstance()->selectGetNonPathfinding())
	{
		pfAttrName = "Pathfinding_Object_Attr_None";
	}
	else if ((LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() 
		&& LLSelectMgr::getInstance()->selectGetRootsPermanent())
		|| LLSelectMgr::getInstance()->selectGetPermanent())
	{
		pfAttrName = "Pathfinding_Object_Attr_Permanent";
	}
	else if ((LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() 
		&& LLSelectMgr::getInstance()->selectGetRootsCharacter())
		|| LLSelectMgr::getInstance()->selectGetCharacter())
	{
		pfAttrName = "Pathfinding_Object_Attr_Character";
	}
	else
//.........这里部分代码省略.........
开发者ID:SimFederal,项目名称:SingularityViewer,代码行数:101,代码来源:llpanelpermissions.cpp

示例14: childSetEnabled

void LLFloaterInspect::refresh()
{
	LLUUID creator_id;
	std::string creator_name;
	S32 pos = mObjectList->getScrollPos();
	childSetEnabled("button owner", false);
	childSetEnabled("button creator", false);
	LLUUID selected_uuid;
	S32 selected_index = mObjectList->getFirstSelectedIndex();
	if(selected_index > -1)
	{
		LLScrollListItem* first_selected =
			mObjectList->getFirstSelected();
		if (first_selected)
		{
			selected_uuid = first_selected->getUUID();
		}
	}
	mObjectList->operateOnAll(LLScrollListCtrl::OP_DELETE);
	//List all transient objects, then all linked objects

	for (LLObjectSelection::valid_iterator iter = mObjectSelection->valid_begin();
		 iter != mObjectSelection->valid_end(); iter++)
	{
		LLSelectNode* obj = *iter;
		LLSD row;
		char time[MAX_STRING];
		std::string owner_name, creator_name;

		if (obj->mCreationDate == 0)
		{	// Don't have valid information from the server, so skip this one
			continue;
		}

		time_t timestamp = (time_t) (obj->mCreationDate/1000000);
		LLStringUtil::copy(time, ctime(&timestamp), MAX_STRING);
		time[24] = '\0';
		gCacheName->getFullName(obj->mPermissions->getOwner(), owner_name);
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e)
		if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
		{
			// TODO-RLVa: shouldn't filter if this is a group-owned prim (will show "(nobody)")
			owner_name = RlvStrings::getAnonym(owner_name);
		}
// [/RLVa:KB]
		gCacheName->getFullName(obj->mPermissions->getCreator(), creator_name);
		row["id"] = obj->getObject()->getID();
		row["columns"][0]["column"] = "object_name";
		row["columns"][0]["color"] = gColors.getColor("DefaultListText").getValue();
		row["columns"][0]["type"] = "text";
		// make sure we're either at the top of the link chain
		// or top of the editable chain, for attachments
		if(!(obj->getObject()->isRoot() || obj->getObject()->isRootEdit()))
		{
			row["columns"][0]["value"] = std::string("   ") + obj->mName;
		}
		else
		{
			row["columns"][0]["value"] = obj->mName;
		}
		row["columns"][1]["column"] = "owner_name";
		row["columns"][1]["color"] = gColors.getColor("DefaultListText").getValue();
		row["columns"][1]["type"] = "text";
		row["columns"][1]["value"] = owner_name;
		row["columns"][2]["column"] = "creator_name";
		row["columns"][2]["color"] = gColors.getColor("DefaultListText").getValue();
		row["columns"][2]["type"] = "text";
		row["columns"][2]["value"] = creator_name;
		row["columns"][3]["column"] = "creation_date";
		row["columns"][3]["color"] = gColors.getColor("DefaultListText").getValue();
		row["columns"][3]["type"] = "text";
		row["columns"][3]["value"] = time;
		mObjectList->addElement(row, ADD_TOP);
	}
	if(selected_index > -1 && mObjectList->getItemIndex(selected_uuid) == selected_index)
	{
		mObjectList->selectNthItem(selected_index);
	}
	else
	{
		mObjectList->selectNthItem(0);
	}
	onSelectObject(this, NULL);
	mObjectList->setScrollPos(pos);
}
开发者ID:EmeraldViewer,项目名称:EmeraldViewer,代码行数:85,代码来源:llfloaterinspect.cpp

示例15: memcpy

// From LLSelectMgr, refactored and ungayed.
// static
void LPermsMgr::processObjectProperties(LLMessageSystem* msg, void** user_data)
{
	S32 i;
	S32 count = msg->getNumberOfBlocksFast(_PREHASH_ObjectData);
	for (i = 0; i < count; i++)
	{
		LLUUID id;
		msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_ObjectID, id, i);

		LLUUID creator_id;
		LLUUID owner_id;
		LLUUID group_id;
		LLUUID last_owner_id;
		U64 creation_date;
		LLUUID extra_id;
		U32 base_mask, owner_mask, group_mask, everyone_mask, next_owner_mask;
		LLSaleInfo sale_info;
		LLCategory category;
		LLAggregatePermissions ag_perms;
		LLAggregatePermissions ag_texture_perms;
		LLAggregatePermissions ag_texture_perms_owner;
		
		msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_CreatorID, creator_id, i);
		msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_OwnerID, owner_id, i);
		msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_GroupID, group_id, i);
		msg->getU64Fast(_PREHASH_ObjectData, _PREHASH_CreationDate, creation_date, i);
		msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_BaseMask, base_mask, i);
		msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_OwnerMask, owner_mask, i);
		msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_GroupMask, group_mask, i);
		msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_EveryoneMask, everyone_mask, i);
		msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_NextOwnerMask, next_owner_mask, i);
		sale_info.unpackMultiMessage(msg, _PREHASH_ObjectData, i);

		ag_perms.unpackMessage(msg, _PREHASH_ObjectData, _PREHASH_AggregatePerms, i);
		ag_texture_perms.unpackMessage(msg, _PREHASH_ObjectData, _PREHASH_AggregatePermTextures, i);
		ag_texture_perms_owner.unpackMessage(msg, _PREHASH_ObjectData, _PREHASH_AggregatePermTexturesOwner, i);
		category.unpackMultiMessage(msg, _PREHASH_ObjectData, i);

		S16 inv_serial = 0;
		msg->getS16Fast(_PREHASH_ObjectData, _PREHASH_InventorySerial, inv_serial, i);

		LLUUID item_id;
		msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_ItemID, item_id, i);
		LLUUID folder_id;
		msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_FolderID, folder_id, i);
		LLUUID from_task_id;
		msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_FromTaskID, from_task_id, i);

		msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_LastOwnerID, last_owner_id, i);

		std::string name;
		msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, name, i);
		std::string desc;
		msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, desc, i);

		std::string touch_name;
		msg->getStringFast(_PREHASH_ObjectData, _PREHASH_TouchName, touch_name, i);
		std::string sit_name;
		msg->getStringFast(_PREHASH_ObjectData, _PREHASH_SitName, sit_name, i);

		//unpack TE IDs
		std::vector<LLUUID> texture_ids;
		S32 size = msg->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_TextureID);
		if (size > 0)
		{
			S8 packed_buffer[SELECT_MAX_TES * UUID_BYTES];
			msg->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_TextureID, packed_buffer, 0, i, SELECT_MAX_TES * UUID_BYTES);

			for (S32 buf_offset = 0; buf_offset < size; buf_offset += UUID_BYTES)
			{
				LLUUID tid;
				memcpy(tid.mData, packed_buffer + buf_offset, UUID_BYTES);		/* Flawfinder: ignore */
				texture_ids.push_back(tid);
			}
		}


		// Iterate through nodes at end, since it can be on both the regular AND hover list
		struct f : public LLSelectedNodeFunctor
		{
			LLUUID mID;
			f(const LLUUID& id) : mID(id) {}
			virtual bool apply(LLSelectNode* node)
			{
				return (node->getObject() && node->getObject()->mID == mID);
			}
		} func(id);
		LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(&func);

		if (node)
		{
			if (node->mInventorySerial != inv_serial)
			{
				node->getObject()->dirtyInventory();
			}

			// save texture data as soon as we get texture perms first time
			if (!node->mValid)
//.........这里部分代码省略.........
开发者ID:N3X15,项目名称:Luna-Viewer,代码行数:101,代码来源:flpermissionsmgr.cpp


注:本文中的LLSelectNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。