VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkAMRBaseReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMRBaseReader.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  =========================================================================*/
21 #ifndef VTKAMRBASEREADER_H_
22 #define VTKAMRBASEREADER_H_
23 
24 #include "vtkIOAMRModule.h" // For export macro
26 #include <vector> // STL vector header
27 #include <map> // STL map header
28 #include <utility> // for STL pair
29 
30 // Forward Declarations
31 class vtkOverlappingAMR;
34 class vtkCallbackCommand;
35 class vtkIndent;
36 class vtkAMRDataSetCache;
37 class vtkUniformGrid;
38 class vtkDataArray;
39 
42 {
43 public:
45  void PrintSelf(ostream &os, vtkIndent indent);
46 
49  void Initialize();
50 
52 
53  vtkSetMacro( EnableCaching, int );
54  vtkGetMacro( EnableCaching, int );
55  vtkBooleanMacro( EnableCaching, int );
56  bool IsCachingEnabled() const
57  {
58  return( (this->EnableCaching)?true:false);
59  };
61 
63 
65  vtkSetMacro( Controller, vtkMultiProcessController* );
66  vtkGetMacro( Controller, vtkMultiProcessController* );
68 
70 
71  vtkSetMacro( MaxLevel,int);
73 
75 
77  vtkGetObjectMacro(CellDataArraySelection, vtkDataArraySelection);
78  vtkGetObjectMacro(PointDataArraySelection, vtkDataArraySelection);
80 
82 
83  int GetNumberOfPointArrays();
84  int GetNumberOfCellArrays();
86 
88 
90  const char* GetPointArrayName(int index);
91  const char* GetCellArrayName(int index);
93 
95 
97  int GetPointArrayStatus(const char* name);
98  int GetCellArrayStatus(const char* name);
99  void SetPointArrayStatus(const char* name, int status);
100  void SetCellArrayStatus(const char* name, int status);
102 
104 
106  vtkGetStringMacro( FileName );
107  virtual void SetFileName( const char *fileName ) = 0;
109 
112  virtual int GetNumberOfBlocks() = 0;
113 
116  virtual int GetNumberOfLevels() = 0;
117 
118 protected:
120  virtual ~vtkAMRBaseReader();
121 
122  // Desscription:
123  // Checks if this reader instance is attached to a communicator
124  // with more than one MPI processes.
125  bool IsParallel();
126 
129  bool IsBlockMine( const int blockIdx );
130 
134  vtkUniformGrid* GetAMRBlock( const int blockIdx );
135 
139  void AssignAndLoadBlocks( vtkOverlappingAMR *amrds );
140 
146  void LoadRequestedBlocks( vtkOverlappingAMR *amrds );
147 
149 
151  void GetAMRData(
152  const int blockIdx, vtkUniformGrid *block, const char *fieldName );
154 
158  void LoadPointData( const int blockIdx, vtkUniformGrid *block );
159 
164  void LoadCellData( const int blockIdx, vtkUniformGrid *block );
165 
172  int GetBlockProcessId( const int blockIdx );
173 
179  void SetupBlockRequest( vtkInformation *outputInfo );
180 
183  virtual void ReadMetaData() = 0;
184 
186  virtual int GetBlockLevel( const int blockIdx ) = 0;
187 
191  virtual int FillMetaData( ) = 0;
192 
194  virtual vtkUniformGrid* GetAMRGrid( const int blockIdx ) = 0;
195 
197 
198  virtual void GetAMRGridData(
199  const int blockIdx, vtkUniformGrid *block, const char *field ) = 0;
201 
203 
205  virtual int RequestData(
206  vtkInformation* vtkNotUsed(request),
207  vtkInformationVector** vtkNotUsed(inputVector),
208  vtkInformationVector* outputVector );
209  virtual int RequestInformation(
210  vtkInformation* rqst,
211  vtkInformationVector** inputVector,
212  vtkInformationVector* outputVector );
215 
216  // Array selection member variables and methods
220 
224  void InitializeArraySelections();
225 
227  virtual void SetUpDataArraySelections() = 0;
228 
230 
231  static void SelectionModifiedCallback(
232  vtkObject *caller,unsigned long eid,void *clientdata,void *calldata );
234 
236  int MaxLevel;
237  char *FileName;
239 
244 
247 
248 
249  //BTX
250  std::vector<int> BlockMap;
251  //ETX
252 
253 private:
254  vtkAMRBaseReader( const vtkAMRBaseReader& ); // Not implemented
255  void operator=( const vtkAMRBaseReader& ); // Not implemented
256 };
257 
258 #endif /* VTKAMRBASEREADER_H_ */
void PrintSelf(ostream &os, vtkIndent indent)
abstract base class for most VTK objects
Definition: vtkObject.h:61
GLuint index
Definition: vtkgl.h:11983
Store vtkAlgorithm input/output information.
vtkCallbackCommand * SelectionObserver
#define VTKIOAMR_EXPORT
vtkDataArraySelection * CellDataArraySelection
vtkMultiProcessController * Controller
bool IsCachingEnabled() const
std::vector< int > BlockMap
vtkDataArraySelection * PointDataArraySelection
supports function callbacks
GLuint const GLchar * name
Definition: vtkgl.h:11983
virtual int FillOutputPortInformation(int port, vtkInformation *info)
a simple class to control print indentation
Definition: vtkIndent.h:38
Store on/off settings for data arrays for a vtkSource.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
image data with blanking
vtkOverlappingAMR * Metadata
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
hierarchical dataset of vtkUniformGrids
Store zero or more vtkInformation instances.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkAMRDataSetCache * Cache
Multiprocessing communication superclass.