本文整理汇总了C++中ParamList::GetBool方法的典型用法代码示例。如果您正苦于以下问题:C++ ParamList::GetBool方法的具体用法?C++ ParamList::GetBool怎么用?C++ ParamList::GetBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParamList
的用法示例。
在下文中一共展示了ParamList::GetBool方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteResult
void WriteResult(const std::string &base, Result &result, Config &config,
ParamList ¶ms)
{
const float fnorm = 2.f / sqrtf(result.npoints);
const float rnorm = 1.f / sqrtf(2.f / (SQRT3 * result.npoints));
// Statistics
if (!params.GetString("convert").empty()) {
std::string ext = params.GetString("convert");
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
std::string dot = (ext[0] != '.') ? "." : "";
result.points.Save(base+dot+ext);
}
if (params.GetBool("spatial") || params.GetBool("spectral") || params.GetBool("stats")) {
static bool first = true;
if (first) {
#ifdef PSA_HAS_CGAL
printf("%-16s\tG-MD\tA-MD\tBOO\tE-Nyq.\tOsci.\n", "File");
#else
printf("%-16s\tG-MD\tA-MD\tE-Nyq.\tOsci.\n", "File");
#endif
first = false;
}
printf("%-16s", base.c_str());
std::cout << std::fixed << std::setprecision(3) << std::setw(3);
#ifdef PSA_HAS_CGAL
if (params.GetBool("spatial") || params.GetBool("stats"))
std::cout << "\t" << result.stats.mindist * rnorm
<< "\t" << result.stats.avgmindist * rnorm
<< "\t" << result.stats.orientorder;
else
std::cout << "\t-\t-\t-";
#else
if (params.GetBool("spatial") || params.GetBool("stats"))
std::cout << "\t" << result.stats.mindist * rnorm
<< "\t" << result.stats.avgmindist * rnorm;
else
std::cout << "\t-\t-";
#endif
if (params.GetBool("spectral") || params.GetBool("stats"))
std::cout << "\t" << result.stats.effnyquist * fnorm
<< "\t" << result.stats.oscillations;
else
std::cout << "\t-\t-";
std::cout << "\n";
}
// 1D
if (params.GetBool("rp")) {
std::string ylabel = (result.nsets > 1) ? "power" : "amplitude";
std::string labels[2] = { "frequency", ylabel };
float yrange[2] = { config.fymin, config.fymax };
if (params.GetBool("raw"))
result.rp.SaveTXT(base+"_rp.txt");
else
result.rp.SaveTEX(base+"_rp.tex", labels, yrange, 1.f, fnorm);
}
if (params.GetBool("rdf")) {
std::string labels[2] = { "distance", "rdf" };
float yrange[2] = { config.rymin, config.rymax };
if (params.GetBool("raw"))
result.rdf.SaveTXT(base+"_rdf.txt");
else
result.rdf.SaveTEX(base+"_rdf.tex", labels, yrange, 1.f, rnorm);
}
if (params.GetBool("ani")) {
std::string labels[2] = { "frequency", "anisotropy" };
float yrange[2] = { std::min(-1.25f * result.nsets, -12.5f),
std::max( 1.25f * result.nsets, 12.5f) };
if (params.GetBool("raw"))
result.ani.SaveTXT(base+"_ani.txt");
else
result.ani.SaveTEX(base+"_ani.tex", labels, yrange,
(result.nsets > 1 ? -result.nsets : 0), fnorm);
}
// 2D
if (params.GetBool("pspectrum"))
result.spectrum.Save(base+"_spec.png");
}