VTK  9.0.1
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 class vtkCallbackCommand;
36 
37 class VTKIONETCDF_EXPORT vtkNetCDFCAMReader : public vtkUnstructuredGridAlgorithm
38 {
39 public:
40  static vtkNetCDFCAMReader* New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
50  static int CanReadFile(const char* fileName);
51 
52  void SetFileName(const char* fileName);
53  vtkGetStringMacro(FileName);
54 
55  void SetConnectivityFileName(const char* fileName);
56  vtkGetStringMacro(ConnectivityFileName);
57 
59 
72  {
76  VERTICAL_DIMENSION_COUNT
77  };
78  vtkSetClampMacro(VerticalDimension, int, 0, 2);
79  vtkGetMacro(VerticalDimension, int);
81 
83 
89  vtkBooleanMacro(SingleMidpointLayer, vtkTypeBool);
90  vtkSetMacro(SingleMidpointLayer, vtkTypeBool);
91  vtkGetMacro(SingleMidpointLayer, vtkTypeBool);
92  vtkSetMacro(MidpointLayerIndex, int);
93  vtkGetMacro(MidpointLayerIndex, int);
94  vtkGetVector2Macro(MidpointLayersRange, int);
95 
96  vtkBooleanMacro(SingleInterfaceLayer, vtkTypeBool);
97  vtkSetMacro(SingleInterfaceLayer, vtkTypeBool);
98  vtkGetMacro(SingleInterfaceLayer, vtkTypeBool);
99  vtkSetMacro(InterfaceLayerIndex, int);
100  vtkGetMacro(InterfaceLayerIndex, int);
101  vtkGetVector2Macro(InterfaceLayersRange, int);
103 
105 
109  int GetNumberOfPointArrays();
110  const char* GetPointArrayName(int index);
111  int GetPointArrayStatus(const char* name);
112  void SetPointArrayStatus(const char* name, int status);
113  void DisableAllPointArrays();
114  void EnableAllPointArrays();
116 
117 protected:
119  ~vtkNetCDFCAMReader() override;
120 
122 
124 
126 
132  bool GetPartitioning(size_t piece, size_t numPieces, size_t numCellLevels,
133  size_t numCellsPerLevel, size_t& beginCellLevel, size_t& endCellLevel, size_t& beginCell,
134  size_t& endCell);
135 
136  void BuildVarArray();
137  static void SelectionCallback(
138  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
139 
140 private:
141  vtkNetCDFCAMReader(const vtkNetCDFCAMReader&) = delete;
142  void operator=(const vtkNetCDFCAMReader&) = delete;
143 
145 
149  char* FileName;
150  char* CurrentFileName;
151  vtkSetStringMacro(CurrentFileName);
153 
155 
158  char* ConnectivityFileName;
159  char* CurrentConnectivityFileName;
160  vtkSetStringMacro(CurrentConnectivityFileName);
162 
163  int VerticalDimension;
164  double* TimeSteps;
165  size_t NumberOfTimeSteps;
166  vtkDataArraySelection* PointDataArraySelection;
167  vtkCallbackCommand* SelectionObserver;
168 
169  vtkTypeBool SingleMidpointLayer;
170  int MidpointLayerIndex;
171  int MidpointLayersRange[2];
172 
173  vtkTypeBool SingleInterfaceLayer;
174  int InterfaceLayerIndex;
175  int InterfaceLayersRange[2];
176 
177  class Internal;
178  Internal* Internals;
179 };
180 
181 #endif
vtkNetCDFCAMReader
Read unstructured NetCDF CAM files.
Definition: vtkNetCDFCAMReader.h:37
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkNetCDFCAMReader::VERTICAL_DIMENSION_INTERFACE_LAYERS
@ VERTICAL_DIMENSION_INTERFACE_LAYERS
Definition: vtkNetCDFCAMReader.h:75
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:62
vtkDataArraySelection
Store on/off settings for data arrays for a vtkSource.
Definition: vtkDataArraySelection.h:34
vtkNetCDFCAMReader::VERTICAL_DIMENSION_SINGLE_LAYER
@ VERTICAL_DIMENSION_SINGLE_LAYER
Definition: vtkNetCDFCAMReader.h:73
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:71
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
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
@ VERTICAL_DIMENSION_MIDPOINT_LAYERS
Definition: vtkNetCDFCAMReader.h:74
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
@ index
Definition: vtkX3D.h:252
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69