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

vtkEnSightGoldBinaryReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkEnSightGoldBinaryReader.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 =========================================================================*/
00052 #ifndef __vtkEnSightGoldBinaryReader_h
00053 #define __vtkEnSightGoldBinaryReader_h
00054 
00055 #include "vtkEnSightReader.h"
00056 
00057 class VTK_IO_EXPORT vtkEnSightGoldBinaryReader : public vtkEnSightReader
00058 {
00059 public:
00060   static vtkEnSightGoldBinaryReader *New();
00061   vtkTypeRevisionMacro(vtkEnSightGoldBinaryReader, vtkEnSightReader);
00062   virtual void PrintSelf(ostream& os, vtkIndent indent);
00063  
00064 protected:
00065   vtkEnSightGoldBinaryReader();
00066   ~vtkEnSightGoldBinaryReader();
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 
00083   virtual int ReadScalarsPerNode(char* fileName, char* description,
00084                                  int timeStep, int measured = 0,
00085                                  int numberOfComponents = 1,
00086                                  int component = 0);
00088   
00090 
00092   virtual int ReadVectorsPerNode(char* fileName, char* description,
00093                                  int timeStep, int measured = 0);
00095 
00097 
00099   virtual int ReadTensorsPerNode(char* fileName, char* description,
00100                                  int timeStep);
00102 
00104 
00107   virtual int ReadScalarsPerElement(char* fileName, char* description,
00108                                     int timeStep, int numberOfComponents = 1,
00109                                     int component = 0);
00111 
00113 
00115   virtual int ReadVectorsPerElement(char* fileName, char* description,
00116                                     int timeStep);
00118 
00120 
00122   virtual int ReadTensorsPerElement(char* fileName, char* description,
00123                                     int timeStep);
00125 
00127 
00130   virtual int CreateUnstructuredGridOutput(int partId, 
00131                                            char line[80],
00132                                            const char* name);
00134   
00136 
00138   virtual int CreateStructuredGridOutput(int partId, 
00139                                          char line[256],
00140                                          const char* name);
00142   
00145   int CreateRectilinearGridOutput(int partId, char line[256], const char* name);
00146   
00149   int CreateImageDataOutput(int partId, char line[80], const char* name);
00150   
00153   int ReadLine(char result[80]);
00154 
00156 
00158   int ReadInt(int *result);
00159   int ReadPartId(int *result);
00161 
00164   int ReadIntArray(int *result, int numInts);
00165 
00168   int ReadFloatArray(float *result, int numFloats);
00169 
00171 
00172   int SkipTimeStep();
00173   int SkipStructuredGrid(char line[256]);
00174   int SkipUnstructuredGrid(char line[256]);
00175   int SkipRectilinearGrid(char line[256]);
00176   int SkipImageData(char line[256]);
00178   
00179   int NodeIdsListed;
00180   int ElementIdsListed;
00181   
00182   ifstream *IFile;
00183   // The size of the file could be used to choose byte order.
00184   int FileSize;
00185 
00186 private:
00187   vtkEnSightGoldBinaryReader(const vtkEnSightGoldBinaryReader&);  // Not implemented.
00188   void operator=(const vtkEnSightGoldBinaryReader&);  // Not implemented.
00189 };
00190 
00191 #endif