VTK  9.4.20241016
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
14VTK_ABI_NAMESPACE_BEGIN
15class vtkDataArray;
16class vtkImageData;
17VTK_ABI_NAMESPACE_END
18
19namespace omf
20{
21VTK_ABI_NAMESPACE_BEGIN
22
23struct OMFFile
24{
27
28 bool OpenStream(const char* filename);
29
30 std::string GetFileName();
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
44private:
45 struct FileImpl;
46 std::unique_ptr<FileImpl> Impl;
47};
48
49VTK_ABI_NAMESPACE_END
50} // end namespace omf
51#endif
abstract superclass for arrays of numeric data
topologically and geometrically regular array of data
Hold a reference to a vtkObjectBase instance.
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< vtkImageData > ReadPNGFromStream(const Json::Value &json)
const Json::Value & JSONRoot()
vtkSmartPointer< vtkDataArray > ReadArrayFromStream(const std::string &uid, int numComponents=-1)