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

Function GetFields

Common/DataModel/vtkDataSetAttributesFieldList.cxx:223–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221};
222
223std::multimap<std::string, FieldInfo> GetFields(vtkDataSetAttributes* dsa)
224{
225 std::array<int, vtkDataSetAttributes::NUM_ATTRIBUTES> attribute_indices;
226 dsa->GetAttributeIndices(attribute_indices.data());
227
228 std::multimap<std::string, FieldInfo> fields;
229 const auto num_of_arrays = dsa->GetNumberOfArrays();
230 for (int cc = 0; cc < num_of_arrays; ++cc)
231 {
232 auto finfo = FieldInfo::Create(dsa->GetAbstractArray(cc), cc);
233
234 // setup attributes info.
235 std::array<bool, vtkDataSetAttributes::NUM_ATTRIBUTES> curattrs;
236 std::transform(attribute_indices.begin(), attribute_indices.end(), curattrs.begin(),
237 [cc](int idx) { return idx == cc; });
238
239 finfo.AttributeTypes.push_back(curattrs);
240
241 fields.insert(std::make_pair(finfo.Name, std::move(finfo)));
242 }
243 return fields;
244}
245
246/**
247 * returns a vector of FieldInfo* where the index is the attribute type and

Callers 3

InitializeFieldListMethod · 0.70
IntersectFieldListMethod · 0.70
UnionFieldListMethod · 0.70

Calls 10

GetAttributeIndicesMethod · 0.80
GetAbstractArrayMethod · 0.80
CreateFunction · 0.70
transformFunction · 0.50
dataMethod · 0.45
GetNumberOfArraysMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected