VTK  9.3.0
OMFFile.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef OMFFile_h
4 #define OMFFile_h
5 
6 #include "vtkSmartPointer.h"
7 
8 #include "vtk_jsoncpp_fwd.h"
9 
10 #include <memory> // for std::unique_ptr
11 #include <string>
12 #include <vector>
13 
14 VTK_ABI_NAMESPACE_BEGIN
15 class vtkDataArray;
16 class vtkImageData;
17 VTK_ABI_NAMESPACE_END
18 
19 namespace omf
20 {
21 VTK_ABI_NAMESPACE_BEGIN
22 
23 struct OMFFile
24 {
27 
28  bool OpenStream(const char* filename);
29 
31 
32  bool ReadHeader(std::string& uid);
33 
34  bool ParseJSON();
35 
36  const Json::Value& JSONRoot();
37 
38  vtkSmartPointer<vtkDataArray> ReadArrayFromStream(const std::string& uid, int numComponents = -1);
39 
41 
42  std::vector<std::string> ReadStringArrayFromStream(const std::string& uid);
43 
44 private:
45  struct FileImpl;
46  std::unique_ptr<FileImpl> Impl;
47 };
48 
49 VTK_ABI_NAMESPACE_END
50 } // end namespace omf
51 #endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:45
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
Definition: OMFElement.h:20
@ string
Definition: vtkX3D.h:490
const Json::Value & JSONRoot()
bool ParseJSON()
bool OpenStream(const char *filename)
bool ReadHeader(std::string &uid)
std::vector< std::string > ReadStringArrayFromStream(const std::string &uid)
std::string GetFileName()
vtkSmartPointer< vtkDataArray > ReadArrayFromStream(const std::string &uid, int numComponents=-1)
vtkSmartPointer< vtkImageData > ReadPNGFromStream(const Json::Value &json)