VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkXdmfReader.h 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 =========================================================================*/ 00039 #ifndef vtkXdmfReader_h 00040 #define vtkXdmfReader_h 00041 00042 #include "vtkIOXdmf2Module.h" // For export macro 00043 #include "vtkDataReader.h" 00044 00045 class vtkXdmfArraySelection; 00046 class vtkXdmfDocument; 00047 class vtkGraph; 00048 00049 class VTKIOXDMF2_EXPORT vtkXdmfReader : public vtkDataReader 00050 { 00051 public: 00052 static vtkXdmfReader* New(); 00053 vtkTypeMacro(vtkXdmfReader, vtkDataReader); 00054 void PrintSelf(ostream& os, vtkIndent indent); 00055 00056 // Until needed, multiple domains are not supported. 00061 //unsigned int GetNumberOfDomains(); 00062 00064 00070 vtkSetStringMacro(DomainName); 00071 vtkGetStringMacro(DomainName); 00073 00077 // vtkGetStringMacro(ActiveDomainName); 00078 00082 int GetNumberOfPointArrays(); 00083 00086 const char* GetPointArrayName(int index); 00087 00089 00090 int GetPointArrayStatus(const char* name); 00091 void SetPointArrayStatus(const char* name, int status); 00093 00095 00098 int GetNumberOfCellArrays(); 00099 const char* GetCellArrayName(int index); 00100 void SetCellArrayStatus(const char* name, int status); 00101 int GetCellArrayStatus(const char* name); 00103 00105 00108 int GetNumberOfGrids(); 00109 const char* GetGridName(int index); 00110 void SetGridStatus(const char* gridname, int status); 00111 int GetGridStatus(const char* gridname); 00113 00115 00119 int GetNumberOfSets(); 00120 const char* GetSetName(int index); 00121 void SetSetStatus(const char* gridname, int status); 00122 int GetSetStatus(const char* gridname); 00124 00126 00128 int GetNumberOfSetArrays() { return this->GetNumberOfSets(); } 00129 const char* GetSetArrayName(int index) 00130 { return this->GetSetName(index); } 00131 int GetSetArrayStatus(const char* name) 00132 { return this->GetSetStatus(name); } 00134 00136 00138 vtkSetVector3Macro(Stride, int); 00139 vtkGetVector3Macro(Stride, int); 00141 00143 virtual int CanReadFile(const char* filename); 00144 00146 00147 vtkGetMacro(SILUpdateStamp, int); 00149 00152 virtual vtkGraph* GetSIL(); 00153 00154 //BTX 00155 protected: 00156 vtkXdmfReader(); 00157 ~vtkXdmfReader(); 00158 00159 virtual int ProcessRequest(vtkInformation *request, 00160 vtkInformationVector **inputVector, 00161 vtkInformationVector *outputVector); 00162 virtual int RequestDataObject(vtkInformationVector *outputVector); 00163 virtual int RequestData(vtkInformation *, vtkInformationVector **, 00164 vtkInformationVector *); 00165 virtual int RequestInformation(vtkInformation *, vtkInformationVector **, 00166 vtkInformationVector *); 00167 virtual int FillOutputPortInformation(int port, vtkInformation *info); 00168 00169 vtkXdmfArraySelection* GetPointArraySelection(); 00170 vtkXdmfArraySelection* GetCellArraySelection(); 00171 vtkXdmfArraySelection* GetGridSelection(); 00172 vtkXdmfArraySelection* GetSetsSelection(); 00173 void PassCachedSelections(); 00174 00175 char* DomainName; 00176 // char* ActiveDomainName; 00177 int Stride[3]; 00178 unsigned int LastTimeIndex; 00179 00180 vtkXdmfDocument* XdmfDocument; 00181 00182 // Until RequestInformation() is called, the active domain is not set 00183 // correctly. If SetGridStatus() etc. are called before that happens, then we 00184 // have no place to save the user choices. So we cache them in these temporary 00185 // caches. These are passed on to the actual vtkXdmfArraySelection instances 00186 // used by the active vtkXdmfDomain in RequestInformation(). 00187 // Note that these are only used until the first domain is setup, once that 00188 // happens, the information set in these is passed to the domain and these 00189 // are cleared an no longer used, until the active domain becomes invalid 00190 // again. 00191 vtkXdmfArraySelection* PointArraysCache; 00192 vtkXdmfArraySelection* CellArraysCache; 00193 vtkXdmfArraySelection* GridsCache; 00194 vtkXdmfArraySelection* SetsCache; 00195 00196 int SILUpdateStamp; 00197 private: 00199 bool PrepareDocument(); 00200 00203 int ChooseTimeStep(vtkInformation* outInfo); 00204 00205 private: 00206 vtkXdmfReader(const vtkXdmfReader&); // Not implemented 00207 void operator=(const vtkXdmfReader&); // Not implemented 00208 //ETX 00209 }; 00210 00211 #endif