VTK  9.3.1
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 {
25  OMFFile();
26  ~OMFFile();
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 
40  vtkSmartPointer<vtkImageData> ReadPNGFromStream(const Json::Value& json);
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
bool ParseJSON()
vtkSmartPointer< vtkDataArray > ReadArrayFromStream(const std::string &uid, int numComponents=-1)
const Json::Value & JSONRoot()
vtkSmartPointer< vtkImageData > ReadPNGFromStream(const Json::Value &json)
std::string GetFileName()
bool OpenStream(const char *filename)
std::vector< std::string > ReadStringArrayFromStream(const std::string &uid)
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
Definition: OMFElement.h:19
bool ReadHeader(std::string &uid)