VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkXdmf3LightDataHandler.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 =========================================================================*/ 00031 #ifndef vtkXdmf3LightDataHandler_h 00032 #define vtkXdmf3LightDataHandler_h 00033 00034 #include "vtkIOXdmf3Module.h" // For export macro 00035 #include <set> 00036 #include "XdmfItem.hpp" 00037 #include "vtkType.h" 00038 00039 class vtkXdmf3SILBuilder; 00040 class vtkXdmf3ArraySelection; 00041 class XdmfItem; 00042 class XdmfGraph; 00043 class XdmfGrid; 00044 00045 class VTKIOXDMF3_EXPORT vtkXdmf3LightDataHandler 00046 { 00047 public: 00049 00050 static shared_ptr<vtkXdmf3LightDataHandler> New( 00051 vtkXdmf3SILBuilder *sb, 00052 vtkXdmf3ArraySelection* f, 00053 vtkXdmf3ArraySelection* ce, 00054 vtkXdmf3ArraySelection* pn, 00055 vtkXdmf3ArraySelection* gc, 00056 vtkXdmf3ArraySelection* sc, 00057 unsigned int processor, 00058 unsigned int nprocessors); 00060 00062 ~vtkXdmf3LightDataHandler(); 00063 00065 00068 void InspectXDMF(shared_ptr<XdmfItem> item, vtkIdType parentVertex, 00069 unsigned int depth=0); 00071 00073 void ClearGridsIfNeeded(shared_ptr<XdmfItem> domain); 00074 00077 std::set<double> getTimes(); 00078 00079 private: 00081 vtkXdmf3LightDataHandler(); 00082 00084 void InspectArrays(shared_ptr<XdmfItem> item); 00085 00087 bool TooDeep(unsigned int depth); 00088 00090 std::string UniqueName(std::string name, bool ForGrid); 00091 00093 00094 void AddNamedBlock(vtkIdType parentVertex, 00095 std::string originalName, std::string uniqueName); 00097 00099 void AddNamedSet(std::string uniqueName); 00100 00102 00104 void InspectTime(shared_ptr<XdmfItem> item); 00105 void GetSetTime(shared_ptr<XdmfGrid> child, unsigned int &cnt); 00106 void GetSetTime(shared_ptr<XdmfGraph> child, unsigned int &cnt); 00108 00110 bool ShouldRead(unsigned int piece, unsigned int npieces); 00111 00112 vtkXdmf3SILBuilder *SILBuilder; 00113 vtkXdmf3ArraySelection *FieldArrays; 00114 vtkXdmf3ArraySelection *CellArrays; //ie EdgeArrays for Graphs 00115 vtkXdmf3ArraySelection *PointArrays; //ie NodeArrays for Graphs 00116 vtkXdmf3ArraySelection *GridsCache; 00117 vtkXdmf3ArraySelection *SetsCache; 00118 unsigned int MaxDepth; 00119 unsigned int Rank; 00120 unsigned int NumProcs; 00121 std::set<double> times; //relying on implicit sort from set<double> 00122 }; 00123 00124 #endif //vtkXdmf3LightDataHandler_h