void FScriptContextBase::PushScriptPropertyValues(UScriptBlueprintGeneratedClass* Class, const UObject* Obj)
{
	// @todo: optimize this
	for (auto Property : Class->ScriptProperties)
	{
		if (UFloatProperty* FloatProperty = Cast<UFloatProperty>(Property))
		{
			float Value = FloatProperty->GetFloatingPointPropertyValue(Property->ContainerPtrToValuePtr<float>(Obj));
			SetFloatProperty(Property->GetName(), Value);
		}
		else if (UIntProperty* IntProperty = Cast<UIntProperty>(Property))
		{
			int32 Value = IntProperty->GetSignedIntPropertyValue(Property->ContainerPtrToValuePtr<int32>(Obj));
			SetIntProperty(Property->GetName(), Value);
		}
		else if (UBoolProperty* BoolProperty = Cast<UBoolProperty>(Property))
		{
			bool Value = BoolProperty->GetPropertyValue(Property->ContainerPtrToValuePtr<void>(Obj));
			SetBoolProperty(Property->GetName(), Value);
		}
		else if (UObjectProperty* ObjectProperty = Cast<UObjectProperty>(Property))
		{
			UObject* Value = ObjectProperty->GetObjectPropertyValue(Property->ContainerPtrToValuePtr<UObject*>(Obj));
			SetObjectProperty(Property->GetName(), Value);
		}
		else if (UStrProperty* StringProperty = Cast<UStrProperty>(Property))
		{
			FString Value = StringProperty->GetPropertyValue(Property->ContainerPtrToValuePtr<UObject*>(Obj));
			SetStringProperty(Property->GetName(), Value);
		}
	}
}
Пример #2
0
HRESULT ParseMtProp(const UString &name, const PROPVARIANT &prop, UInt32 defaultNumThreads, UInt32 &numThreads)
{
  if (name.IsEmpty())
  {
    switch(prop.vt)
    {
      case VT_UI4:
        numThreads = prop.ulVal;
        break;
      default:
      {
        bool val;
        RINOK(SetBoolProperty(val, prop));
        numThreads = (val ? defaultNumThreads : 1);
        break;
      }
    }
  }
  else
  {
    UInt32 number;
    int index = ParseStringToUInt32(name, number);
    if (index != name.Length())
      return E_INVALIDARG;
    numThreads = number;
  }
  return S_OK;
}
Пример #3
0
void mitk::Label::SetLocked(bool locked)
{
    mitk::BoolProperty *property = dynamic_cast<mitk::BoolProperty *>(GetProperty("locked"));
    if (property != nullptr)
        // Update Property
        property->SetValue(locked);
    else
        // Create new Property
        SetBoolProperty("locked", locked);
}
Пример #4
0
void mitk::Label::SetVisible(bool visible)
{
    mitk::BoolProperty *property = dynamic_cast<mitk::BoolProperty *>(GetProperty("visible"));
    if (property != nullptr)
        // Update Property
        property->SetValue(visible);
    else
        // Create new Property
        SetBoolProperty("visible", visible);
}
void mitk::ColorBarAnnotation::SetDrawAnnotations(bool annotations)
{
  SetBoolProperty("ColorBarAnnotation.DrawAnnotations", annotations);
}
void mitk::ColorBarAnnotation::SetAnnotationTextScaling(bool scale)
{
  SetBoolProperty("ColorBarAnnotation.ScaleAnnotationText", scale);
}
void mitk::ColorBarAnnotation::SetDrawTickLabels(bool ticks)
{
  SetBoolProperty("ColorBarAnnotation.DrawTicks", ticks);
}
Пример #8
0
void mitk::ColorBarOverlay::SetDrawTickLabels(bool ticks)
{
    SetBoolProperty("ColorBarOverlay.DrawTicks", ticks);
}