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


C++ LLPreviewTexture类代码示例

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


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

示例1: LLPreviewTexture

void LLViewerTextEditor::openEmbeddedTexture( LLInventoryItem* item, llwchar wc )
{
// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a
	if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE))
	{
		RlvUtil::notifyBlockedViewXXX(LLAssetType::AT_TEXTURE);
		return;
	}
// [/RLVa:KB]

	// See if we can bring an existing preview to the front
	// *NOTE:  Just for embedded Texture , we should use getAssetUUID(), 
	// not getUUID(), because LLPreviewTexture pass in AssetUUID into 
	// LLPreview constructor ItemUUID parameter.

	if( !LLPreview::show( item->getAssetUUID() ) )
	{
		// There isn't one, so make a new preview
		if(item)
		{
			S32 left, top;
			gFloaterView->getNewFloaterPosition(&left, &top);
			LLRect rect = gSavedSettings.getRect("PreviewTextureRect");
			rect.translate( left - rect.mLeft, top - rect.mTop );

			LLPreviewTexture* preview = new LLPreviewTexture("preview texture",
				rect,
				item->getName(),
				item->getAssetUUID(),
				TRUE);
			preview->setAuxItem( item );
			preview->setNotecardInfo(mNotecardInventoryID, mObjectID);
		}
	}
}
开发者ID:Ratany,项目名称:SingularityViewer,代码行数:35,代码来源:llviewertexteditor.cpp

示例2: if

