本文整理汇总了C++中TSharedPtr::AddChildRecursively方法的典型用法代码示例。如果您正苦于以下问题:C++ TSharedPtr::AddChildRecursively方法的具体用法?C++ TSharedPtr::AddChildRecursively怎么用?C++ TSharedPtr::AddChildRecursively使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSharedPtr
的用法示例。
在下文中一共展示了TSharedPtr::AddChildRecursively方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddChildRecursively
//------------------------------------------------------------------------------
void FGraphActionNode::AddChildRecursively(TArray<FString>& CategoryStack, TSharedPtr<FGraphActionNode> NodeToAdd)
{
if (CategoryStack.Num() > 0)
{
FString CategorySection = CategoryStack[0];
CategoryStack.RemoveAt(0, 1);
// make sure we don't already have a child that this can nest under
TSharedPtr<FGraphActionNode> ExistingNode = FindMatchingParent(CategorySection, NodeToAdd);
if (ExistingNode.IsValid())
{
ExistingNode->AddChildRecursively(CategoryStack, NodeToAdd);
}
else
{
TSharedPtr<FGraphActionNode> CategoryNode = NewCategoryNode(CategorySection, NodeToAdd->Grouping, NodeToAdd->SectionID);
InsertChild(CategoryNode);
CategoryNode->AddChildRecursively(CategoryStack, NodeToAdd);
}
}
else
{
InsertChild(NodeToAdd);
}
}
示例2: AddChildRecursively
//------------------------------------------------------------------------------
void FGraphActionNode::AddChildRecursively(TArray<FString>& CategoryStack, TSharedPtr<FGraphActionNode> NodeToAdd)
{
if (NodeToAdd->SectionID != INVALID_SECTION_ID)
{
TSharedPtr<FGraphActionNode> FoundSectionNode;
for ( TSharedPtr<FGraphActionNode> const& ChildNode : Children )
{
if ( NodeToAdd->SectionID == ChildNode->SectionID && ChildNode->IsSectionHeadingNode() )
{
FoundSectionNode = ChildNode;
break;
}
}
if ( FoundSectionNode.IsValid() )
{
FoundSectionNode->AddChildRecursively(CategoryStack, NodeToAdd);
return;
}
}
if ( CategoryStack.Num() > 0 )
{
FString CategorySection = CategoryStack[0];
CategoryStack.RemoveAt(0, 1);
// make sure we don't already have a child that this can nest under
TSharedPtr<FGraphActionNode> ExistingNode = FindMatchingParent(CategorySection, NodeToAdd);
if ( ExistingNode.IsValid() )
{
ExistingNode->AddChildRecursively(CategoryStack, NodeToAdd);
}
else
{
TSharedPtr<FGraphActionNode> CategoryNode = NewCategoryNode(CategorySection, NodeToAdd->Grouping, NodeToAdd->SectionID);
InsertChild(CategoryNode);
CategoryNode->AddChildRecursively(CategoryStack, NodeToAdd);
}
}
else
{
InsertChild(NodeToAdd);
}
}