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 =========================================================================*/
28 #ifndef vtkNetCDFCAMReader_h
29 #define vtkNetCDFCAMReader_h
30 
31 #include "vtkIONetCDFModule.h" // For export macro
33 
34 #include "vtk_netcdfcpp_fwd.h" // Forward declarations for vtknetcdfcpp
35 
36 class vtkCallbackCommand;
38 
39 class VTKIONETCDF_EXPORT vtkNetCDFCAMReader : public vtkUnstructuredGridAlgorithm
40 {
41 public:
42  static vtkNetCDFCAMReader *New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
52  static int CanReadFile(const char* fileName);
53 
54  void SetFileName(const char* fileName);
55  vtkGetStringMacro(FileName);
56 
57  void SetConnectivityFileName(const char* fileName);
58  vtkGetStringMacro(ConnectivityFileName);
59 
61 
74  {
78  VERTICAL_DIMENSION_COUNT
79  };
80  vtkSetClampMacro(VerticalDimension, int, 0, 2);
81  vtkGetMacro(VerticalDimension, int);
83 
85 
91  vtkBooleanMacro(SingleMidpointLayer, vtkTypeBool);
92  vtkSetMacro(SingleMidpointLayer, vtkTypeBool);
93  vtkGetMacro(SingleMidpointLayer, vtkTypeBool);
94  vtkSetMacro(MidpointLayerIndex, int);
95  vtkGetMacro(MidpointLayerIndex, int);
96  vtkGetVector2Macro(MidpointLayersRange, int);
97 
98  vtkBooleanMacro(SingleInterfaceLayer, vtkTypeBool);
99  vtkSetMacro(SingleInterfaceLayer, vtkTypeBool);
100  vtkGetMacro(SingleInterfaceLayer, vtkTypeBool);
101  vtkSetMacro(InterfaceLayerIndex, int);
102  vtkGetMacro(InterfaceLayerIndex, int);
103  vtkGetVector2Macro(InterfaceLayersRange, int);
105 
107 
111  int GetNumberOfPointArrays();
112  const char* GetPointArrayName(int index);
113  int GetPointArrayStatus(const char* name);
114  void SetPointArrayStatus(const char* name, int status);
115  void DisableAllPointArrays();
116  void EnableAllPointArrays();
118 
119 protected:
121  ~vtkNetCDFCAMReader() override;
122 
124  vtkInformationVector*) override;
125 
127  vtkInformationVector *) override;
128 
130  vtkInformationVector *) override;
131 
137  bool GetPartitioning(
138  int piece, int numPieces,int numCellLevels, int numCellsPerLevel,
139  int & beginCellLevel, int & endCellLevel, int & beginCell, int & endCell);
140 
141  void BuildVarArray();
142  static void SelectionCallback(vtkObject* caller, unsigned long eid,
143  void* clientdata, void* calldata);
144 
145 
146 private:
147  vtkNetCDFCAMReader(const vtkNetCDFCAMReader&) = delete;
148  void operator=(const vtkNetCDFCAMReader&) = delete;
149 
151 
155  char* FileName;
156  char* CurrentFileName;
157  vtkSetStringMacro(CurrentFileName);
159 
161 
164  char* ConnectivityFileName;
165  char* CurrentConnectivityFileName;
166  vtkSetStringMacro(CurrentConnectivityFileName);
168 
169  int VerticalDimension;
170  double * TimeSteps;
171  long NumberOfTimeSteps;
172  vtkDataArraySelection* PointDataArraySelection;
173  vtkCallbackCommand* SelectionObserver;
174 
175  vtkTypeBool SingleMidpointLayer;
176  int MidpointLayerIndex;
177  int MidpointLayersRange[2];
178 
179  vtkTypeBool SingleInterfaceLayer;
180  int InterfaceLayerIndex;
181  int InterfaceLayersRange[2];
182 
183 
185 
189  NcFile* PointsFile;
190  NcFile* ConnectivityFile;
191 };
193 
194 #endif
vtkNetCDFCAMReader
Read unstructured NetCDF CAM files.
Definition: vtkNetCDFCAMReader.h:39
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkNetCDFCAMReader::VERTICAL_DIMENSION_INTERFACE_LAYERS
Definition: vtkNetCDFCAMReader.h:77
vtkUnstructuredGridAlgorithm::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkDataArraySelection
Store on/off settings for data arrays for a vtkSource.
Definition: vtkDataArraySelection.h:34
vtkNetCDFCAMReader::VERTICAL_DIMENSION_SINGLE_LAYER
Definition: vtkNetCDFCAMReader.h:75
vtkUnstructuredGridAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkUnstructuredGridAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkNetCDFCAMReader::VerticalDimension
VerticalDimension
Set whether to read a single layer, midpoint layers or interface layers.
Definition: vtkNetCDFCAMReader.h:73
vtkX3D::name
Definition: vtkX3D.h:219
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkUnstructuredGridAlgorithm::New
static vtkUnstructuredGridAlgorithm * New()
vtkUnstructuredGridAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkNetCDFCAMReader::VERTICAL_DIMENSION_MIDPOINT_LAYERS
Definition: vtkNetCDFCAMReader.h:76
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:44
vtkUnstructuredGridAlgorithm.h
vtkUnstructuredGridAlgorithm
Superclass for algorithms that produce only unstructured grid as output.
Definition: vtkUnstructuredGridAlgorithm.h:40
vtkX3D::index
Definition: vtkX3D.h:246
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69