=============================================================================
| 171 | |
| 172 | //============================================================================= |
| 173 | static int NetCDFTypeToVTKType(nc_type type) |
| 174 | { |
| 175 | switch (type) |
| 176 | { |
| 177 | case NC_BYTE: |
| 178 | return VTK_UNSIGNED_CHAR; |
| 179 | case NC_CHAR: |
| 180 | return VTK_CHAR; |
| 181 | case NC_SHORT: |
| 182 | return VTK_SHORT; |
| 183 | case NC_INT: |
| 184 | return VTK_INT; |
| 185 | case NC_FLOAT: |
| 186 | return VTK_FLOAT; |
| 187 | case NC_DOUBLE: |
| 188 | return VTK_DOUBLE; |
| 189 | default: |
| 190 | vtkGenericWarningMacro(<< "Unknown netCDF variable type " << type); |
| 191 | return -1; |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | //============================================================================= |
| 196 | // This class automatically closes a netCDF file descriptor when it goes out |