void FScriptContextBase::FetchScriptPropertyValues(UScriptBlueprintGeneratedClass* Class, UObject* Obj) { // @todo: optimize this for (auto Property : Class->ScriptProperties) { if (UFloatProperty* FloatProperty = Cast<UFloatProperty>(Property)) { float Value = GetFloatProperty(Property->GetName()); FloatProperty->SetFloatingPointPropertyValue(Property->ContainerPtrToValuePtr<float>(Obj), Value); } else if (UIntProperty* IntProperty = Cast<UIntProperty>(Property)) { int32 Value = GetIntProperty(Property->GetName()); IntProperty->SetPropertyValue(Property->ContainerPtrToValuePtr<int32>(Obj), Value); } else if (UBoolProperty* BoolProperty = Cast<UBoolProperty>(Property)) { bool Value = GetBoolProperty(Property->GetName()); BoolProperty->SetPropertyValue(Property->ContainerPtrToValuePtr<float>(Obj), Value); } else if (UObjectProperty* ObjectProperty = Cast<UObjectProperty>(Property)) { UObject* Value = GetObjectProperty(Property->GetName()); ObjectProperty->SetObjectPropertyValue(Property->ContainerPtrToValuePtr<UObject*>(Obj), Value); } else if (UStrProperty* StringProperty = Cast<UStrProperty>(Property)) { FString Value = GetStringProperty(Property->GetName()); StringProperty->SetPropertyValue(Property->ContainerPtrToValuePtr<FString>(Obj), Value); } } }
void KinectDevice::SetProperty( const char *propertyKey, BaseProperty* propertyValue ) { ToFCameraDevice::SetProperty(propertyKey,propertyValue); this->m_PropertyList->SetProperty(propertyKey, propertyValue); if (strcmp(propertyKey, "RGB") == 0) { bool rgb = false; GetBoolProperty(propertyKey, rgb); m_Controller->SetUseIR(!rgb); } else if (strcmp(propertyKey, "IR") == 0) { bool ir = false; GetBoolProperty(propertyKey, ir); m_Controller->SetUseIR(ir); } }
static jint com_android_internal_os_Zygote_nativeForkSystemServer( JNIEnv* env, jclass, uid_t uid, gid_t gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jlong permitted_capabilities, jlong effective_capabilities) { pid_t pid = ForkCommon(env, true, /* managed_fds_to_close= */ nullptr, /* managed_fds_to_ignore= */ nullptr); if (pid == 0) { SpecializeCommon(env, uid, gid, gids, runtime_flags, rlimits, permitted_capabilities, effective_capabilities, MOUNT_EXTERNAL_DEFAULT, nullptr, nullptr, true, false, nullptr, nullptr); } else if (pid > 0) { // The zygote process checks whether the child process has died or not. ALOGI("System server process %d has been created", pid); gSystemServerPid = pid; // There is a slight window that the system server process has crashed // but it went unnoticed because we haven't published its pid yet. So // we recheck here just to make sure that all is well. int status; if (waitpid(pid, &status, WNOHANG) == pid) { ALOGE("System server process %d has died. Restarting Zygote!", pid); RuntimeAbort(env, __LINE__, "System server process has died. Restarting Zygote!"); } bool low_ram_device = GetBoolProperty("ro.config.low_ram", false); bool per_app_memcg = GetBoolProperty("ro.config.per_app_memcg", low_ram_device); if (per_app_memcg) { // Assign system_server to the correct memory cgroup. // Not all devices mount /dev/memcg so check for the file first // to avoid unnecessarily printing errors and denials in the logs. if (!access("/dev/memcg/system/tasks", F_OK) && !WriteStringToFile(StringPrintf("%d", pid), "/dev/memcg/system/tasks")) { ALOGE("couldn't write %d to /dev/memcg/system/tasks", pid); } } } return pid; }
void ToFCameraPMDCamCubeDevice::SetProperty( const char *propertyKey, BaseProperty* propertyValue ) { ToFCameraPMDDevice::SetProperty(propertyKey,propertyValue); this->m_PropertyList->SetProperty(propertyKey, propertyValue); ToFCameraPMDCamCubeController::Pointer myController = dynamic_cast<mitk::ToFCameraPMDCamCubeController*>(this->m_Controller.GetPointer()); bool boolValue = false; GetBoolProperty(propertyKey, boolValue); if (strcmp(propertyKey, "SetFPNCalibration") == 0) { myController->SetFPNCalibration(boolValue); } else if (strcmp(propertyKey, "SetFPPNCalibration") == 0) { myController->SetFPPNCalibration(boolValue); } else if (strcmp(propertyKey, "SetLinearityCalibration") == 0) { myController->SetLinearityCalibration(boolValue); } else if (strcmp(propertyKey, "SetLensCalibration") == 0) { myController->SetLensCalibration(boolValue); } else if (strcmp(propertyKey, "SetExposureMode") == 0) { if (boolValue) { myController->SetExposureMode(1); } else { myController->SetExposureMode(0); } } }
void mitk::TextOverlay2D::UpdateVtkOverlay2D(mitk::BaseRenderer *renderer) { LocalStorage* ls = this->m_LSH.GetLocalStorage(renderer); if (ls->IsGenerateDataRequired(renderer, this)) { float color[3] = { 0.0, 1.0, 0.0 }; float opacity = 1.0; GetColor(color, renderer); GetOpacity(opacity, renderer); ls->m_TextProp->SetColor(color[0], color[1], color[2]); ls->m_STextProp->SetColor(0, 0, 0); ls->m_TextProp->SetFontSize(GetFontSize()); ls->m_TextProp->SetOpacity(opacity); ls->m_STextProp->SetFontSize(GetFontSize()); ls->m_STextProp->SetOpacity(opacity); bool drawShadow; GetBoolProperty("drawShadow", drawShadow); ls->m_TextProp->SetShadow(false); ls->m_STextProp->SetShadow(false); ls->m_STextActor->SetVisibility(drawShadow); ls->m_TextActor->SetInput(GetText().c_str()); ls->m_STextActor->SetInput(GetText().c_str()); mitk::Point2D posT, posS; posT[0] = GetPosition2D(renderer)[0] + GetOffsetVector(renderer)[0]; posT[1] = GetPosition2D(renderer)[1] + GetOffsetVector(renderer)[1]; posS[0] = posT[0] + 1; posS[1] = posT[1] - 1; ls->m_TextActor->SetDisplayPosition(posT[0], posT[1]); ls->m_STextActor->SetDisplayPosition(posS[0], posS[1]); ls->UpdateGenerateDataTime(); } }
bool mitk::Label::GetVisible() const { bool visible; GetBoolProperty("visible", visible); return visible; }
bool mitk::Label::GetLocked() const { bool locked; GetBoolProperty("locked", locked); return locked; }
void mitk::DisplayInteractor::ConfigurationChanged() { mitk::PropertyList::Pointer properties = GetAttributes(); // auto repeat std::string strAutoRepeat = ""; if (properties->GetStringProperty("autoRepeat", strAutoRepeat)) { if (strAutoRepeat == "true") { m_AutoRepeat = true; } else { m_AutoRepeat = false; } } // pixel movement for scrolling one slice std::string strPixelPerSlice = ""; if (properties->GetStringProperty("pixelPerSlice", strPixelPerSlice)) { m_IndexToSliceModifier = atoi(strPixelPerSlice.c_str()); } else { m_IndexToSliceModifier = 4; } // scroll direction if (!properties->GetStringProperty("scrollDirection", m_ScrollDirection)) { m_ScrollDirection = "updown"; } m_InvertScrollDirection = GetBoolProperty( properties, "invertScrollDirection", false ); // zoom direction if (!properties->GetStringProperty("zoomDirection", m_ZoomDirection)) { m_ZoomDirection = "updown"; } m_InvertZoomDirection = GetBoolProperty( properties, "invertZoomDirection", false ); m_InvertMoveDirection = GetBoolProperty( properties, "invertMoveDirection", false ); if (!properties->GetStringProperty("levelWindowDirection", m_LevelDirection)) { m_LevelDirection = "leftright"; } m_InvertLevelWindowDirection = GetBoolProperty( properties, "invertLevelWindowDirection", false ); // zoom factor std::string strZoomFactor = ""; properties->GetStringProperty("zoomFactor", strZoomFactor); m_ZoomFactor = .05; if (atoi(strZoomFactor.c_str()) > 0) { m_ZoomFactor = 1.0 + (atoi(strZoomFactor.c_str()) / 100.0); } // allwaysReact std::string strAlwaysReact = ""; if (properties->GetStringProperty("alwaysReact", strAlwaysReact)) { if (strAlwaysReact == "true") { m_AlwaysReact = true; } else { m_AlwaysReact = false; } } else { m_AlwaysReact = false; } }
bool mitk::Overlay::GetVisibility(bool& visible, mitk::BaseRenderer* renderer, const std::string& propertyKey) const { return GetBoolProperty(propertyKey, visible, renderer); }
bool mitk::Annotation::GetVisibility(bool &visible, const std::string &propertyKey) const { return GetBoolProperty(propertyKey, visible); }