=============================================================================
| 61 | |
| 62 | //============================================================================= |
| 63 | nc_type VTKTypeToNetCDFType(int type) |
| 64 | { |
| 65 | switch (type) |
| 66 | { |
| 67 | // we use BYTE for char and signed char because NC_CHAR is an ascii character. |
| 68 | // and NetCDF reports an error if you store something else. |
| 69 | case VTK_CHAR: |
| 70 | case VTK_SIGNED_CHAR: |
| 71 | return NC_BYTE; |
| 72 | case VTK_UNSIGNED_CHAR: |
| 73 | return NC_UBYTE; |
| 74 | case VTK_SHORT: |
| 75 | return NC_SHORT; |
| 76 | case VTK_UNSIGNED_SHORT: |
| 77 | return NC_USHORT; |
| 78 | case VTK_INT: |
| 79 | return NC_INT; |
| 80 | case VTK_UNSIGNED_INT: |
| 81 | return NC_UINT; |
| 82 | #if VTK_SIZEOF_LONG == 4 |
| 83 | case VTK_LONG: |
| 84 | return NC_INT; |
| 85 | case VTK_UNSIGNED_LONG: |
| 86 | return NC_UINT; |
| 87 | #else |
| 88 | case VTK_LONG: |
| 89 | return NC_INT64; |
| 90 | case VTK_UNSIGNED_LONG: |
| 91 | return NC_UINT64; |
| 92 | #endif |
| 93 | case VTK_LONG_LONG: |
| 94 | return NC_INT64; |
| 95 | case VTK_UNSIGNED_LONG_LONG: |
| 96 | return NC_UINT64; |
| 97 | case VTK_FLOAT: |
| 98 | return NC_FLOAT; |
| 99 | case VTK_DOUBLE: |
| 100 | return NC_DOUBLE; |
| 101 | default: |
| 102 | return -1; |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | //------------------------------------------------------------------------------ |
| 107 | void SaveCoords(int ncid, int attributeType, const std::array<int, 3>& coordid, |
no outgoing calls
no test coverage detected