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

Function vtkMergeGraphsAddRow

Infovis/Core/vtkMergeGraphs.cxx:82–103  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Uses array_map to append a row to data1 corresponding to row index2 of mapped arrays (which came from data2)

Source from the content-addressed store, hash-verified

80// Uses array_map to append a row to data1 corresponding to
81// row index2 of mapped arrays (which came from data2)
82static void vtkMergeGraphsAddRow(vtkDataSetAttributes* data1, vtkIdType index2,
83 std::map<vtkAbstractArray*, vtkAbstractArray*>& array_map)
84{
85 int narr1 = data1->GetNumberOfArrays();
86 for (int arr1 = 0; arr1 < narr1; ++arr1)
87 {
88 vtkAbstractArray* a1 = data1->GetAbstractArray(arr1);
89 if (array_map.find(a1) != array_map.end())
90 {
91 vtkAbstractArray* a2 = array_map[a1];
92 a1->InsertNextTuple(index2, a2);
93 }
94 else
95 {
96 vtkIdType num_values = a1->GetNumberOfTuples() * a1->GetNumberOfComponents();
97 for (vtkIdType i = 0; i < a1->GetNumberOfComponents(); ++i)
98 {
99 a1->InsertVariantValue(num_values + i, vtkVariant());
100 }
101 }
102 }
103}
104
105//------------------------------------------------------------------------------
106int vtkMergeGraphs::RequestData(

Callers 1

ExtendGraphMethod · 0.85

Calls 9

GetAbstractArrayMethod · 0.80
vtkVariantClass · 0.50
GetNumberOfArraysMethod · 0.45
findMethod · 0.45
endMethod · 0.45
InsertNextTupleMethod · 0.45
GetNumberOfTuplesMethod · 0.45
GetNumberOfComponentsMethod · 0.45
InsertVariantValueMethod · 0.45

Tested by

no test coverage detected