Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkGAMBITReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkGAMBITReader.h,v $
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 =========================================================================*/
00045 #ifndef __vtkGAMBITReader_h
00046 #define __vtkGAMBITReader_h
00047 
00048 #include "vtkUnstructuredGridSource.h"
00049 
00050 class vtkDoubleArray;
00051 class VTK_IO_EXPORT vtkGAMBITReader : public vtkUnstructuredGridSource
00052 {
00053 public:
00054   static vtkGAMBITReader *New();
00055   vtkTypeRevisionMacro(vtkGAMBITReader,vtkUnstructuredGridSource);
00056   void PrintSelf(ostream& os, vtkIndent indent);
00057 
00059 
00060   vtkSetStringMacro(FileName);
00061   vtkGetStringMacro(FileName);
00063 
00065 
00066   vtkGetMacro(NumberOfCells,int);
00068 
00070 
00071   vtkGetMacro(NumberOfNodes,int);
00073 
00075 
00076   vtkGetMacro(NumberOfNodeFields,int);
00077   vtkGetMacro(NumberOfCellFields,int);
00079 
00080 protected:
00081   vtkGAMBITReader();
00082   ~vtkGAMBITReader();
00083   void ExecuteInformation();
00084   void Execute();
00085 
00086   char *FileName;
00087 
00088   int NumberOfNodes;
00089   int NumberOfCells;
00090   int NumberOfNodeFields;
00091   int NumberOfCellFields;
00092   int NumberOfElementGroups;
00093   int NumberOfBoundaryConditionSets;
00094   int NumberOfCoordinateDirections;
00095   int NumberOfVelocityComponents;
00096   ifstream *FileStream;
00097 
00098   //BTX
00099   enum GAMBITCellType
00100   {
00101     EDGE    = 1,
00102     QUAD    = 2,
00103     TRI     = 3,
00104     BRICK   = 4,
00105     PRISM   = 5,
00106     TETRA   = 6,
00107     PYRAMID = 7
00108   };
00109   //ETX
00110 
00111 private:
00112   void ReadFile();
00113   void ReadGeometry();
00114   void ReadNodeData();
00115   void ReadCellData();
00116 
00117   void ReadXYZCoords(vtkDoubleArray *coords);
00118 
00119   void ReadCellConnectivity();
00120   void ReadMaterialTypes();
00121   void ReadBoundaryConditionSets();
00122 
00123   vtkGAMBITReader(const vtkGAMBITReader&);  // Not implemented.
00124   void operator=(const vtkGAMBITReader&);  // Not implemented.
00125 };
00126 
00127 #endif