本文整理汇总了C++中Sample::GetDensityThicknessFixedString方法的典型用法代码示例。如果您正苦于以下问题:C++ Sample::GetDensityThicknessFixedString方法的具体用法?C++ Sample::GetDensityThicknessFixedString怎么用?C++ Sample::GetDensityThicknessFixedString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sample
的用法示例。
在下文中一共展示了Sample::GetDensityThicknessFixedString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConvertSampleToXML
static void ConvertSampleToXML(xmlpp::Element *sampleXML, Sample &sampleBAM) {
std::vector<std::string> elements(sampleBAM.GetElements());
for (std::vector<std::string>::iterator it = elements.begin() ; it != elements.end() ; ++it) {
SingleElement single_element = sampleBAM.GetSingleElement(*it);
xmlpp::Element *element_rxi = sampleXML->add_child("element_rxi");
element_rxi->set_attribute("element", single_element.GetElement());
element_rxi->set_attribute("linetype", single_element.GetLineType());
element_rxi->set_attribute("datatype", single_element.GetDataType());
element_rxi->set_attribute("excitation_energy", single_element.GetExcitationEnergyString());
element_rxi->add_child_text(single_element.GetRXIString());
}
std::map<std::string,double> asrfiles = sampleBAM.GetASRfiles();
for (std::map<std::string,double>::iterator iter = asrfiles.begin() ;
iter != asrfiles.end() ;
++iter) {
xmlpp::Element *new_asrfile = sampleXML->add_child("asrfile");
new_asrfile->add_child_text(iter->first);
std::stringstream ss;
ss << iter->second;
new_asrfile->set_attribute("excitation_energy", ss.str());
}
sampleXML->add_child("density")->add_child_text(sampleBAM.GetDensityString());
sampleXML->add_child("thickness")->add_child_text(sampleBAM.GetThicknessString());
sampleXML->set_attribute("density_thickness", sampleBAM.GetDensityThicknessFixedString());
sampleXML->set_attribute("matrix", sampleBAM.GetMatrixString());
return;
}