00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00033 #ifndef __vtkNetCDFReader_h
00034 #define __vtkNetCDFReader_h
00035
00036 #include "vtkDataObjectAlgorithm.h"
00037
00038 #include "vtkSmartPointer.h"
00039
00040
00041 class vtkDataArraySelection;
00042 class vtkDataSet;
00043 class vtkDoubleArray;
00044 class vtkIntArray;
00045 class vtkStdString;
00046 class vtkStringArray;
00047
00048 class VTK_IO_EXPORT vtkNetCDFReader : public vtkDataObjectAlgorithm
00049 {
00050 public:
00051 vtkTypeMacro(vtkNetCDFReader, vtkDataObjectAlgorithm);
00052 static vtkNetCDFReader *New();
00053 virtual void PrintSelf(ostream &os, vtkIndent indent);
00054
00055 virtual void SetFileName(const char *filename);
00056 vtkGetStringMacro(FileName);
00057
00060 int UpdateMetaData();
00061
00062
00063
00064
00065
00066
00068
00069 virtual int GetNumberOfVariableArrays();
00070 virtual const char *GetVariableArrayName(int idx);
00071 virtual int GetVariableArrayStatus(const char *name);
00072 virtual void SetVariableArrayStatus(const char *name, int status);
00074
00076
00081 vtkGetObjectMacro(VariableDimensions, vtkStringArray);
00083
00090 virtual void SetDimensions(const char *dimensions);
00091
00093
00098 vtkGetObjectMacro(AllDimensions, vtkStringArray);
00100
00102
00110 vtkGetMacro(ReplaceFillValueWithNan, int);
00111 vtkSetMacro(ReplaceFillValueWithNan, int);
00112 vtkBooleanMacro(ReplaceFillValueWithNan, int);
00114
00115 protected:
00116 vtkNetCDFReader();
00117 ~vtkNetCDFReader();
00118
00119 char *FileName;
00120 vtkTimeStamp FileNameMTime;
00121 vtkTimeStamp MetaDataMTime;
00122
00123
00125 vtkSmartPointer<vtkIntArray> LoadingDimensions;
00126
00127 vtkSmartPointer<vtkDataArraySelection> VariableArraySelection;
00128
00130 vtkStringArray *VariableDimensions;
00131
00133 vtkStringArray *AllDimensions;
00134
00135
00136 int ReplaceFillValueWithNan;
00137
00138 virtual int RequestDataObject(vtkInformation *request,
00139 vtkInformationVector **inputVector,
00140 vtkInformationVector *outputVector);
00141
00142 virtual int RequestInformation(vtkInformation *request,
00143 vtkInformationVector **inputVector,
00144 vtkInformationVector *outputVector);
00145
00146 virtual int RequestData(vtkInformation *request,
00147 vtkInformationVector **inputVector,
00148 vtkInformationVector *outputVector);
00149
00151
00152 static void SelectionModifiedCallback(vtkObject *caller, unsigned long eid,
00153 void *clientdata, void *calldata);
00155
00158 vtkStdString DescribeDimensions(int ncFD, const int *dimIds, int numDims);
00159
00162 virtual int ReadMetaData(int ncFD);
00163
00165 virtual int FillVariableDimensions(int ncFD);
00166
00172 virtual int IsTimeDimension(int ncFD, int dimId);
00173
00174
00181 virtual vtkSmartPointer<vtkDoubleArray> GetTimeValues(int ncFD, int dimId);
00182
00183
00185
00190 virtual bool DimensionsAreForPointData(const int *vtkNotUsed(dimensions),
00191 int vtkNotUsed(numDimensions)) {
00192 return true;
00193 }
00195
00197
00199 virtual int LoadVariable(int ncFD, const char *varName, double time,
00200 vtkDataSet *output);
00202
00203 private:
00204 vtkNetCDFReader(const vtkNetCDFReader &);
00205 void operator=(const vtkNetCDFReader &);
00206 };
00207
00208 #endif //__vtkNetCDFReader_h