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

Function GetIntArray

IO/Geometry/vtkGLTFUtils.cxx:68–91  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

66
67//------------------------------------------------------------------------------
68bool GetIntArray(const nlohmann::json& root, const std::string& key, std::vector<int>& value)
69{
70 auto it = root.find(key);
71 if (it == root.end() || !it.value().is_array())
72 {
73 return false;
74 }
75 value.reserve(it.value().size());
76 for (const auto& intValue : it.value())
77 {
78 if (intValue.empty() && !intValue.is_number_integer())
79 {
80 value.clear();
81 return false;
82 }
83 value.push_back(intValue);
84 }
85 if (value.empty())
86 {
87 value.clear();
88 return false;
89 }
90 return true;
91}
92
93//------------------------------------------------------------------------------
94bool GetUIntArray(

Callers 2

LoadNodeMethod · 0.70
LoadSkinMethod · 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