VTK
dox/IO/EnSight/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 "vtkIOEnSightModule.h" // For export macro
00041 #include "vtkEnSightReader.h"
00042 
00043 class vtkMultiBlockDataSet;
00044 class vtkIdTypeArray;
00045 class vtkPoints;
00046 
00047 class VTKIOENSIGHT_EXPORT vtkEnSight6BinaryReader : public vtkEnSightReader
00048 {
00049 public:
00050   static vtkEnSight6BinaryReader *New();
00051   vtkTypeMacro(vtkEnSight6BinaryReader, vtkEnSightReader);
00052   virtual void PrintSelf(ostream& os, vtkIndent indent);
00053 
00054 protected:
00055   vtkEnSight6BinaryReader();
00056   ~vtkEnSight6BinaryReader();
00057 
00058   // Returns 1 if successful.  Sets file size as a side action.
00059   int OpenFile(const char* filename);
00060 
00062 
00064   virtual int ReadGeometryFile(const char* fileName, int timeStep,
00065                                vtkMultiBlockDataSet *output);
00067 
00069 
00071   virtual int ReadMeasuredGeometryFile(const char* fileName, int timeStep,
00072                                        vtkMultiBlockDataSet *output);
00074 
00076 
00080   virtual int ReadScalarsPerNode(const char* fileName, const char* description,
00081                                  int timeStep, vtkMultiBlockDataSet *output,
00082                                  int measured = 0, int numberOfComponents = 1,
00083                                  int component = 0);
00085 
00087 
00089   virtual int ReadVectorsPerNode(const char* fileName, const char* description,
00090                                  int timeStep, vtkMultiBlockDataSet *output,
00091                                  int measured = 0);
00093 
00095 
00097   virtual int ReadTensorsPerNode(const char* fileName, const char* description,
00098                                  int timeStep, vtkMultiBlockDataSet *output);
00100 
00102 
00106   virtual int ReadScalarsPerElement(const char* fileName,
00107                                     const char* description, int timeStep,
00108                                     vtkMultiBlockDataSet *output,
00109                                     int numberOfComponents = 1,
00110                                     int component = 0);
00112 
00114 
00116   virtual int ReadVectorsPerElement(const char* fileName, const char* description,
00117                                     int timeStep, vtkMultiBlockDataSet *output);
00119 
00121 
00123   virtual int ReadTensorsPerElement(const char* fileName, const char* description,
00124                                     int timeStep, vtkMultiBlockDataSet *output);
00126 
00128 
00130   virtual int CreateUnstructuredGridOutput(int partId,
00131                                            char line[256],
00132                                            const char* name,
00133                                            vtkMultiBlockDataSet *output);
00135 
00137 
00139   virtual int CreateStructuredGridOutput(int partId,
00140                                          char line[256],
00141                                          const char* name,
00142                                          vtkMultiBlockDataSet *output);
00144 
00147   int ReadLine(char result[80]);
00148 
00151   int ReadIntNumber(int *result);
00152 
00155   int ReadIntArray(int *result, int numInts);
00156 
00159   int ReadFloatArray(float *result, int numFloats);
00160 
00162 
00163   int SkipTimeStep();
00164   int SkipStructuredGrid(char line[256]);
00165   int SkipUnstructuredGrid(char line[256]);
00167 
00168   // global list of points for the unstructured parts of the model
00169   int NumberOfUnstructuredPoints;
00170   vtkPoints* UnstructuredPoints;
00171   vtkIdTypeArray* UnstructuredNodeIds; // matching of node ids to point ids
00172 
00173   int ElementIdsListed;
00174 
00175   // The size of the file is used to choose byte order.
00176   int FileSize;
00177 
00178   ifstream *IFile;
00179 private:
00180   vtkEnSight6BinaryReader(const vtkEnSight6BinaryReader&);  // Not implemented.
00181   void operator=(const vtkEnSight6BinaryReader&);  // Not implemented.
00182 };
00183 
00184 #endif
00185