VTK
vtkAMREnzoReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMREnzoReader.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  =========================================================================*/
25 #ifndef VTKAMRENZOREADER_H_
26 #define VTKAMRENZOREADER_H_
27 
28 #include "vtkIOAMRModule.h" // For export macro
29 #include "vtkAMRBaseReader.h"
30 
31 #include <map> // For STL map
32 #include <string> // For std::string
33 
34 class vtkOverlappingAMR;
36 
38 {
39 public:
40  static vtkAMREnzoReader* New();
42  void PrintSelf(ostream &os, vtkIndent indent );
43 
45 
46  vtkSetMacro( ConvertToCGS, int );
47  vtkGetMacro( ConvertToCGS, int );
48  vtkBooleanMacro( ConvertToCGS, int );
50 
52  int GetNumberOfBlocks();
53 
55  int GetNumberOfLevels();
56 
58  void SetFileName( const char* fileName );
59 
60 protected:
63 
66  void ParseConversionFactors();
67 
70  int GetIndexFromArrayName( std::string arrayName );
71 
74  void ParseLabel(const std::string labelString,int &idx,std::string &label);
75 
78  void ParseCFactor(const std::string labelString, int &idx, double &factor );
79 
83  double GetConversionFactor( const std::string name );
84 
86  void ReadMetaData();
87 
89  int GetBlockLevel( const int blockIdx );
90 
91  void ComputeStats(vtkEnzoReaderInternal* internal, std::vector<int>& blocksPerLevel, double min[3]);
92 
94  int FillMetaData( );
95 
97  vtkUniformGrid* GetAMRGrid( const int blockIdx );
98 
100 
101  void GetAMRGridData(
102  const int blockIdx, vtkUniformGrid *block, const char *field);
104 
106 
108  const int vtkNotUsed(blockIdx), vtkUniformGrid *vtkNotUsed(block), const char *vtkNotUsed(field)) {;};
110 
113 
115  bool IsReady;
116 
117 private:
118  vtkAMREnzoReader( const vtkAMREnzoReader& ); // Not Implemented
119  void operator=(const vtkAMREnzoReader& ); // Not Implemented
120 
121  vtkEnzoReaderInternal *Internal;
122 
123  std::map< std::string, int > label2idx;
124  std::map< int, double > conversionFactors;
125 };
126 
127 #endif /* VTKAMRENZOREADER_H_ */
virtual vtkUniformGrid * GetAMRGrid(const int blockIdx)=0
#define VTKIOAMR_EXPORT
virtual int GetNumberOfBlocks()=0
virtual void ReadMetaData()=0
virtual int GetNumberOfLevels()=0
a simple class to control print indentation
Definition: vtkIndent.h:38
void PrintSelf(ostream &os, vtkIndent indent)
virtual void GetAMRGridData(const int blockIdx, vtkUniformGrid *block, const char *field)=0
virtual int GetBlockLevel(const int blockIdx)=0
image data with blanking
hierarchical dataset of vtkUniformGrids
void GetAMRGridPointData(const int vtkNotUsed(blockIdx), vtkUniformGrid *vtkNotUsed(block), const char *vtkNotUsed(field))
static vtkOverlappingAMRAlgorithm * New()
virtual int FillMetaData()=0
virtual void SetUpDataArraySelections()=0
virtual void SetFileName(const char *fileName)=0