示例#1
0
void
Group::GenerateCode(CodeTextCtrl *codectrl, Report *reportctrl) const
{
#if 0
	codectrl->Append(wxT("/*\n===========================================\nMembers:\n"));
	for (List<Member *>::Iterator i = MemberIterator(); !i; i++)
	{
		codectrl->Append(wxT("\t")).Append((*i)->GetName()).Append(wxT("\t")).Append((*i)->ToString()).Append(wxT("\n"));
	}
	codectrl->Append(wxT("Properties:\n"));
	for (List<Property *>::Iterator i = PropertyIterator(); !i; i++)
	{
		codectrl->Append(wxT("\t")).Append((*i)->GetName()).Append(wxT("\t")).Append((*i)->ToString()).Append(wxT("\n"));
	}
	codectrl->Append(wxT("Inputs:\n"));
	for (List<InputPort *>::Iterator i = InputIterator(); !i; i++)
	{
		codectrl->Append(wxT("\t")).Append((*i)->GetMember(wxT("Name"))->GetString()).Append(wxT("\n"));
	}
	codectrl->Append(wxT("Outputs:\n"));
	for (List<OutputPort *>::Iterator i = OutputIterator(); !i; i++)
	{
		codectrl->Append(wxT("\t")).Append((*i)->GetMember(wxT("Name"))->GetString()).Append(wxT("\n"));
	}
	codectrl->Append(wxT("===========================================\n*/\n"));
#endif
}
void GetKeyablePropertyPaths(UClass* Class, UStruct* PropertySource, TArray<UProperty*>& PropertyPath, FSequencer& Sequencer, TArray<TArray<UProperty*>>& KeyablePropertyPaths)
{
	//@todo need to resolve this between UMG and the level editor sequencer
	const bool bRecurseAllProperties = Sequencer.IsLevelEditorSequencer();

	for (TFieldIterator<UProperty> PropertyIterator(PropertySource); PropertyIterator; ++PropertyIterator)
	{
		UProperty* Property = *PropertyIterator;

		if (Property && !Property->HasAnyPropertyFlags(CPF_Deprecated))
		{
			PropertyPath.Add(Property);

			bool bIsPropertyKeyable = Sequencer.CanKeyProperty(FCanKeyPropertyParams(Class, PropertyPath));
			if (bIsPropertyKeyable)
			{
				KeyablePropertyPaths.Add(PropertyPath);
			}

			if (!bIsPropertyKeyable || bRecurseAllProperties)
			{
				UStructProperty* StructProperty = Cast<UStructProperty>(Property);
				if (StructProperty != nullptr)
				{
					GetKeyablePropertyPaths(Class, StructProperty->Struct, PropertyPath, Sequencer, KeyablePropertyPaths);
				}
			}

			PropertyPath.RemoveAt(PropertyPath.Num() - 1);
		}
	}
}
void GetMaterialBrushPropertyPathsRecursive(void* DataObject, UStruct* PropertySource, TArray<UProperty*>& PropertyPath, TArray<TArray<UProperty*>>& MaterialBrushPropertyPaths )
{
	if ( DataObject != nullptr )
	{
		for ( TFieldIterator<UProperty> PropertyIterator( PropertySource ); PropertyIterator; ++PropertyIterator )
		{
			UProperty* Property = *PropertyIterator;
			if ( Property != nullptr && Property->HasAnyPropertyFlags( CPF_Deprecated ) == false )
			{
				PropertyPath.Add( Property );

				UStructProperty* StructProperty = Cast<UStructProperty>( Property );
				if ( StructProperty != nullptr )
				{
					const FName StructName = StructProperty->Struct->GetFName();
					void* Data = Property->ContainerPtrToValuePtr<void>(DataObject);

					UMaterialInterface* MaterialInterface = nullptr;

					if(StructName == TMaterialStructType<FSlateFontInfo>::GetTypeName())
					{
						MaterialInterface = TMaterialStructType<FSlateFontInfo>::GetMaterial(Data);
					}
					else if(StructName == TMaterialStructType<FSlateBrush>::GetTypeName())
					{
						MaterialInterface =TMaterialStructType<FSlateBrush>::GetMaterial(Data);
					}
					else if(StructName == TMaterialStructType<FFontOutlineSettings>::GetTypeName())
					{
						MaterialInterface =TMaterialStructType<FFontOutlineSettings>::GetMaterial(Data);

					}

					if(MaterialInterface)
					{
						MaterialBrushPropertyPaths.Add(PropertyPath);
					}
					else
					{
						GetMaterialBrushPropertyPathsRecursive( StructProperty->ContainerPtrToValuePtr<void>( DataObject ), StructProperty->Struct, PropertyPath, MaterialBrushPropertyPaths );
					}
				}

				PropertyPath.RemoveAt( PropertyPath.Num() - 1 );
			}
		}
	}
}
FWidgetMaterialHandle GetPropertyValueByPath(void* DataObject, UStruct* PropertySource, const TArray<FName>& PropertyPath, int32 PathIndex )
{
	if ( DataObject != nullptr && PathIndex < PropertyPath.Num() )
	{
		for ( TFieldIterator<UProperty> PropertyIterator( PropertySource ); PropertyIterator; ++PropertyIterator )
		{
			UProperty* Property = *PropertyIterator;
			if ( Property != nullptr && Property->GetFName() == PropertyPath[PathIndex] )
			{
				// Only struct properties are relevant for the search.
				UStructProperty* StructProperty = Cast<UStructProperty>( Property );
				if ( StructProperty == nullptr )
				{
					return FWidgetMaterialHandle();
				}

				if ( PathIndex == PropertyPath.Num() - 1 )
				{
					const FName StructName = StructProperty->Struct->GetFName();
					if (StructName == TMaterialStructType<FSlateFontInfo>::GetTypeName() ||
						StructName == TMaterialStructType<FSlateBrush>::GetTypeName() ||
						StructName == TMaterialStructType<FFontOutlineSettings>::GetTypeName() )
					{
						FWidgetMaterialHandle Handle(StructName, StructProperty->ContainerPtrToValuePtr<void>(DataObject));
						return Handle;
					}
					else
					{
						return FWidgetMaterialHandle();
					}
				}
				else
				{
					return GetPropertyValueByPath(Property->ContainerPtrToValuePtr<void>( DataObject ), StructProperty->Struct, PropertyPath, PathIndex + 1 );
				}
			}
		}
	}
	return FWidgetMaterialHandle();
}
示例#5
0
/*************************************************************************
	Return a PropertySet::PropertyIterator object to iterate over the
	available Properties.
*************************************************************************/
PropertySet::PropertyIterator PropertySet::getIterator(void) const
{
	maybeAddUncommonProperties ( "getIterator" );
	return PropertyIterator(d_properties.begin(), d_properties.end());
}
示例#6
0
/*************************************************************************
	Return a PropertySet::PropertyIterator object to iterate over the
	available Properties.
*************************************************************************/
PropertySet::PropertyIterator PropertySet::getPropertyIterator(void) const
{
	return PropertyIterator(d_properties.begin(), d_properties.end());
}
	//---------------------------------------------------------------------
	PropertySet::PropertyIterator PropertySet::getPropertyIterator()
	{
		return PropertyIterator(mPropertyMap.begin(), mPropertyMap.end());
	}
示例#8
0
/**
 * @brief Returns an iterator for the list
 */
TreeEntry::PropertyIterator TreeEntry::propertyIterator() const
{
    return PropertyIterator(m_properties);
}