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


C++ LLPointer类代码示例

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


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

示例1: loadPersistentNotifications

	void loadPersistentNotifications()
	{
		llinfos << "Loading open notifications from " << mFileName << llendl;

		llifstream notify_file(mFileName.c_str());
		if (!notify_file.is_open()) 
		{
			llwarns << "Failed to open " << mFileName << llendl;
			return;
		}

		LLSD input;
		LLPointer<LLSDParser> parser = new LLSDXMLParser();
		if (parser->parse(notify_file, input, LLSDSerialize::SIZE_UNLIMITED) < 0)
		{
			llwarns << "Failed to parse open notifications" << llendl;
			return;
		}

		if (input.isUndefined()) return;
		std::string version = input["version"];
		if (version != NOTIFICATION_PERSIST_VERSION)
		{
			llwarns << "Bad open notifications version: " << version << llendl;
			return;
		}
		LLSD& data = input["data"];
		if (data.isUndefined()) return;

		LLNotifications& instance = LLNotifications::instance();
		for (LLSD::array_const_iterator notification_it = data.beginArray();
			notification_it != data.endArray();
			++notification_it)
		{
			instance.add(LLNotificationPtr(new LLNotification(*notification_it)));
		}
	}
开发者ID:OS-Development,项目名称:VW.Singularity,代码行数:37,代码来源:llnotifications.cpp

示例2: findImage

LLViewerFetchedTexture* LLViewerTextureList::getImageFromUrl(const std::string& url,
												   BOOL usemipmaps,
												   LLViewerTexture::EBoostLevel boost_priority,
												   S8 texture_type,
												   LLGLint internal_format,
												   LLGLenum primary_format, 
												   const LLUUID& force_id)
{
	// generate UUID based on hash of filename
	LLUUID new_id;
	if (force_id.notNull())
	{
		new_id = force_id;
	}
	else
	{
		new_id.generate(url);
	}

	LLPointer<LLViewerFetchedTexture> imagep = findImage(new_id);
	
	if (imagep.isNull())
	{
		switch(texture_type)
		{
		case LLViewerTexture::FETCHED_TEXTURE:
			imagep = new LLViewerFetchedTexture(url, new_id, usemipmaps);
			break ;
		case LLViewerTexture::LOD_TEXTURE:
			imagep = new LLViewerLODTexture(url, new_id, usemipmaps);
			break ;
		default:
			llerrs << "Invalid texture type " << texture_type << llendl ;
		}		
		
		if (internal_format && primary_format)
		{
			imagep->setExplicitFormat(internal_format, primary_format);
		}

		addImage(imagep);
		
		if (boost_priority != 0)
		{
			if (boost_priority == LLViewerFetchedTexture::BOOST_UI ||
				boost_priority == LLViewerFetchedTexture::BOOST_ICON)
			{
				imagep->dontDiscard();
			}
			imagep->setBoostLevel(boost_priority);
		}
	}

	imagep->setGLTextureCreated(true);

	return imagep;
}
开发者ID:Xara,项目名称:kris-clone,代码行数:57,代码来源:llviewertexturelist.cpp

示例3: handle_click_action_open_media

static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp)
{
	//FIXME: how do we handle object in different parcel than us?
	LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
	if (!parcel) return;

	// did we hit an object?
	if (objectp.isNull()) return;

	// did we hit a valid face on the object?
	S32 face = LLToolPie::getInstance()->getPick().mObjectFace;
	if( face < 0 || face >= objectp->getNumTEs() ) return;
		
	// is media playing on this face?
	if (!LLViewerMedia::isActiveMediaTexture(objectp->getTE(face)->getID()))
	{
		handle_click_action_play();
		return;
	}

	std::string media_url = std::string ( parcel->getMediaURL () );
	std::string media_type = std::string ( parcel->getMediaType() );
	LLStringUtil::trim(media_url);

	// Get the scheme, see if that is handled as well.
	LLURI uri(media_url);
	std::string media_scheme = uri.scheme() != "" ? uri.scheme() : "http";

	// HACK: This is directly referencing an impl name.  BAD!
	// This can be removed when we have a truly generic media browser that only 
	// builds an impl based on the type of url it is passed.

	if(	LLMediaManager::getInstance()->supportsMediaType( "LLMediaImplLLMozLib", media_scheme, media_type ) )
	{
		LLWeb::loadURL(media_url);
	}
}
开发者ID:Rezzable,项目名称:heritagekey-viewer,代码行数:37,代码来源:lltoolpie.cpp

