MCPcopy Create free account
hub / github.com/Kitware/VTK / GetFloatArray

Function GetFloatArray

IO/OMF/core/OMFHelpers.cxx:153–175  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

151
152//------------------------------------------------------------------------------
153bool GetFloatArray(const Json::Value& root, std::vector<float>& value)
154{
155 if (root.empty() || !root.isArray())
156 {
157 return false;
158 }
159 value.reserve(root.size());
160 for (const auto& floatValue : root)
161 {
162 if (floatValue.empty() && !floatValue.isDouble())
163 {
164 value.clear();
165 return false;
166 }
167 value.push_back(floatValue.asDouble());
168 }
169 if (value.empty())
170 {
171 value.clear();
172 return false;
173 }
174 return true;
175}
176
177//------------------------------------------------------------------------------
178bool GetDoubleArray(const Json::Value& root, std::vector<double>& value)

Callers

nothing calls this directly

Calls 8

isArrayMethod · 0.80
isDoubleMethod · 0.80
emptyMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45
push_backMethod · 0.45
asDoubleMethod · 0.45

Tested by

no test coverage detected