23 j[
"type"] = bounds.
type();
24 j[
"values"] = bounds.
values();
29 return nlohmann::json(bounds);
33 const nlohmann::json& jVolumeBounds) {
37 case VolumeBounds::BoundsType::eCone: {
38 return fromJson<ConeVolumeBounds>(jVolumeBounds);
40 case VolumeBounds::BoundsType::eCuboid: {
41 return fromJson<CuboidVolumeBounds>(jVolumeBounds);
43 case VolumeBounds::BoundsType::eCutoutCylinder: {
44 return fromJson<CutoutCylinderVolumeBounds>(jVolumeBounds);
46 case VolumeBounds::BoundsType::eCylinder: {
47 return fromJson<CylinderVolumeBounds>(jVolumeBounds);
49 case VolumeBounds::BoundsType::eTrapezoid: {
50 return fromJson<TrapezoidVolumeBounds>(jVolumeBounds);
52 case VolumeBounds::BoundsType::eGenericCuboid: {
53 return fromJson<GenericCuboidVolumeBounds>(jVolumeBounds);
56 throw std::invalid_argument(
"Unknown volume bounds type!");