#include "generators/geometry_generator.h" #include #include "simulation/errors.h" namespace generator { std::shared_ptr buildGeometry(Parameter& parameter, const json_path& path_to_geometry) { if (parameter.jsonObjectFromBase( json_path_append(path_to_geometry, {"Cylinder"}))) { DEBUG_LEVEL_2("Creating geometry: cylinder."); double radius = json_read_length(parameter.jsonObjectFromBase(json_path_append( path_to_geometry, {"Cylinder", "Radius"})), "m"); double height = json_read_length(parameter.jsonObjectFromBase(json_path_append( path_to_geometry, {"Cylinder", "Height"})), "m"); DEBUG_LEVEL_3("with radius: " + std::to_string(radius) + " m"); DEBUG_LEVEL_3("with height: " + std::to_string(height) + " m"); return std::shared_ptr(new Cylinder(radius, height)); } else { ERROR("This geometry is not implemented."); return nullptr; } } }; // namespace generator