VTK  9.1.0
OMFFile.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: OMFFile.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 =========================================================================*/
16 #ifndef OMFFile_h
17 #define OMFFile_h
18 
19 #include "vtkSmartPointer.h"
20 
21 #include "vtk_jsoncpp_fwd.h"
22 
23 #include <memory> // for std::unique_ptr
24 #include <string>
25 #include <vector>
26 
27 class vtkDataArray;
28 class vtkImageData;
29 
30 namespace omf
31 {
32 
33 struct OMFFile
34 {
37 
38  bool OpenStream(const char* filename);
39 
41 
42  bool ReadHeader(std::string& uid);
43 
44  bool ParseJSON();
45 
46  const Json::Value& JSONRoot();
47 
48  vtkSmartPointer<vtkDataArray> ReadArrayFromStream(const std::string& uid, int numComponents = -1);
49 
51 
52  std::vector<std::string> ReadStringArrayFromStream(const std::string& uid);
53 
54 private:
55  struct FileImpl;
56  std::unique_ptr<FileImpl> Impl;
57 };
58 
59 } // end namespace omf
60 #endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
topologically and geometrically regular array of data
Definition: vtkImageData.h:48
Definition: OMFElement.h:31
@ string
Definition: vtkX3D.h:496
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)