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


C++ TSharedPtr::AsCategoryNode方法代码示例

本文整理汇总了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;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:58,代码来源:DetailItemNode.cpp

示例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;
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:49,代码来源:DetailItemNode.cpp


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