VTK
dox/IO/Exodus/vtkCPExodusIIInSituReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCPExodusIIInSituReader.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 =========================================================================*/
00015 
00030 #ifndef __vtkCPExodusIIInSituReader_h
00031 #define __vtkCPExodusIIInSituReader_h
00032 
00033 #include "vtkIOExodusModule.h" // For export macro
00034 #include "vtkMultiBlockDataSetAlgorithm.h"
00035 #include "vtkNew.h" // For vtkNew
00036 #include <string> // For std::string
00037 #include <vector> // For std::vector
00038 
00039 class vtkDataArrayCollection;
00040 class vtkPointData;
00041 class vtkPoints;
00042 
00043 class VTKIOEXODUS_EXPORT vtkCPExodusIIInSituReader :
00044     public vtkMultiBlockDataSetAlgorithm
00045 {
00046 public:
00047   static vtkCPExodusIIInSituReader *New();
00048   vtkTypeMacro(vtkCPExodusIIInSituReader, vtkMultiBlockDataSetAlgorithm)
00049   virtual void PrintSelf(ostream &os, vtkIndent indent);
00050 
00052 
00053   vtkSetStringMacro(FileName)
00054   vtkGetStringMacro(FileName)
00056 
00058 
00059   vtkGetMacro(CurrentTimeStep, int)
00060   vtkSetMacro(CurrentTimeStep, int)
00062 
00064 
00067   vtkGetVector2Macro(TimeStepRange, int)
00069 
00071 
00072   double GetTimeStepValue(int step)
00073   {
00074     return TimeSteps.at(step);
00075   }
00077 
00078 protected:
00079   vtkCPExodusIIInSituReader();
00080   ~vtkCPExodusIIInSituReader();
00081 
00082   int ProcessRequest(vtkInformation *request,
00083                      vtkInformationVector **inputVector,
00084                      vtkInformationVector *outputVector);
00085   int RequestData(vtkInformation *, vtkInformationVector **,
00086                   vtkInformationVector *);
00087   int RequestInformation(vtkInformation *, vtkInformationVector **,
00088                          vtkInformationVector *);
00089 
00090 private:
00091   vtkCPExodusIIInSituReader(const vtkCPExodusIIInSituReader &); // Not implemented.
00092   void operator=(const vtkCPExodusIIInSituReader &);   // Not implemented.
00093 
00094   bool ExOpen();
00095   char *FileName;
00096   int FileId;
00097 
00098   bool ExGetMetaData();
00099   int NumberOfDimensions;
00100   int NumberOfNodes;
00101   int NumberOfElementBlocks;
00102   std::vector<std::string> NodalVariableNames;
00103   std::vector<std::string> ElementVariableNames;
00104   std::vector<int> ElementBlockIds;
00105   std::vector<double> TimeSteps;
00106   int TimeStepRange[2];
00107 
00108   bool ExGetCoords();
00109   vtkNew<vtkPoints> Points;
00110 
00111   bool ExGetNodalVars();
00112   vtkNew<vtkPointData> PointData;
00113 
00114   bool ExGetElemBlocks();
00115   vtkNew<vtkMultiBlockDataSet> ElementBlocks;
00116 
00117   void ExClose();
00118 
00119   int CurrentTimeStep;
00120 };
00121 
00122 #endif //__vtkCPExodusIIInSituReader_h