VTK  9.1.0
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 "vtkType.h"
33
34// clang-format off
35#include "vtk_xdmf3.h"
36#include VTKXDMF3_HEADER(core/XdmfItem.hpp)
37// clang-format on
38
39#include <set>
40
43class XdmfItem;
44class XdmfGraph;
45class XdmfGrid;
46
47class VTKIOXDMF3_EXPORT vtkXdmf3LightDataHandler
48{
49public:
53 static shared_ptr<vtkXdmf3LightDataHandler> New(vtkXdmf3SILBuilder* sb, vtkXdmf3ArraySelection* f,
55 vtkXdmf3ArraySelection* sc, unsigned int processor, unsigned int nprocessors);
56
63 void InspectXDMF(shared_ptr<XdmfItem> item, vtkIdType parentVertex, unsigned int depth = 0);
64
68 void ClearGridsIfNeeded(shared_ptr<XdmfItem> domain);
69
74 std::set<double> getTimes();
75
76private:
81
85 void InspectArrays(shared_ptr<XdmfItem> item);
86
90 bool TooDeep(unsigned int depth);
91
95 std::string UniqueName(const std::string& name, bool ForGrid);
96
100 void AddNamedBlock(vtkIdType parentVertex, std::string originalName, std::string uniqueName);
101
105 void AddNamedSet(std::string uniqueName);
106
108
112 void InspectTime(shared_ptr<XdmfItem> item);
113 void GetSetTime(shared_ptr<XdmfGrid> child, unsigned int& cnt);
114 void GetSetTime(shared_ptr<XdmfGraph> child, unsigned int& cnt);
116
120 bool ShouldRead(unsigned int piece, unsigned int npieces);
121
122 vtkXdmf3SILBuilder* SILBuilder;
123 vtkXdmf3ArraySelection* FieldArrays;
124 vtkXdmf3ArraySelection* CellArrays; // ie EdgeArrays for Graphs
125 vtkXdmf3ArraySelection* PointArrays; // ie NodeArrays for Graphs
126 vtkXdmf3ArraySelection* GridsCache;
127 vtkXdmf3ArraySelection* SetsCache;
128 unsigned int MaxDepth;
129 unsigned int Rank;
130 unsigned int NumProcs;
131 std::set<double> times; // relying on implicit sort from set<double>
132};
133
134#endif // vtkXdmf3LightDataHandler_h
135// VTK-HeaderTest-Exclude: vtkXdmf3LightDataHandler.h
helper to identify requested arrays with
internal helper for vtkXdmf3Reader
std::set< double > getTimes()
return the list of times that the xdmf file can provide data at only valid after InspectXDMF
static shared_ptr< vtkXdmf3LightDataHandler > New(vtkXdmf3SILBuilder *sb, vtkXdmf3ArraySelection *f, vtkXdmf3ArraySelection *ce, vtkXdmf3ArraySelection *pn, vtkXdmf3ArraySelection *gc, vtkXdmf3ArraySelection *sc, unsigned int processor, unsigned int nprocessors)
factory constructor
void ClearGridsIfNeeded(shared_ptr< XdmfItem > domain)
called to make sure overflown SIL doesn't give nonsensical results
void InspectXDMF(shared_ptr< XdmfItem > item, vtkIdType parentVertex, unsigned int depth=0)
recursively inspect XDMF data hierarchy to determine times that we can provide data at name of arrays...
helper to allow block selection
int vtkIdType
Definition: vtkType.h:332