| 137 | ///@} |
| 138 | |
| 139 | class vtkDimensionInfo |
| 140 | { |
| 141 | public: |
| 142 | vtkDimensionInfo() = default; |
| 143 | vtkDimensionInfo(vtkNetCDFAccessor* accessor, int ncFD, int id, |
| 144 | const std::vector<std::string>& dimensionNames); |
| 145 | |
| 146 | const char* GetName() const { return this->Name.c_str(); } |
| 147 | enum UnitsEnum |
| 148 | { |
| 149 | UNDEFINED_UNITS, |
| 150 | TIME_UNITS, |
| 151 | LATITUDE_UNITS, |
| 152 | LONGITUDE_UNITS, |
| 153 | VERTICAL_UNITS, |
| 154 | NUMBER_OF_UNITS |
| 155 | }; |
| 156 | UnitsEnum GetUnits() const { return this->Units; } |
| 157 | vtkSmartPointer<vtkDoubleArray> GetCoordinates() { return this->Coordinates; } |
| 158 | vtkSmartPointer<vtkDoubleArray> GetBounds() { return this->Bounds; } |
| 159 | bool GetHasRegularSpacing() const { return this->HasRegularSpacing; } |
| 160 | double GetOrigin() const { return this->Origin; } |
| 161 | double GetSpacing() const { return this->Spacing; } |
| 162 | vtkSmartPointer<vtkStringArray> GetSpecialVariables() const { return this->SpecialVariables; } |
| 163 | void SetUnitsIfSpecialDimensionOverriden(UnitsEnum unit, const char* name); |
| 164 | |
| 165 | protected: |
| 166 | vtkNetCDFAccessor* Accessor = nullptr; |
| 167 | vtkStdString Name; |
| 168 | int DimId; |
| 169 | vtkSmartPointer<vtkDoubleArray> Coordinates; |
| 170 | vtkSmartPointer<vtkDoubleArray> Bounds; |
| 171 | UnitsEnum Units; |
| 172 | bool HasRegularSpacing; |
| 173 | double Origin, Spacing; |
| 174 | vtkSmartPointer<vtkStringArray> SpecialVariables; |
| 175 | std::vector<std::string> SpecialDimensionOverrideNames; |
| 176 | int LoadMetaData(int ncFD); |
| 177 | }; |
| 178 | void SetSpecialDimensionOverrideName(vtkDimensionInfo::UnitsEnum dim, const char* name) |
| 179 | { |
| 180 | this->SpecialDimensionOverrideNames[dim] = name; |