| 698 | } |
| 699 | |
| 700 | std::optional<std::string> ReadVector3D(const nlohmann::json& arr, mitk::Vector3D& out) |
| 701 | { |
| 702 | if (!arr.is_array()) |
| 703 | return "must be an array of 3 numbers"; |
| 704 | if (arr.size() != 3) |
| 705 | return "must have exactly 3 elements, got " + std::to_string(arr.size()); |
| 706 | for (std::size_t i = 0; i < 3; ++i) |
| 707 | { |
| 708 | if (!arr[i].is_number()) |
| 709 | return "element " + std::to_string(i) + " is not a number"; |
| 710 | out[i] = arr[i].get<double>(); |
| 711 | } |
| 712 | return std::nullopt; |
| 713 | } |
| 714 | |
| 715 | /** |
| 716 | * \brief Parse and validate a camera patch body for a given window kind. |
no test coverage detected