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


C++ TWeakPtr::IsValid方法代码示例

本文整理汇总了C++中TWeakPtr::IsValid方法的典型用法代码示例。如果您正苦于以下问题:C++ TWeakPtr::IsValid方法的具体用法?C++ TWeakPtr::IsValid怎么用?C++ TWeakPtr::IsValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TWeakPtr的用法示例。


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

示例1: RetargetNonSkeletonAnimationHandler

void FAssetTypeActions_AnimationAsset::RetargetNonSkeletonAnimationHandler(USkeleton* OldSkeleton, USkeleton* NewSkeleton, bool bRemapReferencedAssets, bool bConvertSpaces, bool bDuplicateAssets, TArray<TWeakObjectPtr<UObject>> InAnimAssets, TWeakPtr<IToolkitHost> EditWithinLevelEditor)
{
	RetargetAnimationHandler(OldSkeleton, NewSkeleton, bRemapReferencedAssets, bConvertSpaces, bDuplicateAssets, InAnimAssets);

	if(NewSkeleton)
	{
		for(auto Asset : InAnimAssets)
		{
			if (Asset.IsValid())
			{
				const bool bBringToFrontIfOpen = false;
				if(IAssetEditorInstance* EditorInstance = FAssetEditorManager::Get().FindEditorForAsset(NewSkeleton, bBringToFrontIfOpen))
				{
					// The skeleton is already open in an editor.
					// Tell persona that an animation asset was requested
					EditorInstance->FocusWindow(Asset.Get());
				}
				else
				{
					EToolkitMode::Type Mode = EditWithinLevelEditor.IsValid() ? EToolkitMode::WorldCentric : EToolkitMode::Standalone;
					TSharedPtr<IToolkitHost> EditWithInEditor = EditWithinLevelEditor.IsValid()? EditWithinLevelEditor.Pin() : NULL;
					FPersonaModule& PersonaModule = FModuleManager::LoadModuleChecked<FPersonaModule>("Persona");
					PersonaModule.CreatePersona(Mode, EditWithInEditor, NewSkeleton, NULL, Cast<UAnimationAsset>(Asset.Get()), NULL);
				}
			}
		}
	}
	else
	{
		FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("FailedToLoadSkeletonlessAnimAsset", "The Anim Asset could not be loaded because it's skeleton is missing."));
	}
}
开发者ID:PopCap,项目名称:GameIdea,代码行数:32,代码来源:AssetTypeActions_AnimationAsset.cpp

示例2: Tick

