VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
33 class vtkOverlappingAMR;
35 
37 {
38 public:
39  static vtkAMREnzoReader* New();
41  void PrintSelf(ostream &os, vtkIndent indent );
42 
44 
45  vtkSetMacro( ConvertToCGS, int );
46  vtkGetMacro( ConvertToCGS, int );
47  vtkBooleanMacro( ConvertToCGS, int );
49 
51  int GetNumberOfBlocks();
52 
54  int GetNumberOfLevels();
55 
57  void SetFileName( const char* fileName );
58 
59 protected:
62 
65  void ParseConversionFactors();
66 
69  int GetIndexFromArrayName( std::string arrayName );
70 
73  void ParseLabel(const std::string labelString,int &idx,std::string &label);
74 
77  void ParseCFactor(const std::string labelString, int &idx, double &factor );
78 
82  double GetConversionFactor( const std::string name );
83 
85  void ReadMetaData();
86 
88  int GetBlockLevel( const int blockIdx );
89 
90  void ComputeStats(vtkEnzoReaderInternal* internal, std::vector<int>& blocksPerLevel, double min[3]);
91 
93  int FillMetaData( );
94 
96  vtkUniformGrid* GetAMRGrid( const int blockIdx );
97 
99 
100  void GetAMRGridData(
101  const int blockIdx, vtkUniformGrid *block, const char *field);
103 
106 
108  bool IsReady;
109 
110 private:
111  vtkAMREnzoReader( const vtkAMREnzoReader& ); // Not Implemented
112  void operator=(const vtkAMREnzoReader& ); // Not Implemented
113 
114  vtkEnzoReaderInternal *Internal;
115 
116  std::map< std::string, int > label2idx;
117  std::map< int, double > conversionFactors;
118 };
119 
120 #endif /* VTKAMRENZOREADER_H_ */
virtual vtkUniformGrid * GetAMRGrid(const int blockIdx)=0
#define VTKIOAMR_EXPORT
virtual int GetNumberOfBlocks()=0
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
virtual void ReadMetaData()=0
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
GLuint const GLchar * name
Definition: vtkgl.h:11983
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
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
GLsizei const GLchar ** string
Definition: vtkgl.h:12011
static vtkOverlappingAMRAlgorithm * New()
virtual int FillMetaData()=0
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69
virtual void SetUpDataArraySelections()=0
virtual void SetFileName(const char *fileName)=0