VTK  9.3.0
OMFHelpers.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 OMFHelpers_h
4 #define OMFHelpers_h
5 
6 #include "vtkABINamespace.h"
7 
8 #include "vtk_jsoncpp_fwd.h" // For Json fwd declaration
9 
10 #include <string>
11 #include <vector>
12 
13 namespace omf
14 {
15 namespace helper
16 {
17 VTK_ABI_NAMESPACE_BEGIN
18 
22 void PrintMemberNames(const Json::Value& root);
23 
27 bool GetPointFromJSON(const Json::Value& pointJSON, double point[3]);
28 
32 bool GetIntValue(const Json::Value& root, int& value);
33 
37 bool GetUIntValue(const Json::Value& root, unsigned int& value);
38 
42 bool GetDoubleValue(const Json::Value& root, double& value);
43 
47 bool GetStringValue(const Json::Value& root, std::string& value);
48 
52 bool GetBoolValue(const Json::Value& root, bool& value);
53 
57 bool GetIntArray(const Json::Value& root, std::vector<int>& value);
58 
62 bool GetUIntArray(const Json::Value& root, std::vector<unsigned int>& value);
63 
67 bool GetFloatArray(const Json::Value& root, std::vector<float>& value);
68 
72 bool GetDoubleArray(const Json::Value& root, std::vector<double>& value);
73 
74 VTK_ABI_NAMESPACE_END
75 } // end namespace helper
76 } // end namespace omf
77 
78 #endif // OMFHelpers_h
bool GetUIntArray(const Json::Value &root, std::vector< unsigned int > &value)
Get int array from Json variable, with existence and type checks.
bool GetPointFromJSON(const Json::Value &pointJSON, double point[3])
read a 3d point stored directly in JSON
bool GetBoolValue(const Json::Value &root, bool &value)
Get bool value from Json variable, with existence and type checks.
bool GetDoubleValue(const Json::Value &root, double &value)
Get double value from Json variable, with existence and type checks.
bool GetStringValue(const Json::Value &root, std::string &value)
Get string value from Json variable, with existence and type checks.
bool GetDoubleArray(const Json::Value &root, std::vector< double > &value)
Get double array from Json variable, with existence and type checks.
void PrintMemberNames(const Json::Value &root)
print names of members of root.
bool GetIntArray(const Json::Value &root, std::vector< int > &value)
Get int array from Json variable, with existence and type checks.
bool GetUIntValue(const Json::Value &root, unsigned int &value)
Get int value from Json variable, with existence and type checks.
bool GetIntValue(const Json::Value &root, int &value)
Get int value from Json variable, with existence and type checks.
bool GetFloatArray(const Json::Value &root, std::vector< float > &value)
Get float array from Json variable, with existence and type checks.
Definition: OMFElement.h:20
@ point
Definition: vtkX3D.h:236
@ value
Definition: vtkX3D.h:220
@ string
Definition: vtkX3D.h:490