本文整理汇总了C++中TSharedPtr::AsCategoryNode方法的典型用法代码示例。如果您正苦于以下问题:C++ TSharedPtr::AsCategoryNode方法的具体用法?C++ TSharedPtr::AsCategoryNode怎么用?C++ TSharedPtr::AsCategoryNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSharedPtr
的用法示例。
在下文中一共展示了TSharedPtr::AsCategoryNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PassesAllFilters
static bool PassesAllFilters( const FDetailLayoutCustomization& InCustomization, const FDetailFilter& InFilter, const FString& InCategoryName )
{
struct Local
{
static bool StringPassesFilter(const FDetailFilter& InDetailFilter, const FString& InString)
{
// Make sure the passed string matches all filter strings
if( InString.Len() > 0 )
{
for (int32 TestNameIndex = 0; TestNameIndex < InDetailFilter.FilterStrings.Num(); ++TestNameIndex)
{
const FString& TestName = InDetailFilter.FilterStrings[TestNameIndex];
if ( !InString.Contains(TestName) )
{
return false;
}
}
return true;
}
return false;
}
};
bool bPassesAllFilters = true;
if( InFilter.FilterStrings.Num() > 0 || InFilter.bShowOnlyModifiedProperties == true || InFilter.bShowOnlyDiffering == true )
{
const bool bSearchFilterIsEmpty = InFilter.FilterStrings.Num() == 0;
TSharedPtr<FPropertyNode> PropertyNodePin = InCustomization.GetPropertyNode();
const bool bPassesCategoryFilter = !bSearchFilterIsEmpty && InFilter.bShowAllChildrenIfCategoryMatches ? Local::StringPassesFilter(InFilter, InCategoryName) : false;
bPassesAllFilters = false;
if( PropertyNodePin.IsValid() && !PropertyNodePin->AsCategoryNode() )
{
const bool bIsNotBeingFiltered = PropertyNodePin->HasNodeFlags(EPropertyNodeFlags::IsBeingFiltered) == 0;
const bool bIsSeenDueToFiltering = PropertyNodePin->HasNodeFlags(EPropertyNodeFlags::IsSeenDueToFiltering) != 0;
const bool bIsParentSeenDueToFiltering = PropertyNodePin->HasNodeFlags(EPropertyNodeFlags::IsParentSeenDueToFiltering) != 0;
const bool bPassesSearchFilter = bSearchFilterIsEmpty || ( bIsNotBeingFiltered || bIsSeenDueToFiltering || bIsParentSeenDueToFiltering );
const bool bPassesModifiedFilter = bPassesSearchFilter && ( InFilter.bShowOnlyModifiedProperties == false || PropertyNodePin->GetDiffersFromDefault() == true );
const bool bPassesDifferingFilter = InFilter.bShowOnlyDiffering ? InFilter.WhitelistedProperties.Find(*FPropertyNode::CreatePropertyPath(PropertyNodePin.ToSharedRef())) != nullptr : true;
// The property node is visible (note categories are never visible unless they have a child that is visible )
bPassesAllFilters = (bPassesSearchFilter && bPassesModifiedFilter && bPassesDifferingFilter) || bPassesCategoryFilter;
}
else if( InCustomization.HasCustomWidget() )
{
const bool bPassesTextFilter = Local::StringPassesFilter(InFilter, InCustomization.WidgetDecl->FilterTextString.ToString());
bPassesAllFilters = bPassesTextFilter || bPassesCategoryFilter;
}
}
return bPassesAllFilters;
}
示例2: PassesAllFilters
static bool PassesAllFilters( const FDetailLayoutCustomization& InCustomization, const FDetailFilter& InFilter )
{
bool bPassesAllFilters = true;
if( InFilter.FilterStrings.Num() > 0 || InFilter.bShowOnlyModifiedProperties == true || InFilter.bShowOnlyDiffering == true )
{
TSharedPtr<FPropertyNode> PropertyNodePin = InCustomization.GetPropertyNode();
bPassesAllFilters = false;
if( PropertyNodePin.IsValid() && !PropertyNodePin->AsCategoryNode() )
{
const bool bSearchFilterIsEmpty = InFilter.FilterStrings.Num() == 0;
const bool bIsNotBeingFiltered = PropertyNodePin->HasNodeFlags(EPropertyNodeFlags::IsBeingFiltered) == 0;
const bool bIsSeenDueToFiltering = PropertyNodePin->HasNodeFlags(EPropertyNodeFlags::IsSeenDueToFiltering) != 0;
const bool bIsParentSeenDueToFiltering = PropertyNodePin->HasNodeFlags(EPropertyNodeFlags::IsParentSeenDueToFiltering) != 0;
const bool bPassesSearchFilter = bSearchFilterIsEmpty || ( bIsNotBeingFiltered || bIsSeenDueToFiltering || bIsParentSeenDueToFiltering );
const bool bPassesModifiedFilter = bPassesSearchFilter && ( InFilter.bShowOnlyModifiedProperties == false || PropertyNodePin->GetDiffersFromDefault() == true );
const bool bPassesDifferingFilter = InFilter.bShowOnlyDiffering == false || InFilter.DifferingProperties.Find(PropertyNodePin->GetProperty()->GetFName()) != NULL;
// The property node is visible (note categories are never visible unless they have a child that is visible )
bPassesAllFilters = bPassesSearchFilter && bPassesModifiedFilter && bPassesDifferingFilter;
}
else if( InCustomization.HasCustomWidget() )
{
if( InFilter.FilterStrings.Num() > 0 && InCustomization.WidgetDecl->FilterTextString.Len() > 0 )
{
// We default to acceptable
bPassesAllFilters = true;
const FString& FilterMatch = InCustomization.WidgetDecl->FilterTextString;
// Make sure the filter match matches all filter strings
for (int32 TestNameIndex = 0; TestNameIndex < InFilter.FilterStrings.Num(); ++TestNameIndex)
{
const FString& TestName = InFilter.FilterStrings[TestNameIndex];
if ( !FilterMatch.Contains( TestName) )
{
bPassesAllFilters = false;
break;
}
}
}
}
}
return bPassesAllFilters;
}