36int main(
int argc,
char* argv[])
40 std::vector<int> detElemIds;
41 using Point = std::pair<double, double>;
42 std::vector<std::string> pointStrings;
43 std::vector<Point> points;
45 po::options_description
generic(
"Generic options");
47 generic.add_options()(
"help",
"produce help message")(
"hidepads",
"hide pad outlines")(
48 "hidedualsampas",
"hide dualsampa outlines")(
"hidedes",
"hide detection element outline")(
49 "hidepadchannels",
"hide pad channel numbering")(
"de", po::value<std::vector<int>>(&detElemIds),
50 "which detection element to consider")(
51 "prefix", po::value<std::string>(&prefix)->default_value(
"seg"),
"prefix used for outfile filename(s)")(
52 "point", po::value<std::vector<std::string>>(&pointStrings),
"points to show")(
"all",
"use all detection elements");
54 po::options_description cmdline;
57 po::store(po::command_line_parser(argc, argv).options(cmdline).run(), vm);
60 if (vm.count(
"help")) {
61 std::cout <<
generic <<
"\n";
65 if (vm.count(
"de") && vm.count(
"all")) {
66 std::cout <<
"--all and --de options are mutually exclusive. --all will be used\n";
70 if (vm.count(
"all")) {
72 [&detElemIds](
int detElemId) { detElemIds.push_back(detElemId); });
75 if (detElemIds.empty()) {
76 std::cout <<
"Must give at least one detection element id to work with\n";
77 std::cout <<
generic <<
"\n";
81 for (
auto ps : pointStrings) {
85 for (
auto& detElemId : detElemIds) {
87 std::ofstream out(vm[
"prefix"].as<std::string>() +
"-" +
std::to_string(detElemId) +
"-" +
93 vm.count(
"hidepadchannels") == 0);
94 if (!points.empty()) {
95 w.svgGroupStart(
"testPoints");
96 w.points(points, 0.2);