15 #include "../../../thirdparty/nlohmann_json/single_include/nlohmann/json.hpp"
32 os <<
"[ " << std::setw(3) <<
id.volume();
33 os <<
" | " << std::setw(3) <<
id.boundary();
34 os <<
" | " << std::setw(3) <<
id.layer();
35 os <<
" | " << std::setw(3) <<
id.approach();
36 os <<
" | " << std::setw(4) <<
id.sensitive() <<
" ]";
43 std::map<std::string, std::string>& surface_name) {
47 if (key ==
"volumes") {
50 for (
auto& [vkey, vvalue] : volj.items()) {
52 name = vvalue[
"Name"];
54 if (!vvalue[
"boundaries"].empty()) {
55 for (
auto& [bkey, bvalue] : vvalue[
"boundaries"].items()) {
56 surface_name[bvalue[
"SGeoid"]] =
name;
60 if (!vvalue[
"layers"].empty()) {
61 for (
auto& [lkey, lvalue] : vvalue[
"layers"].items()) {
62 surface_name[lvalue[
"Geoid"]] =
name;
64 for (
auto& [lckey, lcvalue] : lvalue.items()) {
65 if (lckey ==
"representing" && !lcvalue.empty()) {
66 surface_name[lcvalue[
"SGeoid"]] =
name;
67 }
else if (lckey ==
"approach" && !lcvalue.empty()) {
69 for (
auto& [askey, asvalue] : lcvalue.items()) {
70 surface_name[asvalue[
"SGeoid"]] =
name;
72 }
else if (lckey ==
"sensitive" && !lcvalue.empty()) {
74 for (
auto& [sskey, ssvalue] : lcvalue.items()) {
75 surface_name[ssvalue[
"SGeoid"]] =
name;
90 const std::map<std::string, std::string>& surface_name,
91 const uint64_t&
id,
const int& type,
const float&
pos,
92 const float& range_min,
const float& range_max) {
94 std::ostringstream layerID;
96 std::string surface_id = layerID.str();
98 std::string Id_temp = surface_id;
99 std::string delimiter =
" | ";
101 std::vector<std::string> Ids;
102 while ((del_pos = Id_temp.find(delimiter)) != std::string::npos) {
103 Ids.push_back(Id_temp.substr(0, del_pos));
104 Id_temp.erase(0, del_pos + delimiter.length());
106 Ids.push_back(Id_temp);
109 Ids[
tag].erase(std::remove(Ids[
tag].begin(), Ids[
tag].end(),
' '),
111 Ids[
tag].erase(std::remove(Ids[
tag].begin(), Ids[
tag].end(),
'['),
113 Ids[
tag].erase(std::remove(Ids[
tag].begin(), Ids[
tag].end(),
']'),
118 "v" + Ids[0] +
"_b" + Ids[1] +
"_l" + Ids[2] +
"_a" + Ids[3];
119 surface_info.
type = type;
121 if (surface_name.find(surface_id) != surface_name.end()) {
122 surface_info.
name = surface_name.at(surface_id);
124 surface_info.
name =
"";
126 surface_info.
id = surface_id;