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


C++ TSharedRef::GetChildNodes方法代码示例

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


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

示例1: FindWidgetsUnderPoint

			static bool FindWidgetsUnderPoint(const FVector2D& InHitTestPoint, const FVector2D& InWindowPosition, const TSharedRef<FWidgetReflectorNodeBase>& InWidget, TArray<TSharedRef<FWidgetReflectorNodeBase>>& OutWidgets)
			{
				const bool bNeedsHitTesting = InWidget->GetHitTestInfo().IsHitTestVisible || InWidget->GetHitTestInfo().AreChildrenHitTestVisible;
				if (bNeedsHitTesting)
				{
					const FSlateRect HitTestRect = FSlateRect::FromPointAndExtent(
						InWidget->GetAccumulatedLayoutTransform().GetTranslation() - InWindowPosition, 
						TransformPoint(InWidget->GetAccumulatedLayoutTransform().GetScale(), InWidget->GetLocalSize())
						);

					if (HitTestRect.ContainsPoint(InHitTestPoint))
					{
						OutWidgets.Add(InWidget);

						if (InWidget->GetHitTestInfo().AreChildrenHitTestVisible)
						{
							for (const auto& ChildWidget : InWidget->GetChildNodes())
							{
								if (FindWidgetsUnderPoint(InHitTestPoint, InWindowPosition, ChildWidget, OutWidgets))
								{
									return true;
								}
							}
						}

						return InWidget->GetHitTestInfo().IsHitTestVisible;
					}
				}

				return false;
			}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:31,代码来源:SWidgetSnapshotVisualizer.cpp

示例2: GenerateLayoutNodeWidgetsRecursive

void SSequencerTrackArea::GenerateLayoutNodeWidgetsRecursive( const TArray< TSharedRef<FSequencerDisplayNode> >& Nodes )
{
	for( int32 NodeIndex = 0; NodeIndex < Nodes.Num(); ++NodeIndex )
	{
		TSharedRef<FSequencerDisplayNode> Node = Nodes[NodeIndex];

		// The section area encompasses multiple logical child nodes so we do not generate children that arent section areas (they would not be top level nodes in that case)
		if( Node->GetType() == ESequencerNode::Track )
		{
			GenerateWidgetForNode( Node );	

			GenerateLayoutNodeWidgetsRecursive( Node->GetChildNodes() );
		}
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:15,代码来源:SSequencerTrackArea.cpp

示例3: GenerateWidgetForNode

void SAnimationOutlinerView::GenerateWidgetForNode( TSharedRef<FSequencerDisplayNode>& InLayoutNode )
{
	Children.Add( 
		SNew( SAnimationOutlinerTreeNode, InLayoutNode)
		.OnSelectionChanged( this, &SAnimationOutlinerView::OnSelectionChanged )
		);

	// Object nodes do not generate widgets for their children
	if( InLayoutNode->GetType() != ESequencerNode::Object )
	{
		const TArray< TSharedRef<FSequencerDisplayNode> >& ChildNodes = InLayoutNode->GetChildNodes();
		
		for( int32 ChildIndex = 0; ChildIndex < ChildNodes.Num(); ++ChildIndex )
		{
			TSharedRef<FSequencerDisplayNode> ChildNode = ChildNodes[ChildIndex];
			GenerateWidgetForNode( ChildNode );
		}
	}
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:19,代码来源:SAnimationOutlinerView.cpp

示例4: FilterNodesRecursive

/**
 * Recursively filters nodes
 *
 * @param StartNode			The node to start from
 * @param FilterStrings		The filter strings which need to be matched
 * @param OutFilteredNodes	The list of all filtered nodes
 */
static bool FilterNodesRecursive( const TSharedRef<FSequencerDisplayNode>& StartNode, const TArray<FString>& FilterStrings, TSet< TSharedRef< const FSequencerDisplayNode> >& OutFilteredNodes )
{
	// Assume the filter is acceptable
	bool bFilterAcceptable = true;

	// Check each string in the filter strings list against 
	for (int32 TestNameIndex = 0; TestNameIndex < FilterStrings.Num(); ++TestNameIndex)
	{
		const FString& TestName = FilterStrings[TestNameIndex];

		if ( !StartNode->GetDisplayName().ToString().Contains( TestName ) ) 
		{
			bFilterAcceptable = false;
			break;
		}
	}

	// Whether or the start node is in the filter
	bool bInFilter = false;

	if( bFilterAcceptable )
	{
		// This node is now filtered
		OutFilteredNodes.Add( StartNode );
		bInFilter = true;
	}

	// Check each child node to determine if it is filtered
	const TArray< TSharedRef<FSequencerDisplayNode> >& ChildNodes = StartNode->GetChildNodes();
	for( int32 ChildIndex = 0; ChildIndex < ChildNodes.Num(); ++ChildIndex )
	{
		// Mark the parent as filtered if any child node was filtered
		bFilterAcceptable |= FilterNodesRecursive( ChildNodes[ChildIndex], FilterStrings, OutFilteredNodes );
		if( bFilterAcceptable && !bInFilter )
		{
			OutFilteredNodes.Add( StartNode );
			bInFilter = true;
		}
	}

	return bFilterAcceptable;
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:49,代码来源:SequencerNodeTree.cpp

示例5: Update

void SSequencerTrackArea::Update( TSharedPtr<FSequencerNodeTree> InSequencerNodeTree )
{
	ScrollBox->ClearChildren();

	const TArray< TSharedRef<FSequencerDisplayNode> >& RootNodes = InSequencerNodeTree->GetRootNodes();

	for( int32 RootNodeIndex = 0; RootNodeIndex < RootNodes.Num(); ++RootNodeIndex )
	{
		TSharedRef<FSequencerDisplayNode> RootNode = RootNodes[RootNodeIndex];

		// Generate a widget for each root node
		GenerateWidgetForNode( RootNode );

		// Generate a node for each children of the root node
		GenerateLayoutNodeWidgetsRecursive( RootNode->GetChildNodes() );
	}

	// @todo Sequencer - Remove this expensive operation
	ScrollBox->SlatePrepass();

	CurveEditor->SetSequencerNodeTree(InSequencerNodeTree);
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:22,代码来源:SSequencerTrackArea.cpp


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