// static
void LLPreviewTexture::onSaveAsBtn(LLUICtrl* ctrl, void* data)
{
	LLPreviewTexture* self = (LLPreviewTexture*)data;
	std::string value = ctrl->getValue().asString();
	if (value == "format_png")
	{
		self->saveAs(LLPreviewTexture::FORMAT_PNG);
	}
	else if (value == "format_tga")
	{
		self->saveAs(LLPreviewTexture::FORMAT_TGA);
	}
	else
	{
		// <FS:PP> Allow to use user-defined default save format for textures
		// self->saveAs(LLPreviewTexture::FORMAT_TGA);
		if (!gSavedSettings.getBOOL("FSTextureDefaultSaveAsFormat"))
		{
			self->saveAs(LLPreviewTexture::FORMAT_TGA);
		}
		else
		{
			self->saveAs(LLPreviewTexture::FORMAT_PNG);
		}
		// </FS:PP>
	}
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:28,代码来源:llpreviewtexture.cpp

示例3: LLUUID

// static
void LLPreviewTexture::saveAsCallback(LLFilePicker::ESaveFilter type,
									  std::string& filename, void* user_data)
{
	LLPreviewTexture* self = (LLPreviewTexture*)user_data;
	if (!self || !sList.count(self))
	{
		LLNotifications::instance().add("TextureSavingAborted");
	}

	if (filename.empty()) return;

	// remember the user-approved/edited file name.
	self->mSaveFileName = filename;
	self->mLoadingFullImage = TRUE;
	self->getWindow()->incBusyCount();
	self->mImage->forceToSaveRawImage(0) ;//re-fetch the raw image if the old one is removed.
	if (type == LLFilePicker::FFSAVE_PNG)
	{
		self->mImage->setLoadedCallback(LLPreviewTexture::onFileLoadedForSavePNG, 0, TRUE, FALSE, new LLUUID(self->mItemUUID), &self->mCallbackTextureList);
	}
	else
	{
		self->mImage->setLoadedCallback(LLPreviewTexture::onFileLoadedForSaveTGA, 0, TRUE, FALSE, new LLUUID(self->mItemUUID), &self->mCallbackTextureList);
	}
}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:26,代码来源:llpreviewtexture.cpp

示例4: LLSD

void LLViewerTextEditor::openEmbeddedTexture( LLInventoryItem* item, llwchar wc )
{
	// *NOTE:  Just for embedded Texture , we should use getAssetUUID(), 
	// not getUUID(), because LLPreviewTexture pass in AssetUUID into 
	// LLPreview constructor ItemUUID parameter.
	if (!item)
		return;
	LLPreviewTexture* preview = LLFloaterReg::showTypedInstance<LLPreviewTexture>("preview_texture", LLSD(item->getAssetUUID()), TAKE_FOCUS_YES);
	if (preview)
	{
		preview->setAuxItem( item );
		preview->setNotecardInfo(mNotecardInventoryID, mObjectID);
	}
}
开发者ID:Krazy-Bish-Margie,项目名称:Thunderstorm,代码行数:14,代码来源:llviewertexteditor.cpp

示例5: LLSD

void LLViewerTextEditor::openEmbeddedTexture( LLInventoryItem* item, llwchar wc )
{
	// *NOTE:  Just for embedded Texture , we should use getAssetUUID(), 
	// not getUUID(), because LLPreviewTexture pass in AssetUUID into 
	// LLPreview constructor ItemUUID parameter.
	if (!item)
		return;
//	LLPreviewTexture* preview = LLFloaterReg::showTypedInstance<LLPreviewTexture>("preview_texture", LLSD(item->getAssetUUID()), TAKE_FOCUS_YES);
// [SL:KB] - Patch: UI-Notecards | Checked: 2010-09-05 (Catznip-2.1.2a) | Added: Catznip-2.1.2a
	// If there's already a preview of the texture open then we do want it to take focus, otherwise leave it up to the debug setting
	BOOL fHasInstance = (NULL != LLFloaterReg::findTypedInstance<LLPreviewTexture>("preview_texture", LLSD(item->getAssetUUID())));
	BOOL fTakeFocus = ( (fHasInstance) || (gSavedSettings.getBOOL("EmbeddedTextureStealsFocus")) ) ? TAKE_FOCUS_YES : TAKE_FOCUS_NO;
	LLPreviewTexture* preview = LLFloaterReg::showTypedInstance<LLPreviewTexture>("preview_texture", LLSD(item->getAssetUUID()), fTakeFocus);
// [/SL:KB]
	if (preview)
	{
		preview->setAuxItem( item );
		preview->setNotecardInfo(mNotecardInventoryID, mObjectID);
	}
}
开发者ID:OS-Development,项目名称:VW.Dolphin_v3,代码行数:20,代码来源:llviewertexteditor.cpp

示例6: LLSD

void LLViewerTextEditor::openEmbeddedTexture( LLInventoryItem* item, llwchar wc )
{
	// *NOTE:  Just for embedded Texture , we should use getAssetUUID(), 
	// not getUUID(), because LLPreviewTexture pass in AssetUUID into 
	// LLPreview constructor ItemUUID parameter.
	if (!item)
		return;
	LLPreviewTexture* preview = LLFloaterReg::showTypedInstance<LLPreviewTexture>("preview_texture", LLSD(item->getAssetUUID()), TAKE_FOCUS_YES);
	if (preview)
	{
		preview->setAuxItem( item );
		preview->setNotecardInfo(mNotecardInventoryID, mObjectID);
		if (preview->hasString("Title"))
		{
			LLStringUtil::format_map_t args;
			args["[NAME]"] = item->getName();
			LLUIString title = preview->getString("Title", args);
			preview->setTitle(title.getString());
		}
		preview->getChild<LLUICtrl>("desc")->setValue(item->getDescription());
	}
}
开发者ID:Belxjander,项目名称:Kirito,代码行数:22,代码来源:llviewertexteditor.cpp

示例7: onSaveAsBtn

// static
void LLPreviewTexture::onSaveAsBtn(void* data)
{
	LLPreviewTexture* self = (LLPreviewTexture*)data;
	self->saveAs();
}
开发者ID:DarkSpyro003,项目名称:DarkSpyros_Viewer,代码行数:6,代码来源:llpreviewtexture.cpp

示例8: LLPreviewSound

void LLLocalInventory::open(LLUUID item_id)
{
    LLViewerInventoryItem* item = gInventory.getItem(item_id);
    if(!item)
    {
        llwarns << "Trying to open non-existent item" << llendl;
        return;
    }

    LLAssetType::EType type = item->getType();

    if(type == LLAssetType::AT_SOUND)
    {
        S32 left, top;
        gFloaterView->getNewFloaterPosition(&left, &top);
        LLRect rect = gSavedSettings.getRect("PreviewSoundRect");
        rect.translate(left - rect.mLeft, top - rect.mTop);
        LLPreviewSound* floaterp;
        floaterp = 	new LLPreviewSound("Preview sound",
                                       rect,
                                       "",
                                       item_id);
        floaterp->setFocus(TRUE);
        gFloaterView->adjustToFitScreen(floaterp, FALSE);
    }
    else if(type == LLAssetType::AT_ANIMATION)
    {
        S32 left, top;
        gFloaterView->getNewFloaterPosition(&left, &top);
        LLRect rect = gSavedSettings.getRect("PreviewAnimRect");
        rect.translate(left - rect.mLeft, top - rect.mTop);
        LLPreviewAnim* floaterp;
        floaterp = 	new LLPreviewAnim("Preview anim",
                                      rect,
                                      "",
                                      item_id,
                                      LLPreviewAnim::NONE);
        floaterp->setFocus(TRUE);
        gFloaterView->adjustToFitScreen(floaterp, FALSE);
    }
    else if(type == LLAssetType::AT_TEXTURE)
    {
        S32 left, top;
        gFloaterView->getNewFloaterPosition(&left, &top);
        LLRect rect = gSavedSettings.getRect("PreviewTextureRect");
        rect.translate( left - rect.mLeft, top - rect.mTop );

        LLPreviewTexture* preview;
        preview = new LLPreviewTexture("preview texture",
                                       rect,
                                       "Preview texture",
                                       item_id,
                                       LLUUID::null,
                                       FALSE);
        //preview->setSourceID(source_id);
        preview->setFocus(TRUE);

        gFloaterView->adjustToFitScreen(preview, FALSE);
    }
    else if(type == LLAssetType::AT_GESTURE)
    {
        // If only the others were like this
        LLPreviewGesture::show("preview gesture", item_id, LLUUID::null, TRUE);
    }
    else if(type == LLAssetType::AT_LANDMARK)
    {
        S32 left, top;
        gFloaterView->getNewFloaterPosition(&left, &top);
        LLRect rect = gSavedSettings.getRect("PreviewLandmarkRect");
        rect.translate( left - rect.mLeft, top - rect.mTop );

        LLPreviewLandmark* preview;
        preview = new LLPreviewLandmark("preview landmark",
                                        rect,
                                        "Preview landmark",
                                        item_id);
        preview->setFocus(TRUE);

        gFloaterView->adjustToFitScreen(preview, FALSE);
    }
    else
    {
        llwarns << "Dunno how to open type " << type << llendl;
    }
}
开发者ID:nathanmarck,项目名称:VoodooNxg,代码行数:85,代码来源:lllocalinventory.cpp

示例9: callbackLoadAvatarName

/*
void LLPreviewTexture::callbackLoadAvatarName(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data)
{
	if (!sInstance) return;
	std::ostringstream fullname;
	fullname << first << " " << last;
	sInstance->childSetText("uploader", fullname.str());
}
*/
void LLPreviewTexture::callbackLoadAvatarName(const LLUUID& id, const std::string& fullname, bool is_group, void* userdata)
{
	LLPreviewTexture* self = (LLPreviewTexture*)userdata;
	if (!self || !sList.count(self)) return;
	self->childSetText("uploader", fullname);
}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:15,代码来源:llpreviewtexture.cpp


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