VTK
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 =========================================================================*/
29 #ifndef vtkVPICReader_h
30 #define vtkVPICReader_h
31 
32 #include "vtkIOVPICModule.h" // For export macro
33 #include "vtkImageAlgorithm.h"
34 
35 
36 class vtkCallbackCommand;
38 class vtkFloatArray;
39 class vtkStdString;
41 class vtkInformation;
42 
43 class VPICDataSet;
44 class GridExchange;
45 
46 class VTKIOVPIC_EXPORT vtkVPICReader : public vtkImageAlgorithm
47 {
48 public:
49  static vtkVPICReader *New();
51  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
52 
54 
57  vtkSetStringMacro(FileName);
58  vtkGetStringMacro(FileName);
60 
62 
65  vtkSetVector3Macro(Stride, int);
66  vtkGetVector3Macro(Stride, int);
68 
70 
73  vtkSetVector2Macro(XExtent, int);
74  vtkSetVector2Macro(YExtent, int);
75  vtkSetVector2Macro(ZExtent, int);
77 
78  // Get the full layout size in files for setting the range in GUI
79  vtkGetVector2Macro(XLayout, int);
80  vtkGetVector2Macro(YLayout, int);
81  vtkGetVector2Macro(ZLayout, int);
82 
84 
90 
92 
97  int GetNumberOfPointArrays();
98  const char* GetPointArrayName(int index);
99  int GetPointArrayStatus(const char* name);
100  void SetPointArrayStatus(const char* name, int status);
101  void DisableAllPointArrays();
102  void EnableAllPointArrays();
104 
105 protected:
106  vtkVPICReader();
107  ~vtkVPICReader();
108 
109  char *FileName; // First field part file giving path
110 
111  int Rank; // Number of this processor
112  int TotalRank; // Number of processors
113  int UsedRank; // Number of processors used in display
114 
115  VPICDataSet* vpicData; // Data structure controlling access
116  GridExchange* exchanger; // Exchange ghost cells between procs
117 
118  vtkIdType NumberOfNodes; // Number of points in grid
119  vtkIdType NumberOfCells; // Number of cells in grid
120  vtkIdType NumberOfTuples; // Number of tuples in sub extent
121 
122  int WholeExtent[6]; // Problem image extent
123  int SubExtent[6]; // Processor problem extent
124  int Dimension[3]; // Size of image
125  int SubDimension[3]; // Size of subextent of image
126  int XLayout[2]; // Extent in complete files
127  int YLayout[2]; // Extent in complete files
128  int ZLayout[2]; // Extent in complete files
129 
130  int NumberOfVariables; // Number of variables to display
131  vtkStdString* VariableName; // Names of each variable
132  int* VariableStruct; // Scalar, vector or tensor
133 
134  int NumberOfTimeSteps; // Temporal domain
135  double* TimeSteps; // Times available for request
136  int CurrentTimeStep; // Time currently displayed
137 
138  int Stride[3]; // Stride over actual data
139  int XExtent[2]; // Subview extent in files
140  int YExtent[2]; // Subview extent in files
141  int ZExtent[2]; // Subview extent in files
142 
143  vtkFloatArray** data; // Actual data arrays
144  int* dataLoaded; // Data is loaded for current time
145 
146  int Start[3]; // Start offset for processor w ghosts
147  int GhostDimension[3]; // Dimension including ghosts on proc
148  int NumberOfGhostTuples; // Total ghost cells per component
149  int ghostLevel0; // Left plane number of ghosts
150  int ghostLevel1; // Right plane number of ghosts
151 
152  // Controls initializing and querrying MPI
154 
155  // Selected field of interest
157 
158  // Observer to modify this object when array selections are modified
160 
162  vtkInformationVector *) VTK_OVERRIDE;
163  int RequestInformation(vtkInformation *, vtkInformationVector **inVector,
164  vtkInformationVector *) VTK_OVERRIDE;
165 
166  void LoadVariableData(int var, int timeStep);
167  void LoadComponent(
168  float* varData,
169  float* block,
170  int comp,
171  int numberOfComponents);
172 
173  static void SelectionCallback(vtkObject* caller, unsigned long eid,
174  void* clientdata, void* calldata);
175  static void EventCallback(vtkObject* caller, unsigned long eid,
176  void* clientdata, void* calldata);
177 
178 
179 private:
180  vtkVPICReader(const vtkVPICReader&) VTK_DELETE_FUNCTION;
181  void operator=(const vtkVPICReader&) VTK_DELETE_FUNCTION;
182 };
183 
184 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:41
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkFloatArray ** data
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
double * TimeSteps
int vtkIdType
Definition: vtkType.h:345
vtkCallbackCommand * SelectionObserver
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
class for reading VPIC data files
Definition: vtkVPICReader.h:46
GridExchange * exchanger
vtkDataArraySelection * PointDataArraySelection
vtkStdString * VariableName
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
Store on/off settings for data arrays for a vtkSource.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
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.