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

Function GetUIntArray

IO/Geometry/vtkGLTFUtils.cxx:94–118  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

92
93//------------------------------------------------------------------------------
94bool GetUIntArray(
95 const nlohmann::json& root, const std::string& key, std::vector<unsigned int>& value)
96{
97 auto it = root.find(key);
98 if (it == root.end() || !it.value().is_array())
99 {
100 return false;
101 }
102 value.reserve(it.value().size());
103 for (const auto& uIntValue : it.value())
104 {
105 if (uIntValue.empty() && !uIntValue.is_number_unsigned())
106 {
107 value.clear();
108 return false;
109 }
110 value.push_back(uIntValue);
111 }
112 if (value.empty())
113 {
114 value.clear();
115 return false;
116 }
117 return true;
118}
119
120//------------------------------------------------------------------------------
121bool GetFloatArray(const nlohmann::json& root, const std::string& key, std::vector<float>& value)

Callers 1

LoadSceneMethod · 0.70

Calls 8

findMethod · 0.45
endMethod · 0.45
valueMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected