本文整理汇总了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."));
}
}
示例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 );
}
}
}
}
示例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;
}
}
示例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;
}
示例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 );
}
}
示例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();
}
}
示例7: Disable
//------------------------------------------------------------------------------
void FFauxStandaloneToolManager::Disable()
{
if (MainEditorWindow.IsValid())
{
MainEditorWindow.Pin()->ShowWindow();
}
}
示例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);
}
示例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;
}
示例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);
}
示例11: OnCreateTrackTextEntry
void UMatineeTrackVectorPropHelper::OnCreateTrackTextEntry(const FString& ChosenText, TWeakPtr<SWindow> Window, FString* OutputString)
{
*OutputString = ChosenText;
if( Window.IsValid() )
{
Window.Pin()->RequestDestroyWindow();
}
}
示例12: OnToggleColumnClicked
FReply FPropertyEditorToolkit::OnToggleColumnClicked( const TWeakPtr< IPropertyTreeRow > Row )
{
if (Row.IsValid())
{
ToggleColumnForProperty( Row.Pin()->GetPropertyPath() );
}
return FReply::Handled();
}
示例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();
}
示例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();
}
示例15: GetPinColorAndOpacity
FSlateColor FPropertyEditorToolkit::GetPinColorAndOpacity( const TWeakPtr< IPropertyTreeRow > Row ) const
{
if ( Row.IsValid() && ( Row.Pin()->IsCursorHovering() || IsExposedAsColumn( Row ) ) )
{
return FSlateColor( FLinearColor::White );
}
return PinColor;
}