VTK  9.2.6
OMFHelpers.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: OMFHelpers.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 OMFHelpers_h
17 #define OMFHelpers_h
18 
19 #include "vtk_jsoncpp_fwd.h" // For Json fwd declaration
20 
21 #include <string>
22 #include <vector>
23 
24 namespace omf
25 {
26 namespace helper
27 {
28 
32 void PrintMemberNames(const Json::Value& root);
33 
37 bool GetPointFromJSON(const Json::Value& pointJSON, double point[3]);
38 
42 bool GetIntValue(const Json::Value& root, int& value);
43 
47 bool GetUIntValue(const Json::Value& root, unsigned int& value);
48 
52 bool GetDoubleValue(const Json::Value& root, double& value);
53 
57 bool GetStringValue(const Json::Value& root, std::string& value);
58 
62 bool GetBoolValue(const Json::Value& root, bool& value);
63 
67 bool GetIntArray(const Json::Value& root, std::vector<int>& value);
68 
72 bool GetUIntArray(const Json::Value& root, std::vector<unsigned int>& value);
73 
77 bool GetFloatArray(const Json::Value& root, std::vector<float>& value);
78 
82 bool GetDoubleArray(const Json::Value& root, std::vector<double>& value);
83 
84 } // end namespace helper
85 } // end namespace omf
86 
87 #endif // OMFHelpers_h
bool GetIntValue(const Json::Value &root, int &value)
Get int value 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 GetDoubleArray(const Json::Value &root, std::vector< double > &value)
Get double array from Json variable, with existence and type checks.
Definition: OMFElement.h:30
void PrintMemberNames(const Json::Value &root)
print names of members of root.
bool GetBoolValue(const Json::Value &root, bool &value)
Get bool 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 GetPointFromJSON(const Json::Value &pointJSON, double point[3])
read a 3d point stored directly in JSON
bool GetUIntArray(const Json::Value &root, std::vector< unsigned int > &value)
Get int array 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.
bool GetDoubleValue(const Json::Value &root, double &value)
Get double value from Json variable, with existence and type checks.
bool GetIntArray(const Json::Value &root, std::vector< int > &value)
Get int array from Json variable, with existence and type checks.