VTK
vtkNetCDFCAMReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkNetCDFCAMReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
31 #ifndef vtkNetCDFCAMReader_h
32 #define vtkNetCDFCAMReader_h
33 
34 #include "vtkIONetCDFModule.h" // For export macro
36 
37 class vtkCallbackCommand;
39 
40 class VTKIONETCDF_EXPORT vtkNetCDFCAMReader : public vtkUnstructuredGridAlgorithm
41 {
42 public:
43  static vtkNetCDFCAMReader *New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
53  static int CanReadFile(const char* fileName);
54 
55  void SetFileName(const char* fileName);
56  vtkGetStringMacro(FileName);
57 
58  void SetConnectivityFileName(const char* fileName);
59  vtkGetStringMacro(ConnectivityFileName);
60 
62 
75  {
79  VERTICAL_DIMENSION_COUNT
80  };
81  vtkSetClampMacro(VerticalDimension, int, 0, 2);
82  vtkGetMacro(VerticalDimension, int);
84 
86 
92  vtkBooleanMacro(SingleMidpointLayer, vtkTypeBool);
93  vtkSetMacro(SingleMidpointLayer, vtkTypeBool);
94  vtkGetMacro(SingleMidpointLayer, vtkTypeBool);
95  vtkSetMacro(MidpointLayerIndex, int);
96  vtkGetMacro(MidpointLayerIndex, int);
97  vtkGetVector2Macro(MidpointLayersRange, int);
98 
99  vtkBooleanMacro(SingleInterfaceLayer, vtkTypeBool);
100  vtkSetMacro(SingleInterfaceLayer, vtkTypeBool);
101  vtkGetMacro(SingleInterfaceLayer, vtkTypeBool);
102  vtkSetMacro(InterfaceLayerIndex, int);
103  vtkGetMacro(InterfaceLayerIndex, int);
104  vtkGetVector2Macro(InterfaceLayersRange, int);
106 
108 
112  int GetNumberOfPointArrays();
113  const char* GetPointArrayName(int index);
114  int GetPointArrayStatus(const char* name);
115  void SetPointArrayStatus(const char* name, int status);
116  void DisableAllPointArrays();
117  void EnableAllPointArrays();
119 
120 protected:
122  ~vtkNetCDFCAMReader() override;
123 
125  vtkInformationVector*) override;
126 
128  vtkInformationVector *) override;
129 
131  vtkInformationVector *) override;
132 
138  bool GetPartitioning(
139  size_t piece, size_t numPieces,size_t numCellLevels, size_t numCellsPerLevel,
140  size_t & beginCellLevel, size_t & endCellLevel, size_t & beginCell, size_t & endCell);
141 
142  void BuildVarArray();
143  static void SelectionCallback(vtkObject* caller, unsigned long eid,
144  void* clientdata, void* calldata);
145 
146 
147 private:
148  vtkNetCDFCAMReader(const vtkNetCDFCAMReader&) = delete;
149  void operator=(const vtkNetCDFCAMReader&) = delete;
150 
152 
156  char* FileName;
157  char* CurrentFileName;
158  vtkSetStringMacro(CurrentFileName);
160 
162 
165  char* ConnectivityFileName;
166  char* CurrentConnectivityFileName;
167  vtkSetStringMacro(CurrentConnectivityFileName);
169 
170  int VerticalDimension;
171  double * TimeSteps;
172  size_t NumberOfTimeSteps;
173  vtkDataArraySelection* PointDataArraySelection;
174  vtkCallbackCommand* SelectionObserver;
175 
176  vtkTypeBool SingleMidpointLayer;
177  int MidpointLayerIndex;
178  int MidpointLayersRange[2];
179 
180  vtkTypeBool SingleInterfaceLayer;
181  int InterfaceLayerIndex;
182  int InterfaceLayersRange[2];
183 
184  class Internal;
185  Internal *Internals;
186 };
187 
188 #endif
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
abstract base class for most VTK objects
Definition: vtkObject.h:59
Store vtkAlgorithm input/output information.
static vtkUnstructuredGridAlgorithm * New()
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Read unstructured NetCDF CAM files.
int vtkTypeBool
Definition: vtkABI.h:69
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:39
Store on/off settings for data arrays for a vtkSource.
Superclass for algorithms that produce only unstructured grid as output.
VerticalDimension
Set whether to read a single layer, midpoint layers or interface layers.
Store zero or more vtkInformation instances.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.