VTK
vtkXdmf3DataSet.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXdmf3DataSet.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 =========================================================================*/
27 #ifndef vtkXdmf3DataSet_h
28 #define vtkXdmf3DataSet_h
29 
30 #include "vtkIOXdmf3Module.h" // For export macro
31 #include "XdmfSharedPtr.hpp"
32 #include <string> //Needed only for XdmfArray::getName :(
33 
36 class XdmfArray;
37 class XdmfAttribute;
38 class vtkDataArray;
39 class XdmfGrid;
40 class vtkDataObject;
41 class XdmfSet;
42 class vtkDataSet;
43 class XdmfTopologyType;
44 class XdmfRegularGrid;
45 class vtkImageData;
46 class XdmfRectilinearGrid;
47 class vtkRectilinearGrid;
48 class XdmfCurvilinearGrid;
49 class vtkStructuredGrid;
50 class XdmfUnstructuredGrid;
52 class vtkPointSet;
53 class XdmfGraph;
55 class vtkDirectedGraph;
56 class XdmfDomain;
57 
58 
59 class VTKIOXDMF3_EXPORT vtkXdmf3DataSet
60 {
61 public:
62 
63  // Common
64 
68  static vtkDataArray *XdmfToVTKArray(
69  XdmfArray* xArray,
70  std::string attrName,//TODO: needed because XdmfArray::getName() misbehaves
71  unsigned int preferredComponents = 0,
72  vtkXdmf3ArrayKeeper *keeper=nullptr);
73 
77  static bool VTKToXdmfArray(
78  vtkDataArray *vArray,
79  XdmfArray* xArray,
80  unsigned int rank = 0, unsigned int *dims = nullptr);
81 
86  static void XdmfToVTKAttributes(
87  vtkXdmf3ArraySelection *fselection,
88  vtkXdmf3ArraySelection *cselection,
89  vtkXdmf3ArraySelection *pselection,
90  XdmfGrid *grid, vtkDataObject *dObject,
91  vtkXdmf3ArrayKeeper *keeper=nullptr);
92 
97  static void VTKToXdmfAttributes(vtkDataObject *dObject, XdmfGrid *grid);
98 
100 
103  static unsigned int GetNumberOfPointsPerCell(int vtk_cell_type, bool &fail);
104  static int GetVTKCellType(shared_ptr<const XdmfTopologyType> topologyType);
105  static int GetXdmfCellType(int vtkType);
107 
109 
112  static void SetTime(XdmfGrid *grid, double hasTime, double time);
113  static void SetTime(XdmfGraph *graph, double hasTime, double time);
115 
116  //vtkXdmf3RegularGrid
117 
121  static void XdmfToVTK(
122  vtkXdmf3ArraySelection *fselection,
123  vtkXdmf3ArraySelection *cselection,
124  vtkXdmf3ArraySelection *pselection,
125  XdmfRegularGrid *grid,
126  vtkImageData *dataSet,
127  vtkXdmf3ArrayKeeper *keeper=nullptr);
128 
132  static void CopyShape(
133  XdmfRegularGrid *grid,
134  vtkImageData *dataSet,
135  vtkXdmf3ArrayKeeper *keeper=nullptr);
136 
140  static void VTKToXdmf(
141  vtkImageData *dataSet,
142  XdmfDomain *domain,
143  bool hasTime, double time,
144  const char* name = 0);
145 
146  //vtkXdmf3RectilinearGrid
150  static void XdmfToVTK(
151  vtkXdmf3ArraySelection *fselection,
152  vtkXdmf3ArraySelection *cselection,
153  vtkXdmf3ArraySelection *pselection,
154  XdmfRectilinearGrid *grid,
155  vtkRectilinearGrid *dataSet,
156  vtkXdmf3ArrayKeeper *keeper=nullptr);
157 
161  static void CopyShape(
162  XdmfRectilinearGrid *grid,
163  vtkRectilinearGrid *dataSet,
164  vtkXdmf3ArrayKeeper *keeper=nullptr);
165 
169  static void VTKToXdmf(
170  vtkRectilinearGrid *dataSet,
171  XdmfDomain *domain,
172  bool hasTime, double time,
173  const char* name = 0);
174 
175  //vtkXdmf3CurvilinearGrid
179  static void XdmfToVTK(
180  vtkXdmf3ArraySelection *fselection,
181  vtkXdmf3ArraySelection *cselection,
182  vtkXdmf3ArraySelection *pselection,
183  XdmfCurvilinearGrid *grid,
184  vtkStructuredGrid *dataSet,
185  vtkXdmf3ArrayKeeper *keeper=nullptr);
186 
190  static void CopyShape(
191  XdmfCurvilinearGrid *grid,
192  vtkStructuredGrid *dataSet,
193  vtkXdmf3ArrayKeeper *keeper=nullptr);
194 
198  static void VTKToXdmf(
199  vtkStructuredGrid *dataSet,
200  XdmfDomain *domain,
201  bool hasTime, double time,
202  const char* name = 0);
203 
204  //vtkXdmf3UnstructuredGrid
208  static void XdmfToVTK(
209  vtkXdmf3ArraySelection *fselection,
210  vtkXdmf3ArraySelection *cselection,
211  vtkXdmf3ArraySelection *pselection,
212  XdmfUnstructuredGrid *grid,
213  vtkUnstructuredGrid *dataSet,
214  vtkXdmf3ArrayKeeper *keeper=nullptr);
215 
219  static void CopyShape(
220  XdmfUnstructuredGrid *grid,
221  vtkUnstructuredGrid *dataSet,
222  vtkXdmf3ArrayKeeper *keeper=nullptr);
223 
227  static void VTKToXdmf(
228  vtkPointSet *dataSet,
229  XdmfDomain *domain,
230  bool hasTime, double time,
231  const char* name = 0);
232 
233  //vtkXdmf3Graph
237  static void XdmfToVTK(
238  vtkXdmf3ArraySelection *fselection,
239  vtkXdmf3ArraySelection *cselection,
240  vtkXdmf3ArraySelection *pselection,
241  XdmfGraph *grid,
242  vtkMutableDirectedGraph *dataSet,
243  vtkXdmf3ArrayKeeper *keeper=nullptr);
244 
248  static void VTKToXdmf(
249  vtkDirectedGraph *dataSet,
250  XdmfDomain *domain,
251  bool hasTime, double time,
252  const char* name = 0);
253 
254 
255  //Side Sets
256 
261  static void XdmfToVTKAttributes(
262 /*
263  vtkXdmf3ArraySelection *fselection,
264  vtkXdmf3ArraySelection *cselection,
265  vtkXdmf3ArraySelection *pselection,
266 */
267  XdmfSet *grid, vtkDataObject *dObject,
268  vtkXdmf3ArrayKeeper *keeper=nullptr);
269 
274  static void XdmfSubsetToVTK(
275  XdmfGrid *grid,
276  unsigned int setnum,
277  vtkDataSet *dataSet,
278  vtkUnstructuredGrid *subSet,
279  vtkXdmf3ArrayKeeper *keeper=nullptr);
280 
286  static int GetVTKFiniteElementCellType(
287  unsigned int element_degree,
288  const std::string& element_family,
289  shared_ptr<const XdmfTopologyType> topologyType);
290 
302  static void ParseFiniteElementFunction(
303  vtkDataObject *dObject,
304  shared_ptr <XdmfAttribute> xmfAttribute,
305  vtkDataArray *array,
306  XdmfGrid *grid,
307  vtkXdmf3ArrayKeeper *keeper=nullptr);
308 };
309 
310 #endif
311 // VTK-HeaderTest-Exclude: vtkXdmf3DataSet.h
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
LRU cache of XDMF Arrays.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:42
A directed graph.
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
An editable directed graph.
topologically regular array of data
dataset level translation between xdmf3 and vtk
general representation of visualization data
Definition: vtkDataObject.h:64
helper to identify requested arrays with