00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00034 #ifndef __vtkGAMBITReader_h
00035 #define __vtkGAMBITReader_h
00036
00037 #include "vtkUnstructuredGridAlgorithm.h"
00038
00039 class vtkDoubleArray;
00040 class VTK_IO_EXPORT vtkGAMBITReader : public vtkUnstructuredGridAlgorithm
00041 {
00042 public:
00043 static vtkGAMBITReader *New();
00044 vtkTypeRevisionMacro(vtkGAMBITReader,vtkUnstructuredGridAlgorithm);
00045 void PrintSelf(ostream& os, vtkIndent indent);
00046
00048
00049 vtkSetStringMacro(FileName);
00050 vtkGetStringMacro(FileName);
00052
00054
00056 vtkGetMacro(NumberOfCells,int);
00058
00060
00062 vtkGetMacro(NumberOfNodes,int);
00064
00066
00067 vtkGetMacro(NumberOfNodeFields,int);
00068 vtkGetMacro(NumberOfCellFields,int);
00070
00071 protected:
00072 vtkGAMBITReader();
00073 ~vtkGAMBITReader();
00074 int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00075 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00076
00077 char *FileName;
00078
00079 int NumberOfNodes;
00080 int NumberOfCells;
00081 int NumberOfNodeFields;
00082 int NumberOfCellFields;
00083 int NumberOfElementGroups;
00084 int NumberOfBoundaryConditionSets;
00085 int NumberOfCoordinateDirections;
00086 int NumberOfVelocityComponents;
00087 ifstream *FileStream;
00088
00089
00090 enum GAMBITCellType
00091 {
00092 EDGE = 1,
00093 QUAD = 2,
00094 TRI = 3,
00095 BRICK = 4,
00096 PRISM = 5,
00097 TETRA = 6,
00098 PYRAMID = 7
00099 };
00100
00101
00102 private:
00103 void ReadFile(vtkUnstructuredGrid *output);
00104 void ReadGeometry(vtkUnstructuredGrid *output);
00105 void ReadNodeData(vtkUnstructuredGrid *output);
00106 void ReadCellData(vtkUnstructuredGrid *output);
00107
00108 void ReadXYZCoords(vtkDoubleArray *coords);
00109
00110 void ReadCellConnectivity(vtkUnstructuredGrid *output);
00111 void ReadMaterialTypes(vtkUnstructuredGrid *output);
00112 void ReadBoundaryConditionSets(vtkUnstructuredGrid *output);
00113
00114 vtkGAMBITReader(const vtkGAMBITReader&);
00115 void operator=(const vtkGAMBITReader&);
00116 };
00117
00118 #endif