VTK  9.2.6
vtkVPICReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkVPICReader.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 =========================================================================*/
32 #ifndef vtkVPICReader_h
33 #define vtkVPICReader_h
34 
35 #include "vtkIOVPICModule.h" // For export macro
36 #include "vtkImageAlgorithm.h"
37 
38 class vtkCallbackCommand;
40 class vtkFloatArray;
41 class vtkStdString;
43 class vtkInformation;
44 
45 class VPICDataSet;
46 class GridExchange;
47 
48 class VTKIOVPIC_EXPORT vtkVPICReader : public vtkImageAlgorithm
49 {
50 public:
51  static vtkVPICReader* New();
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
56 
59  vtkSetFilePathMacro(FileName);
60  vtkGetFilePathMacro(FileName);
62 
64 
67  vtkSetVector3Macro(Stride, int);
68  vtkGetVector3Macro(Stride, int);
70 
72 
75  vtkSetVector2Macro(XExtent, int);
76  vtkSetVector2Macro(YExtent, int);
77  vtkSetVector2Macro(ZExtent, int);
79 
80  // Get the full layout size in files for setting the range in GUI
81  vtkGetVector2Macro(XLayout, int);
82  vtkGetVector2Macro(YLayout, int);
83  vtkGetVector2Macro(ZLayout, int);
84 
86 
92 
94 
99  int GetNumberOfPointArrays();
100  const char* GetPointArrayName(int index);
101  int GetPointArrayStatus(const char* name);
102  void SetPointArrayStatus(const char* name, int status);
103  void DisableAllPointArrays();
104  void EnableAllPointArrays();
106 
107 protected:
108  vtkVPICReader();
109  ~vtkVPICReader() override;
110 
111  char* FileName; // First field part file giving path
112 
113  int Rank; // Number of this processor
114  int TotalRank; // Number of processors
115  int UsedRank; // Number of processors used in display
116 
117  VPICDataSet* vpicData; // Data structure controlling access
118  GridExchange* exchanger; // Exchange ghost cells between procs
119 
120  vtkIdType NumberOfNodes; // Number of points in grid
121  vtkIdType NumberOfCells; // Number of cells in grid
122  vtkIdType NumberOfTuples; // Number of tuples in sub extent
123 
124  int WholeExtent[6]; // Problem image extent
125  int SubExtent[6]; // Processor problem extent
126  int Dimension[3]; // Size of image
127  int SubDimension[3]; // Size of subextent of image
128  int XLayout[2]; // Extent in complete files
129  int YLayout[2]; // Extent in complete files
130  int ZLayout[2]; // Extent in complete files
131 
132  int NumberOfVariables; // Number of variables to display
133  vtkStdString* VariableName; // Names of each variable
134  int* VariableStruct; // Scalar, vector or tensor
135 
136  int NumberOfTimeSteps; // Temporal domain
137  double* TimeSteps; // Times available for request
138  int CurrentTimeStep; // Time currently displayed
139 
140  int Stride[3]; // Stride over actual data
141  int XExtent[2]; // Subview extent in files
142  int YExtent[2]; // Subview extent in files
143  int ZExtent[2]; // Subview extent in files
144 
145  vtkFloatArray** data; // Actual data arrays
146  int* dataLoaded; // Data is loaded for current time
147 
148  int Start[3]; // Start offset for processor w ghosts
149  int GhostDimension[3]; // Dimension including ghosts on proc
150  int NumberOfGhostTuples; // Total ghost cells per component
151  int ghostLevel0; // Left plane number of ghosts
152  int ghostLevel1; // Right plane number of ghosts
153 
154  // Controls initializing and querrying MPI
155  void SetMPIController(vtkMultiProcessController*);
157 
158  // Selected field of interest
160 
161  // Observer to modify this object when array selections are modified
163 
165  int RequestInformation(
167 
168  void LoadVariableData(int var, int timeStep);
169  void LoadComponent(float* varData, float* block, int comp, int numberOfComponents);
170 
171  static void SelectionCallback(
172  vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
173  static void EventCallback(vtkObject* caller, unsigned long eid, void* clientdata, void* calldata);
174 
175 private:
176  vtkVPICReader(const vtkVPICReader&) = delete;
177  void operator=(const vtkVPICReader&) = delete;
178 };
179 
180 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkFloatArray ** data
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:41
double * TimeSteps
int vtkIdType
Definition: vtkType.h:332
vtkCallbackCommand * SelectionObserver
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
class for reading VPIC data files
Definition: vtkVPICReader.h:48
GridExchange * exchanger
vtkDataArraySelection * PointDataArraySelection
vtkStdString * VariableName
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
Store on/off settings for data arrays, etc.
vtkIdType NumberOfCells
int * VariableStruct
Generic algorithm superclass for image algs.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType NumberOfTuples
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.
VPICDataSet * vpicData
vtkMultiProcessController * MPIController
vtkIdType NumberOfNodes
Multiprocessing communication superclass.