示例4: LLImageRaw

void LLSurface::createSTexture()
{
	if (!mSTexturep)
	{
		// Fill with dummy gray data.	
		// GL NOT ACTIVE HERE
		LLPointer<LLImageRaw> raw = new LLImageRaw(sTextureSize, sTextureSize, 3);
		U8 *default_texture = raw->getData();
		for (S32 i = 0; i < sTextureSize; i++)
		{
			for (S32 j = 0; j < sTextureSize; j++)
			{
				*(default_texture + (i*sTextureSize + j)*3) = 128;
				*(default_texture + (i*sTextureSize + j)*3 + 1) = 128;
				*(default_texture + (i*sTextureSize + j)*3 + 2) = 128;
			}
		}

		mSTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
		mSTexturep->dontDiscard();
		gGL.getTexUnit(0)->bind(mSTexturep);
		mSTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);		
	}
}
开发者ID:wish-ds,项目名称:firestorm-ds,代码行数:24,代码来源:llsurface.cpp

示例5:

/*
  Processed menu items with such parameters:
  can_allow_text_chat
  can_moderate_voice
*/
bool LLParticipantList::LLParticipantListMenu::enableModerateContextMenuItem(const LLSD& userdata)
{
	// only group moderators can perform actions related to this "enable callback"
	if (!isGroupModerator()) return false;

	const LLUUID& participant_id = mUUIDs.front();
	LLPointer<LLSpeaker> speakerp = mParent.mSpeakerMgr->findSpeaker(participant_id);

	// not in voice participants can not be moderated
	bool speaker_in_voice = speakerp.notNull() && speakerp->isInVoiceChannel();

	const std::string& item = userdata.asString();

	if ("can_moderate_voice" == item)
	{
		return speaker_in_voice;
	}

	// For now non of menu actions except "can_moderate_voice" can be performed for Avaline callers.
	bool is_participant_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(participant_id);
	if (!is_participant_avatar) return false;

	return true;
}
开发者ID:OS-Development,项目名称:VW.Zen,代码行数:29,代码来源:llparticipantlist.cpp

示例6: paramsData

void AscentDayCycleManager::savePresets(const std::string & fileName)
{
	//Nobody currently calls me, but if they did, then its reasonable to write the data out to the user's folder
	//and not over the RO system wide version.

	LLSD paramsData(LLSD::emptyMap());
	
	std::string pathName(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", fileName));

	/*for(std::map<std::string, LLWLDayCycle>::iterator mIt = mParamList.begin();
		mIt != mParamList.end();
		++mIt) 
	{
		paramsData[mIt->first] = mIt->second.getAll();
	}*/

	llofstream presetsXML(pathName);

	LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter();

	formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY);

	presetsXML.close();
}
开发者ID:arsenico,项目名称:SingularityViewer,代码行数:24,代码来源:ascentdaycyclemanager.cpp

示例7: setLandForSaleImage

void LLSimInfo::setLandForSaleImage (LLUUID image_id)
{
    LLPointer<LLViewerFetchedTexture> mOverlayImage;
    if (mMapImageID[SIM_LAYER_OVERLAY].isNull() && image_id.notNull()) {
        mOverlayImage = LLViewerTextureManager::findFetchedTexture(image_id);
        if(mOverlayImage.notNull()) {
            LLAppViewer::getTextureCache()->removeFromCache(image_id);
        }
    }

    mMapImageID[SIM_LAYER_OVERLAY] = image_id;

    // Fetch the image
    if (mMapImageID[SIM_LAYER_OVERLAY].notNull())
    {
        mLayerImage[SIM_LAYER_OVERLAY] = LLViewerTextureManager::getFetchedTexture(mMapImageID[SIM_LAYER_OVERLAY], MIPMAP_TRUE, LLViewerTexture::BOOST_MAP, LLViewerTexture::LOD_TEXTURE);
        mLayerImage[SIM_LAYER_OVERLAY]->forceImmediateUpdate();
        mLayerImage[SIM_LAYER_OVERLAY]->setAddressMode(LLTexUnit::TAM_CLAMP);
    }
    else
    {
        mLayerImage[SIM_LAYER_OVERLAY] = NULL;
    }
}
开发者ID:nhede,项目名称:SingularityViewer,代码行数:24,代码来源:llworldmap.cpp

示例8: LLImageRaw

