void VectorEvaluationLocator::storeState(Misc::ConfigurationFileSection& configFileSection) const { Visualization::Abstract::VariableManager* vm=application->variableManager; /* Write the algorithm type: */ configFileSection.storeString("./algorithm","Evaluate Vectors"); /* Write the vector variable name: */ configFileSection.storeValue<std::string>("./vectorVariableName",vm->getVectorVariableName(vm->getVectorVariable(vectorExtractor))); /* Write the scalar variable name: */ configFileSection.storeValue<std::string>("./scalarVariableName",vm->getScalarVariableName(vm->getScalarVariable(scalarExtractor))); /* Write the evaluation dialog's position: */ GLMotif::writeTopLevelPosition(evaluationDialogPopup,configFileSection); }
void ExtractorLocator::storeState(Misc::ConfigurationFileSection& configFileSection) const { /* Write the algorithm type: */ configFileSection.storeString("./algorithm",extractor->getName()); /* Write the algorithm's current parameters: */ Visualization::Abstract::ConfigurationFileParametersSink sink(application->variableManager,configFileSection); Visualization::Abstract::Parameters* parameters=extractor->cloneParameters(); parameters->write(sink); delete parameters; if(settingsDialog!=0) { /* Write the settings dialog's current position and size: */ GLMotif::writeTopLevelPosition(settingsDialog,configFileSection); } }
void VideoDevice::saveConfiguration(Misc::ConfigurationFileSection& cfg) const { /* Get the device's current video format: */ VideoDataFormat currentFormat=getVideoFormat(); /* Save the current frame size: */ cfg.storeValueWC("./frameSize",currentFormat.size,Misc::CFixedArrayValueCoder<unsigned int,2>()); /* Save the current frame rate: */ cfg.storeValue("./frameRate",double(currentFormat.frameIntervalDenominator)/double(currentFormat.frameIntervalCounter)); /* Check if the current pixel format is a valid FourCC code: */ char fourCCBuffer[5]; currentFormat.getFourCC(fourCCBuffer); bool valid=true; for(int i=0;i<4&&valid;++i) valid=fourCCBuffer[i]>=32&&fourCCBuffer[i]<127&&fourCCBuffer[i]!='"'; if(valid) { /* Save the current pixel format as a FourCC code: */ cfg.storeValue<std::string>("./pixelFormat",fourCCBuffer); } else { /* Save the current pixel format as a hexadecimal number: */ char hexBuffer[9]; unsigned int pixelFormat=currentFormat.pixelFormat; for(int i=0;i<8;++i,pixelFormat>>=4) { if((pixelFormat&0x0fU)>=10U) hexBuffer[7-i]=(pixelFormat&0x0fU)+'a'; else hexBuffer[7-i]=(pixelFormat&0x0fU)+'0'; } hexBuffer[8]='\0'; cfg.storeString("./pixelFormatHex",hexBuffer); } }
void CuttingPlaneLocator::storeState(Misc::ConfigurationFileSection& configFileSection) const { /* Write the algorithm name: */ configFileSection.storeString("./algorithm","Cutting Plane"); }