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

vtkEnSight6BinaryReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkEnSight6BinaryReader.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 =========================================================================*/
00049 #ifndef __vtkEnSight6BinaryReader_h
00050 #define __vtkEnSight6BinaryReader_h
00051 
00052 #include "vtkEnSightReader.h"
00053 
00054 class vtkIdTypeArray;
00055 class vtkPoints;
00056 
00057 class VTK_IO_EXPORT vtkEnSight6BinaryReader : public vtkEnSightReader
00058 {
00059 public:
00060   static vtkEnSight6BinaryReader *New();
00061   vtkTypeRevisionMacro(vtkEnSight6BinaryReader, vtkEnSightReader);
00062   virtual void PrintSelf(ostream& os, vtkIndent indent);
00063   
00064 protected:
00065   vtkEnSight6BinaryReader();
00066   ~vtkEnSight6BinaryReader();
00067 
00068   // Returns 1 if successful.  Sets file size as a side action.
00069   int OpenFile(const char* filename);
00070   
00073   virtual int ReadGeometryFile(char* fileName, int timeStep);
00074 
00077   virtual int ReadMeasuredGeometryFile(char* fileName, int timeStep);
00078 
00080 
00084   virtual int ReadScalarsPerNode(char* fileName, char* description,
00085                                  int timeStep, int measured = 0,
00086                                  int numberOfComponents = 1,
00087                                  int component = 0);
00089   
00091 
00093   virtual int ReadVectorsPerNode(char* fileName, char* description,
00094                                  int timeStep, int measured = 0);
00096 
00098 
00100   virtual int ReadTensorsPerNode(char* fileName, char* description,
00101                                  int timeStep);
00103 
00105 
00109   virtual int ReadScalarsPerElement(char* fileName, char* description,
00110                                     int timeStep, int numberOfComponents = 1,
00111                                     int component = 0);
00113 
00115 
00117   virtual int ReadVectorsPerElement(char* fileName, char* description,
00118                                     int timeStep);
00120 
00122 
00124   virtual int ReadTensorsPerElement(char* fileName, char* description,
00125                                     int timeStep);
00127 
00129 
00131   virtual int CreateUnstructuredGridOutput(int partId, 
00132                                            char line[256],
00133                                            const char* name);
00135   
00137 
00139   virtual int CreateStructuredGridOutput(int partId, 
00140                                          char line[256],
00141                                          const char* name);
00143   
00146   int ReadLine(char result[80]);
00147 
00150   int ReadIntNumber(int *result);
00151 
00154   int ReadIntArray(int *result, int numInts);
00155 
00158   int ReadFloatArray(float *result, int numFloats);
00159 
00161 
00162   int SkipTimeStep();
00163   int SkipStructuredGrid(char line[256]);
00164   int SkipUnstructuredGrid(char line[256]);
00166   
00167   // global list of points for the unstructured parts of the model
00168   int NumberOfUnstructuredPoints;
00169   vtkPoints* UnstructuredPoints;
00170   vtkIdTypeArray* UnstructuredNodeIds; // matching of node ids to point ids
00171   
00172   int ElementIdsListed;
00173 
00174   // The size of the file is used to choose byte order.
00175   int FileSize;
00176   
00177   ifstream *IFile;
00178 private:
00179   vtkEnSight6BinaryReader(const vtkEnSight6BinaryReader&);  // Not implemented.
00180   void operator=(const vtkEnSight6BinaryReader&);  // Not implemented.
00181 };
00182 
00183 #endif
00184