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