VTK  9.4.20250103
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
13namespace omf
14{
15namespace helper
16{
17VTK_ABI_NAMESPACE_BEGIN
18
22void PrintMemberNames(const Json::Value& root);
23
27bool GetPointFromJSON(const Json::Value& pointJSON, double point[3]);
28
32bool GetIntValue(const Json::Value& root, int& value);
33
37bool GetUIntValue(const Json::Value& root, unsigned int& value);
38
42bool GetDoubleValue(const Json::Value& root, double& value);
43
47bool GetStringValue(const Json::Value& root, std::string& value);
48
52bool GetBoolValue(const Json::Value& root, bool& value);
53
57bool GetIntArray(const Json::Value& root, std::vector<int>& value);
58
62bool GetUIntArray(const Json::Value& root, std::vector<unsigned int>& value);
63
67bool GetFloatArray(const Json::Value& root, std::vector<float>& value);
68
72bool GetDoubleArray(const Json::Value& root, std::vector<double>& value);
73
74VTK_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.