void LLSurface::createWaterTexture()
{
	if (!mWaterTexturep)
	{
		// Create the water texture
		LLPointer<LLImageRaw> raw = new LLImageRaw(sTextureSize/2, sTextureSize/2, 4);
		U8 *default_texture = raw->getData();
		for (S32 i = 0; i < sTextureSize/2; i++)
		{
			for (S32 j = 0; j < sTextureSize/2; j++)
			{
				*(default_texture + (i*sTextureSize/2 + j)*4) = MAX_WATER_COLOR.mV[0];
				*(default_texture + (i*sTextureSize/2 + j)*4 + 1) = MAX_WATER_COLOR.mV[1];
				*(default_texture + (i*sTextureSize/2 + j)*4 + 2) = MAX_WATER_COLOR.mV[2];
				*(default_texture + (i*sTextureSize/2 + j)*4 + 3) = MAX_WATER_COLOR.mV[3];
			}
		}
		
		mWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
		mWaterTexturep->dontDiscard();
		gGL.getTexUnit(0)->bind(mWaterTexturep);
		mWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
	}
}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:24,代码来源:llsurface.cpp

示例9: setItem

void LLPanelGroupNotices::setItem(LLPointer<LLInventoryItem> inv_item)
{
	mInventoryItem = inv_item;

	BOOL item_is_multi = FALSE;
	if ( inv_item->getFlags() & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS )
	{
		item_is_multi = TRUE;
	};

	std::string icon_name = get_item_icon_name(inv_item->getType(),
										inv_item->getInventoryType(),
										inv_item->getFlags(),
										item_is_multi );

	mCreateInventoryIcon->setImage(icon_name);
	mCreateInventoryIcon->setVisible(TRUE);

	std::stringstream ss;
	ss << "        " << mInventoryItem->getName();

	mCreateInventoryName->setText(ss.str());
	mBtnRemoveAttachment->setEnabled(TRUE);
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:24,代码来源:llpanelgroupnotices.cpp

示例10: setHoverFace

void LLViewerMediaFocus::setHoverFace(LLPointer<LLViewerObject> objectp, S32 face, viewer_media_t media_impl, LLVector3 pick_normal)
{
	if (media_impl.notNull())
	{
		mHoverImplID = media_impl->getMediaTextureID();
		mHoverObjectID = objectp->getID();
		mHoverObjectFace = face;
		mHoverObjectNormal = pick_normal;
	}
	else
	{
		mHoverObjectID = LLUUID::null;
		mHoverObjectFace = 0;
		mHoverImplID = LLUUID::null;
	}
}
开发者ID:kow,项目名称:Astra-Viewer-2,代码行数:16,代码来源:llviewermediafocus.cpp

示例11: LLImageJ2C

// note: modifies the argument raw_image!!!!
LLPointer<LLImageJ2C> LLViewerImageList::convertToUploadFile(LLPointer<LLImageRaw> raw_image)
{
	raw_image->biasedScaleToPowerOfTwo(LLViewerImage::MAX_IMAGE_SIZE_DEFAULT);
	LLPointer<LLImageJ2C> compressedImage = new LLImageJ2C();
	compressedImage->setRate(0.f);
	
	if (gSavedSettings.getBOOL("LosslessJ2CUpload") &&
		(raw_image->getWidth() * raw_image->getHeight() <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF))
		compressedImage->setReversible(TRUE);
	
	compressedImage->encode(raw_image, 0.0f);
	
	return compressedImage;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:15,代码来源:llviewerimagelist.cpp

示例12: getRiggedGeometry

void LLDrawPoolAvatar::getRiggedGeometry(LLFace* face, LLPointer<LLVertexBuffer>& buffer, U32 data_mask, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face)
{
	face->setGeomIndex(0);
	face->setIndicesIndex(0);
		
		//rigged faces do not batch textures
		face->setTextureIndex(255);

		if (buffer.isNull() || buffer->getTypeMask() != data_mask || !buffer->isWriteable())
		{ //make a new buffer
			if (sShaderLevel > 0)
			{
				buffer = new LLVertexBuffer(data_mask, GL_DYNAMIC_DRAW_ARB);
			}
			else
			{
				buffer = new LLVertexBuffer(data_mask, GL_STREAM_DRAW_ARB);
			}
			buffer->allocateBuffer(vol_face.mNumVertices, vol_face.mNumIndices, true);
		}
		else //resize existing buffer
		{
			buffer->resizeBuffer(vol_face.mNumVertices, vol_face.mNumIndices);
		}

		face->setSize(vol_face.mNumVertices, vol_face.mNumIndices);
		face->setVertexBuffer(buffer);

		U16 offset = 0;
		
		LLMatrix4a mat_vert;
		mat_vert.loadu(skin->mBindShapeMatrix);
		LLMatrix4a mat_inv_trans = mat_vert;
		mat_inv_trans.invert();
		mat_inv_trans.transpose();

		//let getGeometryVolume know if alpha should override shiny
		U32 type = gPipeline.getPoolTypeFromTE(face->getTextureEntry(), face->getTexture());

		if (type == LLDrawPool::POOL_ALPHA)
		{
			face->setPoolType(LLDrawPool::POOL_ALPHA);
		}
		else
		{
		face->setPoolType(LLDrawPool::POOL_AVATAR);
	}

	//llinfos << "Rebuilt face " << face->getTEOffset() << " of " << face->getDrawable() << " at " << gFrameTimeSeconds << llendl;
	face->getGeometryVolume(*volume, face->getTEOffset(), mat_vert, mat_inv_trans, offset, true);

	buffer->flush();
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:53,代码来源:lldrawpoolavatar.cpp

示例13: return

LLViewerImage* LLViewerImageList::getImage(const LLUUID &image_id,
												   BOOL usemipmaps,
												   BOOL level_immediate,
												   LLGLint internal_format,
												   LLGLenum primary_format,
												   LLHost request_from_host)
{
	// Return the image with ID image_id
	// If the image is not found, creates new image and
	// enqueues a request for transmission
	
	if ((&image_id == NULL) || image_id.isNull())
	{
		return (getImage(IMG_DEFAULT, TRUE, TRUE));
	}
	
	LLPointer<LLViewerImage> imagep = hasImage(image_id);
	
	if (imagep.isNull())
	{
		imagep = new LLViewerImage(image_id, request_from_host, usemipmaps);
		
		if (internal_format && primary_format)
		{
			imagep->setExplicitFormat(internal_format, primary_format);
		}
		
		addImage(imagep);
		
		if (level_immediate)
		{
			imagep->dontDiscard();
			imagep->setBoostLevel(LLViewerImageBoostLevel::BOOST_UI);
		}
		else
		{
			//by default, the texure can not be removed from memory even if it is not used.
			//here turn this off
			//if this texture should be set to NO_DELETE, either pass level_immediate == TRUE here, or call setNoDelete() afterwards.
			imagep->forceActive() ;
		}
	}

	imagep->setGLTextureCreated(true);
	
	return imagep;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:47,代码来源:llviewerimagelist.cpp

示例14: ll_create_category_from_sd

LLPointer<LLInventoryCategory> ll_create_category_from_sd(const LLSD& sd_cat)
{
	LLPointer<LLInventoryCategory> rv = new LLInventoryCategory;
	rv->setUUID(sd_cat[INV_FOLDER_ID_LABEL].asUUID());
	rv->setParent(sd_cat[INV_PARENT_ID_LABEL].asUUID());
	rv->rename(sd_cat[INV_NAME_LABEL].asString());
	rv->setType(
		LLAssetType::lookup(sd_cat[INV_ASSET_TYPE_LABEL].asString()));
	rv->setPreferredType(
		LLAssetType::lookup(
			sd_cat[INV_PREFERRED_TYPE_LABEL].asString()));
	return rv;
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:13,代码来源:llinventory.cpp

示例15: ll_create_sd_from_inventory_category

LLSD ll_create_sd_from_inventory_category(LLPointer<LLInventoryCategory> cat)
{
	LLSD rv;
	if(cat.isNull()) return rv;
	if (cat->getType() == LLAssetType::AT_NONE)
	{
		LL_WARNS() << "ll_create_sd_from_inventory_category() for cat with AT_NONE"
			<< LL_ENDL;
		return rv;
	}
	rv[INV_FOLDER_ID_LABEL] = cat->getUUID();
	rv[INV_PARENT_ID_LABEL] = cat->getParentUUID();
	rv[INV_NAME_LABEL] = cat->getName();
	rv[INV_ASSET_TYPE_LABEL] = LLAssetType::lookup(cat->getType());
	if(LLFolderType::lookupIsProtectedType(cat->getPreferredType()))
	{
		rv[INV_PREFERRED_TYPE_LABEL] =
			LLFolderType::lookup(cat->getPreferredType()).c_str();
	}
	return rv;
}
开发者ID:DamianZhaoying,项目名称:SingularityViewer,代码行数:21,代码来源:llinventory.cpp


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