void FDistanceFieldBuildNotificationImpl::Tick(float DeltaTime) 
{
	if (GDistanceFieldAsyncQueue)
	{
		// Trigger a new notification if we are doing an async build, and we haven't displayed the notification recently
		if (GDistanceFieldAsyncQueue->GetNumOutstandingTasks() > 0
			&& !DistanceFieldNotificationPtr.IsValid()
			&& (FPlatformTime::Seconds() - LastEnableTime) > 5)
		{
			DistanceFieldBuildStarted();
		}
		// Disable the notification when we are no longer doing an async compile
		else if (GDistanceFieldAsyncQueue->GetNumOutstandingTasks() == 0 && DistanceFieldNotificationPtr.IsValid())
		{
			DistanceFieldBuildFinished();
		}
		else if (GDistanceFieldAsyncQueue->GetNumOutstandingTasks() > 0 && DistanceFieldNotificationPtr.IsValid())
		{
			TSharedPtr<SNotificationItem> NotificationItem = DistanceFieldNotificationPtr.Pin();

			if (NotificationItem.IsValid())
			{
				FFormatNamedArguments Args;
				Args.Add( TEXT("BuildTasks"), FText::AsNumber( GDistanceFieldAsyncQueue->GetNumOutstandingTasks() ) );
				FText ProgressMessage = FText::Format(NSLOCTEXT("DistanceFieldBuild", "DistanceFieldBuildInProgressFormat", "Building Mesh Distance Fields ({BuildTasks})"), Args);

				NotificationItem->SetText( ProgressMessage );
			}
		}
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:31,代码来源:DistanceFieldBuildNotification.cpp

示例3: GetCustomizationVisibility

EVisibility SMultiBoxWidget::GetCustomizationVisibility( TWeakPtr<const FMultiBlock> BlockWeakPtr, TWeakPtr<SWidget> BlockWidgetWeakPtr ) const
{
	if( MultiBox->IsInEditMode() && BlockWidgetWeakPtr.IsValid() && BlockWeakPtr.IsValid() && (!DragPreview.PreviewBlock.IsValid() || BlockWeakPtr.Pin() != DragPreview.PreviewBlock->GetActualBlock() ) )
	{
		// If in edit mode and this is not the block being dragged, the customization widget should be visible if the default block beging customized would have been visible
		return BlockWeakPtr.Pin()->GetAction().IsValid() && BlockWidgetWeakPtr.Pin()->GetVisibility() == EVisibility::Visible ? EVisibility::Visible : EVisibility::Collapsed;
	}
	else
	{
		return EVisibility::Collapsed;
	}
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:12,代码来源:MultiBox.cpp

示例4: IsExposedAsColumn

bool FPropertyEditorToolkit::IsExposedAsColumn( const TWeakPtr< IPropertyTreeRow >& Row ) const
{
	bool Result = false;

	if (Row.IsValid())
	{
		const TSharedPtr< FPropertyPath > RowPathPtr = Row.Pin()->GetPropertyPath();
		if ( RowPathPtr.IsValid() )
		{
			TSharedRef< FPropertyPath > TrimmedPath = RowPathPtr->TrimRoot( PropertyTable->GetRootPath()->GetNumProperties() );
			const TSet< TSharedRef< IPropertyTableRow > > SelectedRows = PropertyTable->GetSelectedRows();

			for( auto RowIter = SelectedRows.CreateConstIterator(); RowIter; ++RowIter )
			{
				TrimmedPath = TrimmedPath->TrimRoot( (*RowIter)->GetPartialPath()->GetNumProperties() );
				break;
			}

			for (int Index = 0; Index < PropertyPathsAddedAsColumns.Num(); Index++)
			{
				if ( FPropertyPath::AreEqual( TrimmedPath, PropertyPathsAddedAsColumns[ Index ] ) )
				{
					Result = true;
					break;
				}
			}
		}
	}

	return Result;
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:31,代码来源:PropertyEditorToolkit.cpp

示例5: OnNodePlacement

/**
 * An analytics hook, for tracking when a node was spawned from the palette 
 * (updates the "node creation stats" with a palette drag-placement flag).
 * 
 * @param  BlueprintEditorPtr	A pointer to the blueprint editor currently being worked in.
 */
static void OnNodePlacement(TWeakPtr<FBlueprintEditor> BlueprintEditorPtr)
{
	if( BlueprintEditorPtr.IsValid() )
	{
		BlueprintEditorPtr.Pin()->UpdateNodeCreationStats( ENodeCreateAction::PaletteDragPlacement );
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:13,代码来源:SBlueprintSubPalette.cpp

示例6: Tick

//------------------------------------------------------------------------------
void FFauxStandaloneToolManager::Tick(float DeltaTime)
{
	if (MainEditorWindow.IsValid())
	{	
		FSlateApplication& WindowManager = FSlateApplication::Get();
		TArray< TSharedRef<SWindow> > ActiveWindows = WindowManager.GetInteractiveTopLevelWindows();

		bool bVisibleWindowFound = false;
		for (TSharedRef<SWindow> Window : ActiveWindows)
		{
			if (Window->IsVisible())
			{
				bVisibleWindowFound = true;
				break;
			}
		}

		if (!bVisibleWindowFound)
		{
			EditorCommandLineUtilsImpl::ForceCloseEditor();
		}
	}
	else
	{
		EditorCommandLineUtilsImpl::ForceCloseEditor();
	}
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:28,代码来源:EditorCommandLineUtils.cpp

示例7: Disable

//------------------------------------------------------------------------------
void FFauxStandaloneToolManager::Disable()
{
	if (MainEditorWindow.IsValid())
	{
		MainEditorWindow.Pin()->ShowWindow();
	}
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:8,代码来源:EditorCommandLineUtils.cpp

示例8: Tag

FGameplayTagNode::FGameplayTagNode(FName InTag, TWeakPtr<FGameplayTagNode> InParentNode, FText InCategoryDescription)
	: Tag(InTag)
	, CompleteTag(NAME_None)
	, CategoryDescription(InCategoryDescription)
	, ParentNode(InParentNode)
{
	TArray<FName> Tags;

	Tags.Add(InTag);

	TWeakPtr<FGameplayTagNode> CurNode = InParentNode;
	while (CurNode.IsValid())
	{
		Tags.Add(CurNode.Pin()->GetSimpleTag());
		CurNode = CurNode.Pin()->GetParentTagNode();
	}

	FString CompleteTagString;
	for (int32 TagIdx = Tags.Num() - 1; TagIdx >= 0; --TagIdx)
	{
		CompleteTagString += Tags[TagIdx].ToString();
		if (TagIdx > 0)
		{
			CompleteTagString += TEXT(".");
		}
	}

	CompleteTag = FName(*CompleteTagString);
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:29,代码来源:GameplayTagsManager.cpp

示例9: IsNodeTitleVisible

bool SGraphPanel::IsNodeTitleVisible(const class UEdGraphNode* Node, bool bRequestRename)
{
	bool bTitleVisible = false;
	TSharedRef<SNode>* pWidget = NodeToWidgetLookup.Find(Node);

	if (pWidget != NULL)
	{
		TWeakPtr<SGraphNode> GraphNode = StaticCastSharedRef<SGraphNode>(*pWidget);
		if(GraphNode.IsValid() && !HasMouseCapture())
		{
			FSlateRect TitleRect = GraphNode.Pin()->GetTitleRect();
			const FVector2D TopLeft = FVector2D( TitleRect.Left, TitleRect.Top );
			const FVector2D BottomRight = FVector2D( TitleRect.Right, TitleRect.Bottom );

			if( IsRectVisible( TopLeft, BottomRight ))
			{
				bTitleVisible = true;
			}
			else if( bRequestRename )
			{
				bTitleVisible = JumpToRect( TopLeft, BottomRight );
			}

			if( bTitleVisible && bRequestRename )
			{
				GraphNode.Pin()->RequestRename();
				SelectAndCenterObject(Node, false);
			}
		}
	}
	return bTitleVisible;
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:32,代码来源:SGraphPanel.cpp

示例10: MakeShareable

//------------------------------------------------------------------------------
TSharedPtr<FGraphActionNode> FGraphActionNode::NewGroupDividerNode(TWeakPtr<FGraphActionNode> Parent, int32 Grouping)
{
	FGraphActionNode* DividerNode = new FGraphActionNode(Grouping, INVALID_SECTION_ID);
	DividerNode->ParentNode = Parent;
	checkSlow(Parent.IsValid());

	return MakeShareable(DividerNode);
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:9,代码来源:GraphActionNode.cpp

示例11: OnCreateTrackTextEntry

void UMatineeTrackVectorPropHelper::OnCreateTrackTextEntry(const FString& ChosenText, TWeakPtr<SWindow> Window, FString* OutputString)
{
	*OutputString = ChosenText;
	if( Window.IsValid() )
	{
		Window.Pin()->RequestDestroyWindow();
	}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:8,代码来源:MatineeTrackHelpers.cpp

示例12: OnToggleColumnClicked

FReply FPropertyEditorToolkit::OnToggleColumnClicked( const TWeakPtr< IPropertyTreeRow > Row )
{
	if (Row.IsValid())
	{
		ToggleColumnForProperty( Row.Pin()->GetPropertyPath() );
	}

	return FReply::Handled();
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:9,代码来源:PropertyEditorToolkit.cpp

示例13: OnLightMapListMouseButtonDoubleClick

FReply FLightmapCustomNodeBuilder::OnLightMapListMouseButtonDoubleClick(const FGeometry& MyGeom, const FPointerEvent& PointerEvent, TWeakPtr<FLightmapItem> SelectedLightmap)
{
	if ( ensure(SelectedLightmap.IsValid()) )
	{
		ExecuteViewLightmap(SelectedLightmap.Pin()->ObjectPath);
	}

	return FReply::Handled();
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:9,代码来源:WorldSettingsDetails.cpp

示例14: OnMouseButtonDown

FReply STimelineLabelAnchor::OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
	if (MouseEvent.GetEffectingButton() == EKeys::RightMouseButton && TimelineOwner.IsValid() && TimelineOwner.Pin()->IsSelected())
	{
		SetIsOpen(!IsOpen());
		return FReply::Handled();
	}
	return FReply::Unhandled();
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:9,代码来源:SVisualLoggerTimeline.cpp

示例15: GetPinColorAndOpacity

FSlateColor FPropertyEditorToolkit::GetPinColorAndOpacity( const TWeakPtr< IPropertyTreeRow > Row ) const
{
	if ( Row.IsValid() && ( Row.Pin()->IsCursorHovering() || IsExposedAsColumn( Row ) ) )
	{
		return FSlateColor( FLinearColor::White );
	}

	return PinColor;
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:9,代码来源:PropertyEditorToolkit.cpp


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