VTK  9.1.0
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
24namespace omf
25{
26namespace helper
27{
28
32void PrintMemberNames(const Json::Value& root);
33
37bool GetPointFromJSON(const Json::Value& pointJSON, double point[3]);
38
42bool GetIntValue(const Json::Value& root, int& value);
43
47bool GetUIntValue(const Json::Value& root, unsigned int& value);
48
52bool GetDoubleValue(const Json::Value& root, double& value);
53
57bool GetStringValue(const Json::Value& root, std::string& value);
58
62bool GetBoolValue(const Json::Value& root, bool& value);
63
67bool GetIntArray(const Json::Value& root, std::vector<int>& value);
68
72bool GetUIntArray(const Json::Value& root, std::vector<unsigned int>& value);
73
77bool GetFloatArray(const Json::Value& root, std::vector<float>& value);
78
82bool GetDoubleArray(const Json::Value& root, std::vector<double>& value);
83
84} // end namespace helper
85} // end namespace omf
86
87#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:31