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 =========================================================================*/
26#ifndef vtkAMREnzoReader_h
27#define vtkAMREnzoReader_h
28
29#include "vtkIOAMRModule.h" // For export macro
30#include "vtkAMRBaseReader.h"
31
32#include <map> // For STL map
33#include <string> // For std::string
34
37
38class VTKIOAMR_EXPORT vtkAMREnzoReader : public vtkAMRBaseReader
39{
40public:
43 void PrintSelf(ostream &os, vtkIndent indent );
44
46
49 vtkSetMacro( ConvertToCGS, int );
50 vtkGetMacro( ConvertToCGS, int );
51 vtkBooleanMacro( ConvertToCGS, int );
53
58
63
67 void SetFileName( const char* fileName );
68
69protected:
72
79
85
90 void ParseLabel(const std::string &labelString, int &idx, std::string &label);
91
96 void ParseCFactor(const std::string &labelString, int &idx, double &factor );
97
104
109
113 int GetBlockLevel( const int blockIdx );
114
115 void ComputeStats(vtkEnzoReaderInternal* internal, std::vector<int>& blocksPerLevel, double min[3]);
116
121
125 vtkUniformGrid* GetAMRGrid( const int blockIdx );
126
131 const int blockIdx, vtkUniformGrid *block, const char *field);
132
137 const int vtkNotUsed(blockIdx), vtkUniformGrid *vtkNotUsed(block), const char *vtkNotUsed(field)) {;};
138
143
146
147private:
148 vtkAMREnzoReader( const vtkAMREnzoReader& ) VTK_DELETE_FUNCTION;
149 void operator=(const vtkAMREnzoReader& ) VTK_DELETE_FUNCTION;
150
151 vtkEnzoReaderInternal *Internal;
152
153 std::map< std::string, int > label2idx;
154 std::map< int, double > conversionFactors;
155};
156
157#endif /* vtkAMREnzoReader_h */
An abstract class that encapsulates common functionality for all AMR readers.
A concrete instance of vtkAMRBaseReader that implements functionality for reading Enzo AMR datasets.
void ParseLabel(const std::string &labelString, int &idx, std::string &label)
Given the label string, this method parses the attribute label and the string index.
int GetNumberOfBlocks()
See vtkAMRBaseReader::GetNumberOfBlocks.
vtkUniformGrid * GetAMRGrid(const int blockIdx)
See vtkAMRBaseReader::GetAMRGrid.
void GetAMRGridData(const int blockIdx, vtkUniformGrid *block, const char *field)
See vtkAMRBaseReader::GetAMRGridData.
void SetFileName(const char *fileName)
See vtkAMRBaseReader::SetFileName.
int GetBlockLevel(const int blockIdx)
See vtkAMRBaseReader::GetBlockLevel.
void ReadMetaData()
See vtkAMRBaseReader::ReadMetaData.
void ComputeStats(vtkEnzoReaderInternal *internal, std::vector< int > &blocksPerLevel, double min[3])
int GetNumberOfLevels()
See vtkAMRBaseReader::GetNumberOfLevels.
void SetUpDataArraySelections()
See vtkAMRBaseReader::SetUpDataArraySelections.
void ParseCFactor(const std::string &labelString, int &idx, double &factor)
Given the label string, this method parses the corresponding attribute index and conversion factor.
void ParseConversionFactors()
Parses the parameters file and extracts the conversion factors that are used to convert to CGS units.
int FillMetaData()
See vtkAMRBaseReader::FillMetaData.
double GetConversionFactor(const std::string &name)
Given the variable name, return the conversion factor used to convert the data to CGS.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static vtkAMREnzoReader * New()
int GetIndexFromArrayName(std::string arrayName)
Given an array name of the form "array[idx]" this method extracts and returns the corresponding index...
void GetAMRGridPointData(const int vtkNotUsed(blockIdx), vtkUniformGrid *vtkNotUsed(block), const char *vtkNotUsed(field))
See vtkAMRBaseReader::GetAMRGridData.
a simple class to control print indentation
Definition: vtkIndent.h:40
hierarchical dataset of vtkUniformGrids
image data with blanking
@ field
Definition: vtkX3D.h:177
@ name
Definition: vtkX3D.h:219
@ string
Definition: vtkX3D.h:490
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.