VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkGAMBITReader.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00034 #ifndef __vtkGAMBITReader_h 00035 #define __vtkGAMBITReader_h 00036 00037 #include "vtkIOGeometryModule.h" // For export macro 00038 #include "vtkUnstructuredGridAlgorithm.h" 00039 00040 class vtkDoubleArray; 00041 class VTKIOGEOMETRY_EXPORT vtkGAMBITReader : public vtkUnstructuredGridAlgorithm 00042 { 00043 public: 00044 static vtkGAMBITReader *New(); 00045 vtkTypeMacro(vtkGAMBITReader,vtkUnstructuredGridAlgorithm); 00046 void PrintSelf(ostream& os, vtkIndent indent); 00047 00049 00050 vtkSetStringMacro(FileName); 00051 vtkGetStringMacro(FileName); 00053 00055 00057 vtkGetMacro(NumberOfCells,int); 00059 00061 00063 vtkGetMacro(NumberOfNodes,int); 00065 00067 00068 vtkGetMacro(NumberOfNodeFields,int); 00069 vtkGetMacro(NumberOfCellFields,int); 00071 00072 protected: 00073 vtkGAMBITReader(); 00074 ~vtkGAMBITReader(); 00075 int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00076 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00077 00078 char *FileName; 00079 00080 int NumberOfNodes; 00081 int NumberOfCells; 00082 int NumberOfNodeFields; 00083 int NumberOfCellFields; 00084 int NumberOfElementGroups; 00085 int NumberOfBoundaryConditionSets; 00086 int NumberOfCoordinateDirections; 00087 int NumberOfVelocityComponents; 00088 ifstream *FileStream; 00089 00090 //BTX 00091 enum GAMBITCellType 00092 { 00093 EDGE = 1, 00094 QUAD = 2, 00095 TRI = 3, 00096 BRICK = 4, 00097 PRISM = 5, 00098 TETRA = 6, 00099 PYRAMID = 7 00100 }; 00101 //ETX 00102 00103 private: 00104 void ReadFile(vtkUnstructuredGrid *output); 00105 void ReadGeometry(vtkUnstructuredGrid *output); 00106 void ReadNodeData(vtkUnstructuredGrid *output); 00107 void ReadCellData(vtkUnstructuredGrid *output); 00108 00109 void ReadXYZCoords(vtkDoubleArray *coords); 00110 00111 void ReadCellConnectivity(vtkUnstructuredGrid *output); 00112 void ReadMaterialTypes(vtkUnstructuredGrid *output); 00113 void ReadBoundaryConditionSets(vtkUnstructuredGrid *output); 00114 00115 vtkGAMBITReader(const vtkGAMBITReader&); // Not implemented. 00116 void operator=(const vtkGAMBITReader&); // Not implemented. 00117 }; 00118 00119 #endif