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


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

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


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

示例1: SNew

TSharedPtr< SWidget > FConfigPropertyCustomColumn::CreateColumnLabel(const TSharedRef< IPropertyTableColumn >& Column, const TSharedRef< IPropertyTableUtilities >& Utilities, const FName& Style) const
{
	if (Column->GetDataSource()->IsValid())
	{
		TSharedPtr< FPropertyPath > PropertyPath = Column->GetDataSource()->AsPropertyPath();
		if (PropertyPath.IsValid() && PropertyPath->GetNumProperties() > 0)
		{
			return SNew(STextBlock)
				.Text(EditProperty->GetDisplayNameText());
		}
	}
	return SNullWidget::NullWidget;
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:13,代码来源:ConfigPropertyColumn.cpp

示例2: GetObjectPropertyNode

TSharedRef< FObjectPropertyNode > FPropertyTable::GetObjectPropertyNode( const TSharedRef< IPropertyTableColumn >& Column, const TSharedRef< IPropertyTableRow >& Row ) 
{
	TWeakObjectPtr< UObject > Object;
	if( Orientation == EPropertyTableOrientation::AlignPropertiesInColumns )
	{
		Object = Row->GetDataSource()->AsUObject();
	}
	else
	{
		Object = Column->GetDataSource()->AsUObject();
	}

	return GetObjectPropertyNode( Object );
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:14,代码来源:PropertyTable.cpp

示例3: Supports

bool FConfigPropertyCustomColumn::Supports(const TSharedRef< IPropertyTableColumn >& Column, const TSharedRef< IPropertyTableUtilities >& Utilities) const
{
	bool IsSupported = false;

	if (Column->GetDataSource()->IsValid())
	{
		TSharedPtr< FPropertyPath > PropertyPath = Column->GetDataSource()->AsPropertyPath();
		if (PropertyPath.IsValid() && PropertyPath->GetNumProperties() > 0)
		{
			const FPropertyInfo& PropertyInfo = PropertyPath->GetRootProperty();
			UProperty* Property = PropertyInfo.Property.Get();
			IsSupported = Property->GetFName() == TEXT("ExternalProperty");
		}
	}

	return IsSupported;
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:17,代码来源:ConfigPropertyColumn.cpp

示例4: Supports

bool FDeviceProfileTextureLODSettingsColumn::Supports(const TSharedRef< IPropertyTableColumn >& Column, const TSharedRef< IPropertyTableUtilities >& Utilities) const
{
	if( Column->GetDataSource()->IsValid() )
	{
		TSharedPtr< FPropertyPath > PropertyPath = Column->GetDataSource()->AsPropertyPath();
		if( PropertyPath.IsValid() && PropertyPath->GetNumProperties() > 0 )
		{
			const FPropertyInfo& PropertyInfo = PropertyPath->GetRootProperty();
			UProperty* Property = PropertyInfo.Property.Get();
			if (Property->GetName() == TEXT("TextureLODGroups") && Property->IsA(UArrayProperty::StaticClass()))
			{
				return true;
			}
		}
	}

	return false;
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:18,代码来源:DeviceProfileTextureLODSettingsColumn.cpp

示例5: Supports

bool FCustomFontColumn::Supports( const TSharedRef< IPropertyTableColumn >& Column, const TSharedRef< IPropertyTableUtilities >& Utilities ) const
{
	bool IsSupported = false;
	
	if( Column->GetDataSource()->IsValid() )
	{
		TSharedPtr< FPropertyPath > PropertyPath = Column->GetDataSource()->AsPropertyPath();
		if( PropertyPath.IsValid() && PropertyPath->GetNumProperties() > 0 )
		{
			const FPropertyInfo& PropertyInfo = PropertyPath->GetRootProperty();
			UProperty* Property = PropertyInfo.Property.Get();
			if (SupportedProperties.Contains(Property))
			{
				IsSupported = true;
			}
		}
	}

	return IsSupported;
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:20,代码来源:CustomFontColumn.cpp

示例6: GetSelectedObjects

void FPropertyTable::GetSelectedObjects( TArray< TWeakObjectPtr< UObject > >& OutSelectedObjects) const
{
	for( auto RowIter = SelectedRows.CreateConstIterator(); RowIter; ++RowIter )
	{
		const TSharedRef< IPropertyTableRow > Row = *RowIter;
		const TWeakObjectPtr< UObject > Object = Row->GetDataSource()->AsUObject();

		if ( Object.IsValid() )
		{
			OutSelectedObjects.Add( Object );
		}
	}
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:13,代码来源:PropertyTable.cpp

示例7: ToggleColumnForProperty

void FPropertyEditorToolkit::ToggleColumnForProperty( const TSharedPtr< FPropertyPath >& PropertyPath )
{
	if ( !PropertyPath.IsValid() )
	{
		return;
	}

	TSharedRef< FPropertyPath > NewPath = PropertyPath->TrimRoot( PropertyTable->GetRootPath()->GetNumProperties() );
	const TSet< TSharedRef< IPropertyTableRow > > SelectedRows = PropertyTable->GetSelectedRows();
	
	for( auto RowIter = SelectedRows.CreateConstIterator(); RowIter; ++RowIter )
	{
		NewPath = NewPath->TrimRoot( (*RowIter)->GetPartialPath()->GetNumProperties() );
		break;
	}

	if ( NewPath->GetNumProperties() == 0 )
	{
		return;
	}

	TSharedPtr< IPropertyTableColumn > ExistingColumn;
	for( auto ColumnIter = PropertyTable->GetColumns().CreateConstIterator(); ColumnIter; ++ColumnIter )
	{
		TSharedRef< IPropertyTableColumn > Column = *ColumnIter;
		const TSharedPtr< FPropertyPath > Path = Column->GetDataSource()->AsPropertyPath();

		if ( Path.IsValid() && FPropertyPath::AreEqual( Path.ToSharedRef(), NewPath ) )
		{
			ExistingColumn = Column;
		}
	}

	if ( ExistingColumn.IsValid() )
	{
		PropertyTable->RemoveColumn( ExistingColumn.ToSharedRef() );
		const TSharedRef< FPropertyPath > ColumnPath = ExistingColumn->GetDataSource()->AsPropertyPath().ToSharedRef();
		for (int Index = PropertyPathsAddedAsColumns.Num() - 1; Index >= 0 ; Index--)
		{
			if ( FPropertyPath::AreEqual( ColumnPath, PropertyPathsAddedAsColumns[ Index ] ) )
			{
				PropertyPathsAddedAsColumns.RemoveAt( Index );
			}
		}
	}
	else
	{
		PropertyTable->AddColumn( NewPath );
		PropertyPathsAddedAsColumns.Add( NewPath );
	}
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:51,代码来源:PropertyEditorToolkit.cpp

示例8: RemoveRow

void FPropertyTable::RemoveRow( const TSharedRef< class IPropertyTableRow >& Row )
{
	//@todo Consider encapsulating the logic for this check [12/7/2012 Justin.Sargent]
	if ( !Row->HasChildren() && !Row->GetDataSource()->AsPropertyPath().IsValid() )
	{
		const TWeakObjectPtr< UObject > Object = Row->GetDataSource()->AsUObject();
		SourceObjectPropertyNodes.Remove( Object );

		if ( !Object.IsValid() )
		{
			PurgeInvalidObjectNodes();
		}
	}

	// Update the selection to exclude cells in the row we are removing
	TSet<TSharedRef<IPropertyTableCell>> NewSelectedCells;
	for(const TSharedRef<IPropertyTableCell>& CurrentSelectedCell : SelectedCells)
	{
		if(CurrentSelectedCell->GetRow() != Row)
		{
			NewSelectedCells.Add(CurrentSelectedCell);
		}
	}

	Rows.Remove( Row );
	RowsChanged.Broadcast();

	for( const TSharedRef< IPropertyTableColumn >& Column : Columns )
	{
		Column->RemoveCellsForRow( Row );
	}

	if(NewSelectedCells.Num() != SelectedCells.Num())
	{
		SetSelectedCells(NewSelectedCells);
	}
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:37,代码来源:PropertyTable.cpp

示例9: TableColumnsChanged

void FPropertyEditorToolkit::TableColumnsChanged()
{
	PropertyPathsAddedAsColumns.Empty();

	for( auto ColumnIter = PropertyTable->GetColumns().CreateConstIterator(); ColumnIter; ++ColumnIter )
	{
		TSharedRef< IPropertyTableColumn > Column = *ColumnIter;
		TSharedPtr< FPropertyPath > ColumnPath = Column->GetDataSource()->AsPropertyPath();

		if ( ColumnPath.IsValid() && ColumnPath->GetNumProperties() > 0 )
		{
			PropertyPathsAddedAsColumns.Add( ColumnPath.ToSharedRef() );
		}
	}
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:15,代码来源:PropertyEditorToolkit.cpp

示例10: SetMappingMethodOnSelectedComponents

void FStaticMeshLightingInfoStatsPage::SetMappingMethodOnSelectedComponents(TWeakPtr<IStatsViewer> InParentStatsViewer, bool bInTextureMapping, int32 InStaticLightingResolution) const
{
	if(InParentStatsViewer.IsValid())
	{
		const FScopedBusyCursor BusyCursor;

		// first get the selected objects in the table
		TArray<UStaticMeshLightingInfo*> SelectedObjects;
		TSharedPtr<IPropertyTable> PropertyTable = InParentStatsViewer.Pin()->GetPropertyTable();
		const TSet< TSharedRef<IPropertyTableRow> >& Rows = PropertyTable->GetSelectedRows();
		for(auto RowIt = Rows.CreateConstIterator(); RowIt; ++RowIt)
		{
			TSharedRef<IPropertyTableRow> Row = *RowIt;
			UStaticMeshLightingInfo* Entry = Cast<UStaticMeshLightingInfo>( Row->GetDataSource()->AsUObject().Get() );
			SelectedObjects.Add(Entry);
		}

		if (SelectedObjects.Num() > 0)
		{
			const FScopedTransaction Transaction( LOCTEXT("StaticMeshLightingInfoSet", "DlgStaticMeshLightingInfo:Set") );

			bool bRefresh = false;
			for (int32 CompIdx = 0; CompIdx < SelectedObjects.Num(); CompIdx++)
			{
				UStaticMeshLightingInfo* Entry = SelectedObjects[CompIdx];
				if (Entry->StaticMeshActor.IsValid())
				{
					Entry->StaticMeshActor->Modify();
				}
				if ( Entry->StaticMeshComponent.IsValid())
				{
					Entry->StaticMeshComponent->Modify();
					Entry->StaticMeshComponent->SetStaticLightingMapping(bInTextureMapping, InStaticLightingResolution);
					Entry->StaticMeshComponent->InvalidateLightingCache();
					Entry->StaticMeshComponent->ReregisterComponent();
				}
			
				bRefresh = true;
			}

			if (bRefresh)
			{
				InParentStatsViewer.Pin()->Refresh();
			}
		}
	}
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:47,代码来源:StaticMeshLightingInfoStatsPage.cpp

示例11: Refresh

void FPropertyTableCell::Refresh()
{
	const TSharedRef< IPropertyTableColumn > ColumnRef = Column.Pin().ToSharedRef();
	const TSharedRef< IPropertyTableRow > RowRef = Row.Pin().ToSharedRef();

	bIsBound = false;
	ObjectNode = GetTable()->GetObjectPropertyNode( ColumnRef, RowRef );

	if ( !ObjectNode.IsValid() )
	{
		return;
	}

	TSharedRef< IDataSource > ColumnBoundData = ColumnRef->GetDataSource();
	TSharedRef< IDataSource > RowBoundData = RowRef->GetDataSource();

	if ( !ColumnBoundData->IsValid() || !RowBoundData->IsValid() )
	{
		return;
	}

	TSharedPtr< FPropertyPath > PropertyPath;
	TWeakObjectPtr< UObject > Item;

	Item = ColumnBoundData->AsUObject();
	if ( !Item.IsValid() )
	{
		Item = RowBoundData->AsUObject();
	}

	if ( !Item.IsValid() )
	{
		// Must have a valid non-UProperty UObject bound to the column or row
		return;
	}

	PropertyPath = ColumnBoundData->AsPropertyPath();
	if ( !PropertyPath.IsValid() )
	{
		PropertyPath = RowBoundData->AsPropertyPath();
	}

	if ( !PropertyPath.IsValid() )
	{
		// By this point a valid PropertyPath must have been found or created
		return;
	}

	PropertyNode = FPropertyNode::FindPropertyNodeByPath( GetTable()->GetRootPath(), ObjectNode.ToSharedRef() );

	if ( !PropertyNode.IsValid() )
	{
		return;
	}

	PropertyNode = FPropertyNode::FindPropertyNodeByPath( RowRef->GetPartialPath(), PropertyNode.ToSharedRef() );

	if ( !PropertyNode.IsValid() )
	{
		return;
	}

	PropertyNode = FPropertyNode::FindPropertyNodeByPath( ColumnRef->GetPartialPath(), PropertyNode.ToSharedRef() );

	if ( !PropertyNode.IsValid() )
	{
		return;
	}

	PropertyNode = FPropertyNode::FindPropertyNodeByPath( PropertyPath, PropertyNode.ToSharedRef() );

	if ( PropertyNode.IsValid() )
	{
		bIsBound = true;
		PropertyEditor = FPropertyEditor::Create( PropertyNode.ToSharedRef(), GetTable() );
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:77,代码来源:PropertyTableCell.cpp


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