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

IO/vtkEnSightReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkEnSightReader.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00023 #ifndef __vtkEnSightReader_h
00024 #define __vtkEnSightReader_h
00025 
00026 #include "vtkGenericEnSightReader.h"
00027 
00028 class vtkDataSetCollection;
00029 class vtkIdList;
00030 
00031 class VTK_IO_EXPORT vtkEnSightReader : public vtkGenericEnSightReader
00032 {
00033 public:
00034   vtkTypeRevisionMacro(vtkEnSightReader, vtkGenericEnSightReader);
00035   void PrintSelf(ostream& os, vtkIndent indent);
00036   
00037   void Update();
00038   void ExecuteInformation();
00039   
00040   //BTX
00041   enum ElementTypesList
00042   {
00043     POINT     = 0,
00044     BAR2      = 1,
00045     BAR3      = 2,
00046     NSIDED    = 3,
00047     TRIA3     = 4,
00048     TRIA6     = 5,
00049     QUAD4     = 6,
00050     QUAD8     = 7,
00051     TETRA4    = 8,
00052     TETRA10   = 9,
00053     PYRAMID5  = 10,
00054     PYRAMID13 = 11,
00055     HEXA8     = 12,
00056     HEXA20    = 13,
00057     PENTA6    = 14,
00058     PENTA15   = 15
00059   };
00060 
00061   enum VariableTypesList
00062   {
00063     SCALAR_PER_NODE            = 0,
00064     VECTOR_PER_NODE            = 1,
00065     TENSOR_SYMM_PER_NODE       = 2,
00066     SCALAR_PER_ELEMENT         = 3,
00067     VECTOR_PER_ELEMENT         = 4,
00068     TENSOR_SYMM_PER_ELEMENT    = 5,
00069     SCALAR_PER_MEASURED_NODE   = 6,
00070     VECTOR_PER_MEASURED_NODE   = 7,
00071     COMPLEX_SCALAR_PER_NODE    = 8,
00072     COMPLEX_VECTOR_PER_NODE    = 9,
00073     COMPLEX_SCALAR_PER_ELEMENT = 10,
00074     COMPLEX_VECTOR_PER_ELEMENT = 11
00075   };
00076   //ETX
00077 
00081   void ReplaceNthOutput(int n, vtkDataObject* output);
00082   
00084 
00090   vtkGetMacro(OutputsAreValid, int);
00092   
00093 protected:
00094   vtkEnSightReader();
00095   ~vtkEnSightReader();
00096   
00097   void Execute();
00098 
00101   int ReadCaseFile();
00102 
00103   // set in UpdateInformation to value returned from ReadCaseFile
00104   int CaseFileRead;
00105   
00108   virtual int ReadGeometryFile(char* fileName, int timeStep) = 0;
00109 
00112   virtual int ReadMeasuredGeometryFile(char* fileName, int timeStep) = 0;
00113 
00116   int ReadVariableFiles();
00117 
00119 
00121   virtual int ReadScalarsPerNode(char* fileName, char* description,
00122                                  int timeStep, int measured = 0,
00123                                  int numberOfComponents = 1,
00124                                  int component = 0) = 0;
00126   
00128 
00130   virtual int ReadVectorsPerNode(char* fileName, char* description,
00131                                  int timeStep, int measured = 0) = 0;
00133 
00135 
00137   virtual int ReadTensorsPerNode(char* fileName, char* description,
00138                                  int timeStep) = 0;
00140 
00142 
00144   virtual int ReadScalarsPerElement(char* fileName, char* description,
00145                                     int timeStep, int numberOfComponents = 1,
00146                                     int component = 0) = 0;
00148 
00150 
00152   virtual int ReadVectorsPerElement(char* fileName, char* description,
00153                                     int timeStep) = 0;
00155 
00157 
00159   virtual int ReadTensorsPerElement(char* fileName, char* description,
00160                                     int timeStep) = 0;
00162 
00165   virtual int CreateUnstructuredGridOutput(int partId, char line[256]) = 0;
00166   
00169   virtual int CreateStructuredGridOutput(int partId, char line[256]) = 0;
00170   
00172 
00173   vtkSetStringMacro(GeometryFileName);
00174   vtkGetStringMacro(GeometryFileName);
00176 
00178 
00179   vtkSetStringMacro(MeasuredFileName);
00180   vtkGetStringMacro(MeasuredFileName);
00182 
00184 
00185   vtkSetStringMacro(MatchFileName);
00186   vtkGetStringMacro(MatchFileName);
00188   
00190   void AddVariableFileName(char* fileName1, char* fileName2 = NULL);
00191   
00193   void AddVariableDescription(char* description);
00194   
00196   void AddVariableType();
00197 
00200   int GetElementType(char* line);
00201 
00203   void ReplaceWildcards(char* filename, int num);
00204   
00205   char* MeasuredFileName;
00206   char* MatchFileName; // may not actually be necessary to read this file
00207 
00208   // pointer to lists of vtkIdLists (cell ids per element type per part)
00209   vtkIdList*** CellIds;
00210   
00211   // part ids of unstructured outputs
00212   vtkIdList* UnstructuredPartIds;
00213   
00214   int VariableMode;
00215   
00216   // pointers to lists of filenames
00217   char** VariableFileNames; // non-complex
00218   char** ComplexVariableFileNames;
00219   
00220   // array of time sets
00221   vtkIdList *VariableTimeSetIds;
00222   vtkIdList *ComplexVariableTimeSetIds;
00223   
00224   // array of file sets
00225   vtkIdList *VariableFileSetIds;
00226   vtkIdList *ComplexVariableFileSetIds;
00227   
00228   // collection of filename numbers per time set
00229   vtkIdListCollection *TimeSetFileNameNumbers;
00230   vtkIdList *TimeSetsWithFilenameNumbers;
00231   
00232   // collection of filename numbers per file set
00233   vtkIdListCollection *FileSetFileNameNumbers;
00234   vtkIdList *FileSetsWithFilenameNumbers;
00235   
00236   // collection of number of steps per file per file set
00237   vtkIdListCollection *FileSetNumberOfSteps;
00238   
00239   // ids of the time and file sets
00240   vtkIdList *TimeSetIds;
00241   vtkIdList *FileSets;
00242   
00243   int GeometryTimeSet;
00244   int GeometryFileSet;
00245   int MeasuredTimeSet;
00246   int MeasuredFileSet;
00247   
00248   float GeometryTimeValue;
00249   float MeasuredTimeValue;
00250   
00251   int UseTimeSets;
00252   vtkSetMacro(UseTimeSets, int);
00253   vtkGetMacro(UseTimeSets, int);
00254   vtkBooleanMacro(UseTimeSets, int);
00255   
00256   int UseFileSets;
00257   vtkSetMacro(UseFileSets, int);
00258   vtkGetMacro(UseFileSets, int);
00259   vtkBooleanMacro(UseFileSets, int);
00260   
00261   int NumberOfGeometryParts;
00262   
00263   void SetNumberOfOutputsInternal(int num);
00264 
00265   // global list of points for measured geometry
00266   int NumberOfMeasuredPoints;
00267   vtkIdList *MeasuredNodeIds;
00268   
00269   int NumberOfNewOutputs;
00270   int OutputsAreValid;
00271   int InitialRead;
00272   
00273   int CheckOutputConsistency();
00274   
00275 private:
00276   vtkEnSightReader(const vtkEnSightReader&);  // Not implemented.
00277   void operator=(const vtkEnSightReader&);  // Not implemented.
00278 };
00279 
00280 #endif