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:
48  static shared_ptr<vtkXdmf3LightDataHandler> New(
55  unsigned int processor,
56  unsigned int nprocessors);
57 
62 
69  void InspectXDMF(shared_ptr<XdmfItem> item, vtkIdType parentVertex,
70  unsigned int depth=0);
71 
75  void ClearGridsIfNeeded(shared_ptr<XdmfItem> domain);
76 
81  std::set<double> getTimes();
82 
83 private:
88 
92  void InspectArrays(shared_ptr<XdmfItem> item);
93 
97  bool TooDeep(unsigned int depth);
98 
102  std::string UniqueName(const std::string& name, bool ForGrid);
103 
107  void AddNamedBlock(vtkIdType parentVertex,
108  std::string originalName, std::string uniqueName);
109 
113  void AddNamedSet(std::string uniqueName);
114 
116 
120  void InspectTime(shared_ptr<XdmfItem> item);
121  void GetSetTime(shared_ptr<XdmfGrid> child, unsigned int &cnt);
122  void GetSetTime(shared_ptr<XdmfGraph> child, unsigned int &cnt);
124 
128  bool ShouldRead(unsigned int piece, unsigned int npieces);
129 
130  vtkXdmf3SILBuilder *SILBuilder;
131  vtkXdmf3ArraySelection *FieldArrays;
132  vtkXdmf3ArraySelection *CellArrays; //ie EdgeArrays for Graphs
133  vtkXdmf3ArraySelection *PointArrays; //ie NodeArrays for Graphs
134  vtkXdmf3ArraySelection *GridsCache;
135  vtkXdmf3ArraySelection *SetsCache;
136  unsigned int MaxDepth;
137  unsigned int Rank;
138  unsigned int NumProcs;
139  std::set<double> times; //relying on implicit sort from set<double>
140 };
141 
142 #endif //vtkXdmf3LightDataHandler_h
143 // VTK-HeaderTest-Exclude: vtkXdmf3LightDataHandler.h
internal helper for vtkXdmf3Reader
int vtkIdType
Definition: vtkType.h:347
helper to allow block selection
helper to identify requested arrays with