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