------------------------------------------------------------------------------
| 105 | |
| 106 | //------------------------------------------------------------------------------ |
| 107 | void SaveCoords(int ncid, int attributeType, const std::array<int, 3>& coordid, |
| 108 | const std::array<std::vector<double>, 3>& coord, const std::array<int, 3>& boundsid, |
| 109 | std::array<std::vector<std::array<double, 2>>, 3> bounds) |
| 110 | { |
| 111 | int status; |
| 112 | for (int i = 0; i < 3; ++i) |
| 113 | { |
| 114 | if ((status = nc_put_var_double(ncid, coordid[i], coord[i].data()))) |
| 115 | { |
| 116 | std::ostringstream ostr; |
| 117 | ostr << "Error nc_put_var_double " << COORD_NAME[attributeType][i] << ": " |
| 118 | << nc_strerror(status); |
| 119 | throw std::runtime_error(ostr.str()); |
| 120 | } |
| 121 | } |
| 122 | if (attributeType == vtkDataObject::CELL) |
| 123 | { |
| 124 | for (int i = 0; i < 3; ++i) |
| 125 | { |
| 126 | if ((status = nc_put_var_double(ncid, boundsid[i], bounds[i][0].data()))) |
| 127 | { |
| 128 | std::ostringstream ostr; |
| 129 | ostr << "Error nc_put_var_double " << BOUNDS_NAME[attributeType][i] << ": " |
| 130 | << nc_strerror(status); |
| 131 | throw std::runtime_error(ostr.str()); |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | //------------------------------------------------------------------------------ |
| 138 | void GetCoords(vtkImageData* id, int attributeType, std::array<std::vector<double>, 3>* coord, |
no test coverage detected