VTK
dox/IO/vtkEnSight6BinaryReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkEnSight6BinaryReader.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 =========================================================================*/
00037 #ifndef __vtkEnSight6BinaryReader_h
00038 #define __vtkEnSight6BinaryReader_h
00039 
00040 #include "vtkEnSightReader.h"
00041 
00042 class vtkMultiBlockDataSet;
00043 class vtkIdTypeArray;
00044 class vtkPoints;
00045 
00046 class VTK_IO_EXPORT vtkEnSight6BinaryReader : public vtkEnSightReader
00047 {
00048 public:
00049   static vtkEnSight6BinaryReader *New();
00050   vtkTypeMacro(vtkEnSight6BinaryReader, vtkEnSightReader);
00051   virtual void PrintSelf(ostream& os, vtkIndent indent);
00052   
00053 protected:
00054   vtkEnSight6BinaryReader();
00055   ~vtkEnSight6BinaryReader();
00056 
00057   // Returns 1 if successful.  Sets file size as a side action.
00058   int OpenFile(const char* filename);
00059   
00061 
00063   virtual int ReadGeometryFile(const char* fileName, int timeStep,
00064                                vtkMultiBlockDataSet *output);
00066 
00068 
00070   virtual int ReadMeasuredGeometryFile(const char* fileName, int timeStep,
00071                                        vtkMultiBlockDataSet *output);
00073 
00075 
00079   virtual int ReadScalarsPerNode(const char* fileName, const char* description,
00080                                  int timeStep, vtkMultiBlockDataSet *output,
00081                                  int measured = 0, int numberOfComponents = 1,
00082                                  int component = 0);
00084   
00086 
00088   virtual int ReadVectorsPerNode(const char* fileName, const char* description,
00089                                  int timeStep, vtkMultiBlockDataSet *output,
00090                                  int measured = 0);
00092 
00094 
00096   virtual int ReadTensorsPerNode(const char* fileName, const char* description,
00097                                  int timeStep, vtkMultiBlockDataSet *output);
00099 
00101 
00105   virtual int ReadScalarsPerElement(const char* fileName,
00106                                     const char* description, int timeStep,
00107                                     vtkMultiBlockDataSet *output,
00108                                     int numberOfComponents = 1,
00109                                     int component = 0);
00111 
00113 
00115   virtual int ReadVectorsPerElement(const char* fileName, const char* description,
00116                                     int timeStep, vtkMultiBlockDataSet *output);
00118 
00120 
00122   virtual int ReadTensorsPerElement(const char* fileName, const char* description,
00123                                     int timeStep, vtkMultiBlockDataSet *output);
00125 
00127 
00129   virtual int CreateUnstructuredGridOutput(int partId, 
00130                                            char line[256],
00131                                            const char* name,
00132                                            vtkMultiBlockDataSet *output);
00134   
00136 
00138   virtual int CreateStructuredGridOutput(int partId, 
00139                                          char line[256],
00140                                          const char* name,
00141                                          vtkMultiBlockDataSet *output);
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