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 =========================================================================*/
31 #ifndef vtkXdmf3LightDataHandler_h
32 #define vtkXdmf3LightDataHandler_h
33 
34 #include "vtkIOXdmf3Module.h" // For export macro
35 #include <set>
36 #include "XdmfItem.hpp"
37 #include "vtkType.h"
38 
39 class vtkXdmf3SILBuilder;
41 class XdmfItem;
42 class XdmfGraph;
43 class XdmfGrid;
44 
45 class VTKIOXDMF3_EXPORT vtkXdmf3LightDataHandler
46 {
47 public:
49 
50  static shared_ptr<vtkXdmf3LightDataHandler> New(
57  unsigned int processor,
58  unsigned int nprocessors);
60 
63 
65 
68  void InspectXDMF(shared_ptr<XdmfItem> item, vtkIdType parentVertex,
69  unsigned int depth=0);
71 
73  void ClearGridsIfNeeded(shared_ptr<XdmfItem> domain);
74 
77  std::set<double> getTimes();
78 
79 private:
82 
84  void InspectArrays(shared_ptr<XdmfItem> item);
85 
87  bool TooDeep(unsigned int depth);
88 
90  std::string UniqueName(std::string name, bool ForGrid);
91 
93 
94  void AddNamedBlock(vtkIdType parentVertex,
95  std::string originalName, std::string uniqueName);
97 
99  void AddNamedSet(std::string uniqueName);
100 
102 
104  void InspectTime(shared_ptr<XdmfItem> item);
105  void GetSetTime(shared_ptr<XdmfGrid> child, unsigned int &cnt);
106  void GetSetTime(shared_ptr<XdmfGraph> child, unsigned int &cnt);
108 
110  bool ShouldRead(unsigned int piece, unsigned int npieces);
111 
112  vtkXdmf3SILBuilder *SILBuilder;
113  vtkXdmf3ArraySelection *FieldArrays;
114  vtkXdmf3ArraySelection *CellArrays; //ie EdgeArrays for Graphs
115  vtkXdmf3ArraySelection *PointArrays; //ie NodeArrays for Graphs
116  vtkXdmf3ArraySelection *GridsCache;
117  vtkXdmf3ArraySelection *SetsCache;
118  unsigned int MaxDepth;
119  unsigned int Rank;
120  unsigned int NumProcs;
121  std::set<double> times; //relying on implicit sort from set<double>
122 };
123 
124 #endif //vtkXdmf3LightDataHandler_h
internal helper for vtkXdmf3Reader
int vtkIdType
Definition: vtkType.h:275
helper to allow block selection
helper to identify requested arrays with