本文整理汇总了C++中TSharedPtr::AsObjectNode方法的典型用法代码示例。如果您正苦于以下问题:C++ TSharedPtr::AsObjectNode方法的具体用法?C++ TSharedPtr::AsObjectNode怎么用?C++ TSharedPtr::AsObjectNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSharedPtr
的用法示例。
在下文中一共展示了TSharedPtr::AsObjectNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GenerateChildrenForPropertyNode
void FDetailPropertyRow::GenerateChildrenForPropertyNode( TSharedPtr<FPropertyNode>& RootPropertyNode, FDetailNodeList& OutChildren )
{
// Children should be disabled if we are disabled
TAttribute<bool> ParentEnabledState = CustomIsEnabledAttrib;
if( IsParentEnabled.IsBound() || HasEditCondition() )
{
// Bind a delegate to the edit condition so our children will be disabled if the edit condition fails
ParentEnabledState.Bind( this, &FDetailPropertyRow::GetEnabledState );
}
if( PropertyTypeLayoutBuilder.IsValid() && bShowCustomPropertyChildren )
{
const TArray< FDetailLayoutCustomization >& ChildRows = PropertyTypeLayoutBuilder->GetChildCustomizations();
for( int32 ChildIndex = 0; ChildIndex < ChildRows.Num(); ++ChildIndex )
{
TSharedRef<FDetailItemNode> ChildNodeItem = MakeShareable( new FDetailItemNode( ChildRows[ChildIndex], ParentCategory.Pin().ToSharedRef(), ParentEnabledState ) );
ChildNodeItem->Initialize();
OutChildren.Add( ChildNodeItem );
}
}
else if (bShowCustomPropertyChildren || !CustomPropertyWidget.IsValid() )
{
TSharedRef<FDetailCategoryImpl> ParentCategoryRef = ParentCategory.Pin().ToSharedRef();
IDetailLayoutBuilder& LayoutBuilder = ParentCategoryRef->GetParentLayout();
UProperty* ParentProperty = RootPropertyNode->GetProperty();
const bool bStructProperty = ParentProperty && ParentProperty->IsA<UStructProperty>();
for( int32 ChildIndex = 0; ChildIndex < RootPropertyNode->GetNumChildNodes(); ++ChildIndex )
{
TSharedPtr<FPropertyNode> ChildNode = RootPropertyNode->GetChildNode(ChildIndex);
if( ChildNode.IsValid() && ChildNode->HasNodeFlags( EPropertyNodeFlags::IsCustomized ) == 0 )
{
if( ChildNode->AsObjectNode() )
{
// Skip over object nodes and generate their children. Object nodes are not visible
GenerateChildrenForPropertyNode( ChildNode, OutChildren );
}
// Only struct children can have custom visibility that is different from their parent.
else if ( !bStructProperty || LayoutBuilder.IsPropertyVisible( FPropertyAndParent(*ChildNode->GetProperty(), ParentProperty ) ) )
{
FDetailLayoutCustomization Customization;
Customization.PropertyRow = MakeShareable( new FDetailPropertyRow( ChildNode, ParentCategoryRef ) );
TSharedRef<FDetailItemNode> ChildNodeItem = MakeShareable( new FDetailItemNode( Customization, ParentCategoryRef, ParentEnabledState ) );
ChildNodeItem->Initialize();
OutChildren.Add( ChildNodeItem );
}
}
}
}
}
示例2: IsCategoryHiddenByClass
bool SDetailsView::IsCategoryHiddenByClass( const TSharedPtr<FComplexPropertyNode>& InRootNode, FName CategoryName ) const
{
return InRootNode->AsObjectNode()->GetHiddenCategories().Contains( CategoryName );
}