VTK
vtkXdmf3LightDataHandler.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXdmf3LightDataHandler.h
5  Language: C++
6 
7  Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
8  All rights reserved.
9  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notice for more information.
14 
15 =========================================================================*/
28 #ifndef vtkXdmf3LightDataHandler_h
29 #define vtkXdmf3LightDataHandler_h
30 
31 #include "vtkIOXdmf3Module.h" // For export macro
32 #include <set>
33 #include "XdmfItem.hpp"
34 #include "vtkType.h"
35 
36 class vtkXdmf3SILBuilder;
38 class XdmfItem;
39 class XdmfGraph;
40 class XdmfGrid;
41 
42 class VTKIOXDMF3_EXPORT vtkXdmf3LightDataHandler
43 {
44 public:
46 
47  static shared_ptr<vtkXdmf3LightDataHandler> New(
54  unsigned int processor,
55  unsigned int nprocessors);
57 
60 
62 
65  void InspectXDMF(shared_ptr<XdmfItem> item, vtkIdType parentVertex,
66  unsigned int depth=0);
68 
70  void ClearGridsIfNeeded(shared_ptr<XdmfItem> domain);
71 
74  std::set<double> getTimes();
75 
76 private:
79 
81  void InspectArrays(shared_ptr<XdmfItem> item);
82 
84  bool TooDeep(unsigned int depth);
85 
87  std::string UniqueName(std::string name, bool ForGrid);
88 
90 
91  void AddNamedBlock(vtkIdType parentVertex,
92  std::string originalName, std::string uniqueName);
94 
96  void AddNamedSet(std::string uniqueName);
97 
99 
101  void InspectTime(shared_ptr<XdmfItem> item);
102  void GetSetTime(shared_ptr<XdmfGrid> child, unsigned int &cnt);
103  void GetSetTime(shared_ptr<XdmfGraph> child, unsigned int &cnt);
105 
107  bool ShouldRead(unsigned int piece, unsigned int npieces);
108 
109  vtkXdmf3SILBuilder *SILBuilder;
110  vtkXdmf3ArraySelection *FieldArrays;
111  vtkXdmf3ArraySelection *CellArrays; //ie EdgeArrays for Graphs
112  vtkXdmf3ArraySelection *PointArrays; //ie NodeArrays for Graphs
113  vtkXdmf3ArraySelection *GridsCache;
114  vtkXdmf3ArraySelection *SetsCache;
115  unsigned int MaxDepth;
116  unsigned int Rank;
117  unsigned int NumProcs;
118  std::set<double> times; //relying on implicit sort from set<double>
119 };
120 
121 #endif //vtkXdmf3LightDataHandler_h
internal helper for vtkXdmf3Reader
int vtkIdType
Definition: vtkType.h:247
helper to allow block selection
helper to identify requested arrays with