comparison layer/SliceLayer.cpp @ 598:3803f6dcf361 sv_v1.9

Save/restore more slice layer parameters (fixing SF feature #3039297)
author Chris Cannam
date Wed, 28 Sep 2011 13:55:52 +0100
parents 4806715f7a19
children 5b72899d692b
comparison
equal deleted inserted replaced
597:2f087d950621 598:3803f6dcf361
883 QString s; 883 QString s;
884 884
885 s += QString("colourScheme=\"%1\" " 885 s += QString("colourScheme=\"%1\" "
886 "energyScale=\"%2\" " 886 "energyScale=\"%2\" "
887 "samplingMode=\"%3\" " 887 "samplingMode=\"%3\" "
888 "gain=\"%4\" " 888 "plotStyle=\"%4\" "
889 "normalize=\"%5\"") 889 "binScale=\"%5\" "
890 "gain=\"%6\" "
891 "threshold=\"%7\" "
892 "normalize=\"%8\"")
890 .arg(m_colourMap) 893 .arg(m_colourMap)
891 .arg(m_energyScale) 894 .arg(m_energyScale)
892 .arg(m_samplingMode) 895 .arg(m_samplingMode)
896 .arg(m_plotStyle)
897 .arg(m_binScale)
893 .arg(m_gain) 898 .arg(m_gain)
899 .arg(m_threshold)
894 .arg(m_normalize ? "true" : "false"); 900 .arg(m_normalize ? "true" : "false");
895 901
896 SingleColourLayer::toXml(stream, indent, extraAttributes + " " + s); 902 SingleColourLayer::toXml(stream, indent, extraAttributes + " " + s);
897 } 903 }
898 904
912 if (ok) setSamplingMode(mode); 918 if (ok) setSamplingMode(mode);
913 919
914 int colourMap = attributes.value("colourScheme").toInt(&ok); 920 int colourMap = attributes.value("colourScheme").toInt(&ok);
915 if (ok) setFillColourMap(colourMap); 921 if (ok) setFillColourMap(colourMap);
916 922
923 PlotStyle s = (PlotStyle)
924 attributes.value("plotStyle").toInt(&ok);
925 if (ok) setPlotStyle(s);
926
927 BinScale b = (BinScale)
928 attributes.value("binScale").toInt(&ok);
929 if (ok) setBinScale(b);
930
917 float gain = attributes.value("gain").toFloat(&ok); 931 float gain = attributes.value("gain").toFloat(&ok);
918 if (ok) setGain(gain); 932 if (ok) setGain(gain);
919 933
934 float threshold = attributes.value("threshold").toFloat(&ok);
935 if (ok) setThreshold(threshold);
936
920 bool normalize = (attributes.value("normalize").trimmed() == "true"); 937 bool normalize = (attributes.value("normalize").trimmed() == "true");
921 setNormalize(normalize); 938 setNormalize(normalize);
922 } 939 }
923 940
924 bool 941 bool