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

Function vtkMergeGraphsCreateArrayMapping

Infovis/Core/vtkMergeGraphs.cxx:59–77  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Fills array_map with matching arrays from data1 to data2

Source from the content-addressed store, hash-verified

57//------------------------------------------------------------------------------
58// Fills array_map with matching arrays from data1 to data2
59static void vtkMergeGraphsCreateArrayMapping(
60 std::map<vtkAbstractArray*, vtkAbstractArray*>& array_map, vtkDataSetAttributes* data1,
61 vtkDataSetAttributes* data2)
62{
63 vtkIdType narr1 = data1->GetNumberOfArrays();
64 for (int arr1 = 0; arr1 < narr1; ++arr1)
65 {
66 vtkAbstractArray* a1 = data1->GetAbstractArray(arr1);
67 vtkAbstractArray* a2 = data2->GetAbstractArray(a1->GetName());
68 if (a2 && a1->GetDataType() == a2->GetDataType() &&
69 a1->GetNumberOfComponents() == a2->GetNumberOfComponents())
70 {
71 array_map[a1] = a2;
72 }
73 }
74 // Force pedigree id array to match
75 if (data1->GetPedigreeIds() && data2->GetPedigreeIds())
76 array_map[data1->GetPedigreeIds()] = data2->GetPedigreeIds();
77}
78
79//------------------------------------------------------------------------------
80// Uses array_map to append a row to data1 corresponding to

Callers 1

ExtendGraphMethod · 0.85

Calls 6

GetAbstractArrayMethod · 0.80
GetPedigreeIdsMethod · 0.80
GetNumberOfArraysMethod · 0.45
GetNameMethod · 0.45
GetDataTypeMethod · 0.45
GetNumberOfComponentsMethod · 0.45

Tested by

no test coverage detected