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