• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

dox/IO/vtkEnSightReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkEnSightReader.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 =========================================================================*/
00019 #ifndef __vtkEnSightReader_h
00020 #define __vtkEnSightReader_h
00021 
00022 #include "vtkGenericEnSightReader.h"
00023 
00024 class vtkDataSet;
00025 class vtkDataSetCollection;
00026 class vtkEnSightReaderCellIdsType;
00027 class vtkIdList;
00028 class vtkMultiBlockDataSet;
00029 
00030 class VTK_IO_EXPORT vtkEnSightReader : public vtkGenericEnSightReader
00031 {
00032 public:
00033   vtkTypeRevisionMacro(vtkEnSightReader, vtkGenericEnSightReader);
00034   void PrintSelf(ostream& os, vtkIndent indent);
00035   
00036   //BTX
00037   enum ElementTypesList
00038   {
00039     POINT     = 0,
00040     BAR2      = 1,
00041     BAR3      = 2,
00042     NSIDED    = 3,
00043     TRIA3     = 4,
00044     TRIA6     = 5,
00045     QUAD4     = 6,
00046     QUAD8     = 7,
00047     NFACED    = 8,
00048     TETRA4    = 9,
00049     TETRA10   = 10,
00050     PYRAMID5  = 11,
00051     PYRAMID13 = 12,
00052     HEXA8     = 13,
00053     HEXA20    = 14,
00054     PENTA6    = 15,
00055     PENTA15   = 16,
00056     NUMBER_OF_ELEMENT_TYPES  = 17
00057   };
00058 
00059   enum VariableTypesList
00060   {
00061     SCALAR_PER_NODE            = 0,
00062     VECTOR_PER_NODE            = 1,
00063     TENSOR_SYMM_PER_NODE       = 2,
00064     SCALAR_PER_ELEMENT         = 3,
00065     VECTOR_PER_ELEMENT         = 4,
00066     TENSOR_SYMM_PER_ELEMENT    = 5,
00067     SCALAR_PER_MEASURED_NODE   = 6,
00068     VECTOR_PER_MEASURED_NODE   = 7,
00069     COMPLEX_SCALAR_PER_NODE    = 8,
00070     COMPLEX_VECTOR_PER_NODE    = 9,
00071     COMPLEX_SCALAR_PER_ELEMENT = 10,
00072     COMPLEX_VECTOR_PER_ELEMENT = 11
00073   };
00074 
00075   enum SectionTypeList
00076   {
00077     COORDINATES = 0,
00078     BLOCK       = 1,
00079     ELEMENT     = 2
00080   };
00081   //ETX
00082 
00084 
00086   vtkGetStringMacro(MeasuredFileName);
00088 
00090 
00092   vtkGetStringMacro(MatchFileName);
00094 
00096 
00104   vtkSetMacro(ParticleCoordinatesByIndex, int);
00105   vtkGetMacro(ParticleCoordinatesByIndex, int);
00106   vtkBooleanMacro(ParticleCoordinatesByIndex, int);
00108 
00109 protected:
00110   vtkEnSightReader();
00111   ~vtkEnSightReader();
00112   
00113   virtual int RequestInformation(vtkInformation*, 
00114                                  vtkInformationVector**, 
00115                                  vtkInformationVector*);
00116   virtual int RequestData(vtkInformation*, 
00117                           vtkInformationVector**, 
00118                           vtkInformationVector*);
00119 
00121 
00122   vtkSetStringMacro(MeasuredFileName);
00124 
00126 
00127   vtkSetStringMacro(MatchFileName);
00129 
00132   int ReadCaseFile();
00133 
00134   // set in UpdateInformation to value returned from ReadCaseFile
00135   int CaseFileRead;
00136   
00138 
00140   virtual int ReadGeometryFile(const char* fileName, int timeStep,
00141                                vtkMultiBlockDataSet *output) = 0;
00143 
00145 
00147   virtual int ReadMeasuredGeometryFile(const char* fileName, int timeStep,
00148                                        vtkMultiBlockDataSet *output) = 0;
00150 
00153   int ReadVariableFiles(vtkMultiBlockDataSet *output);
00154 
00156 
00158   virtual int ReadScalarsPerNode(const char* fileName, const char* description,
00159                                  int timeStep, vtkMultiBlockDataSet *output,
00160                                  int measured = 0, int numberOfComponents = 1,
00161                                  int component = 0) = 0;
00163   
00165 
00167   virtual int ReadVectorsPerNode(const char* fileName, const char* description,
00168                                  int timeStep, vtkMultiBlockDataSet *output,
00169                                  int measured = 0) = 0;
00171 
00173 
00175   virtual int ReadTensorsPerNode(const char* fileName, const char* description,
00176                                  int timeStep, vtkMultiBlockDataSet *output) = 0;
00178 
00180 
00182   virtual int ReadScalarsPerElement(const char* fileName, const char* description,
00183                                     int timeStep, vtkMultiBlockDataSet *output,
00184                                     int numberOfComponents = 1,
00185                                     int component = 0) = 0;
00187 
00189 
00191   virtual int ReadVectorsPerElement(const char* fileName, const char* description,
00192                                     int timeStep, vtkMultiBlockDataSet *output) = 0;
00194 
00196 
00198   virtual int ReadTensorsPerElement(const char* fileName, const char* description,
00199                                     int timeStep, vtkMultiBlockDataSet *output) = 0;
00201 
00203 
00205   virtual int CreateUnstructuredGridOutput(int partId, 
00206                                            char line[80],
00207                                            const char* name,
00208                                            vtkMultiBlockDataSet *output) = 0;
00210   
00212 
00214   virtual int CreateStructuredGridOutput(int partId, 
00215                                          char line[80],
00216                                          const char* name,
00217                                          vtkMultiBlockDataSet *output) = 0;
00219     
00221   void AddVariableFileName(const char* fileName1, const char* fileName2 = NULL);
00222   
00224   void AddVariableDescription(const char* description);
00225   
00227   void AddVariableType();
00228 
00231   int GetElementType(const char* line);
00232 
00235  int GetSectionType(const char *line);
00236 
00238   void ReplaceWildcards(char* filename, int num);
00239 
00241   void RemoveLeadingBlanks(char *line);
00242 
00243   // Get the vtkIdList for the given output index and cell type.
00244   vtkIdList* GetCellIds(int index, int cellType);
00245 
00247 
00249   void AddToBlock(vtkMultiBlockDataSet* output, 
00250                   unsigned int blockNo, 
00251                   vtkDataSet* dataset);
00253 
00255 
00257   vtkDataSet* GetDataSetFromBlock(vtkMultiBlockDataSet* output,
00258                                   unsigned int blockNo);
00260 
00262 
00263   void SetBlockName(vtkMultiBlockDataSet* output, unsigned int blockNo, 
00264     const char* name);
00266   
00267   char* MeasuredFileName;
00268   char* MatchFileName; // may not actually be necessary to read this file
00269 
00270   // pointer to lists of vtkIdLists (cell ids per element type per part)
00271   vtkEnSightReaderCellIdsType* CellIds;
00272   
00273   // part ids of unstructured outputs
00274   vtkIdList* UnstructuredPartIds;
00275   
00276   int VariableMode;
00277   
00278   // pointers to lists of filenames
00279   char** VariableFileNames; // non-complex
00280   char** ComplexVariableFileNames;
00281   
00282   // array of time sets
00283   vtkIdList *VariableTimeSetIds;
00284   vtkIdList *ComplexVariableTimeSetIds;
00285   
00286   // array of file sets
00287   vtkIdList *VariableFileSetIds;
00288   vtkIdList *ComplexVariableFileSetIds;
00289   
00290   // collection of filename numbers per time set
00291   vtkIdListCollection *TimeSetFileNameNumbers;
00292   vtkIdList *TimeSetsWithFilenameNumbers;
00293   
00294   // collection of filename numbers per file set
00295   vtkIdListCollection *FileSetFileNameNumbers;
00296   vtkIdList *FileSetsWithFilenameNumbers;
00297   
00298   // collection of number of steps per file per file set
00299   vtkIdListCollection *FileSetNumberOfSteps;
00300   
00301   // ids of the time and file sets
00302   vtkIdList *TimeSetIds;
00303   vtkIdList *FileSets;
00304   
00305   int GeometryTimeSet;
00306   int GeometryFileSet;
00307   int MeasuredTimeSet;
00308   int MeasuredFileSet;
00309   
00310   float GeometryTimeValue;
00311   float MeasuredTimeValue;
00312   
00313   int UseTimeSets;
00314   vtkSetMacro(UseTimeSets, int);
00315   vtkGetMacro(UseTimeSets, int);
00316   vtkBooleanMacro(UseTimeSets, int);
00317   
00318   int UseFileSets;
00319   vtkSetMacro(UseFileSets, int);
00320   vtkGetMacro(UseFileSets, int);
00321   vtkBooleanMacro(UseFileSets, int);
00322   
00323   int NumberOfGeometryParts;
00324   
00325   // global list of points for measured geometry
00326   int NumberOfMeasuredPoints;
00327   
00328   int NumberOfNewOutputs;
00329   int InitialRead;
00330   
00331   int CheckOutputConsistency();
00332 
00333   int ParticleCoordinatesByIndex;
00334   
00335   double ActualTimeValue;
00336 
00337 private:
00338   vtkEnSightReader(const vtkEnSightReader&);  // Not implemented.
00339   void operator=(const vtkEnSightReader&);  // Not implemented.
00340 };
00341 
00342 #endif

Generated by  doxygen 1.7.1