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

IO/vtkGenericEnSightReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkGenericEnSightReader.h,v $
00005   Language:  C++
00006 
00007 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00053 #ifndef __vtkGenericEnSightReader_h
00054 #define __vtkGenericEnSightReader_h
00055 
00056 #include "vtkEnSightReader.h"
00057 
00058 #define VTK_ENSIGHT_6    0
00059 #define VTK_ENSIGHT_6_BINARY 1
00060 #define VTK_ENSIGHT_GOLD 2
00061 #define VTK_ENSIGHT_GOLD_BINARY 3
00062 
00063 class VTK_IO_EXPORT vtkGenericEnSightReader : public vtkDataSetSource
00064 {
00065 public:
00066   static vtkGenericEnSightReader *New();
00067   vtkTypeMacro(vtkGenericEnSightReader, vtkDataSetSource);
00068   void PrintSelf(ostream& os, vtkIndent indent);
00069 
00071 
00072   void SetCaseFileName(char* fileName);
00073   vtkGetStringMacro(CaseFileName);
00075 
00077 
00078   vtkSetStringMacro(FilePath);
00079   vtkGetStringMacro(FilePath);
00081   
00082   void Update();
00083   
00085 
00086   int GetNumberOfVariables(int type); // returns -1 if unknown type specified
00087   vtkGetMacro(NumberOfScalarsPerNode, int);
00088   vtkGetMacro(NumberOfVectorsPerNode, int);
00089   vtkGetMacro(NumberOfTensorsSymmPerNode, int);
00090   vtkGetMacro(NumberOfScalarsPerElement, int);
00091   vtkGetMacro(NumberOfVectorsPerElement, int);
00092   vtkGetMacro(NumberOfTensorsSymmPerElement, int);
00093   vtkGetMacro(NumberOfScalarsPerMeasuredNode, int);
00094   vtkGetMacro(NumberOfVectorsPerMeasuredNode, int);
00095   vtkGetMacro(NumberOfComplexScalarsPerNode, int);
00096   vtkGetMacro(NumberOfComplexVectorsPerNode, int);
00097   vtkGetMacro(NumberOfComplexScalarsPerElement, int);
00098   vtkGetMacro(NumberOfComplexVectorsPerElement, int);
00100 
00102   char* GetDescription(int n);
00103   
00105   char* GetComplexDescription(int n);
00106   
00116   char* GetDescription(int n, int type);
00117   
00119 
00120   int GetVariableType(int n);
00121   int GetComplexVariableType(int n);
00123   
00125 
00126   vtkSetMacro(TimeValue, float);
00127   vtkGetMacro(TimeValue, float);
00129 
00131 
00132   vtkGetMacro(MinimumTimeValue, float);
00133   vtkGetMacro(MaximumTimeValue, float);
00135   
00136 protected:
00137   vtkGenericEnSightReader();
00138   ~vtkGenericEnSightReader();
00139 
00140   void Execute();
00141   
00146   int DetermineEnSightVersion();
00147 
00150   int ReadLine(char result[256]);
00151 
00154   int ReadBinaryLine(char result[80]);
00155   
00156   // Internal function that skips blank lines and reads the 1st
00157   // non-blank line it finds (up to 256 characters).
00158   // Returns 0 is there was an error.
00159   int ReadNextDataLine(char result[256]);
00160 
00162 
00163   vtkSetStringMacro(GeometryFileName);
00164   vtkGetStringMacro(GeometryFileName);
00166   
00168 
00169   void AddVariableDescription(char* description);
00170   void AddComplexVariableDescription(char* description);
00172 
00174 
00175   void AddVariableType(int variableType);
00176   void AddComplexVariableType(int variableType);
00178 
00180 
00182   void ReplaceWildcards(char* fileName, int timeSet, int fileSet);
00183   void ReplaceWildcardsHelper(char* fileName, int num);
00185   
00186   istream* IS;
00187   FILE *IFile;
00188   vtkEnSightReader *Reader;
00189   
00190   char* CaseFileName;
00191   char* GeometryFileName;
00192   char* FilePath;
00193 
00194   int* VariableTypes;
00195   int* ComplexVariableTypes;
00196   
00197   char** VariableDescriptions;
00198   char** ComplexVariableDescriptions;
00199   
00200   int NumberOfVariables;
00201   int NumberOfComplexVariables;
00202   
00203   // number of file names / descriptions per type
00204   int NumberOfScalarsPerNode;
00205   int NumberOfVectorsPerNode;
00206   int NumberOfTensorsSymmPerNode;
00207   int NumberOfScalarsPerElement;
00208   int NumberOfVectorsPerElement;
00209   int NumberOfTensorsSymmPerElement;
00210   int NumberOfScalarsPerMeasuredNode;
00211   int NumberOfVectorsPerMeasuredNode;
00212   int NumberOfComplexScalarsPerNode;
00213   int NumberOfComplexVectorsPerNode;  
00214   int NumberOfComplexScalarsPerElement;
00215   int NumberOfComplexVectorsPerElement;
00216   
00217   float TimeValue;
00218   float MinimumTimeValue;
00219   float MaximumTimeValue;
00220 private:
00221   vtkGenericEnSightReader(const vtkGenericEnSightReader&);  // Not implemented.
00222   void operator=(const vtkGenericEnSightReader&);  // Not implemented.
00223 };
00224 
00225 #endif

Generated on Thu Mar 28 14:19:28 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001