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

Function vtkMergeTable

Filters/Parallel/vtkPExtractDataArraysOverTime.cxx:23–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21namespace
22{
23vtkSmartPointer<vtkTable> vtkMergeTable(vtkTable* dest, vtkTable* src)
24{
25 if (dest == nullptr)
26 {
27 return src;
28 }
29
30 const auto numRows = dest->GetNumberOfRows();
31 if (numRows != src->GetNumberOfRows())
32 {
33 return dest;
34 }
35
36 auto srcRowData = src->GetRowData();
37 auto destRowData = dest->GetRowData();
38 auto srcMask = vtkUnsignedCharArray::SafeDownCast(srcRowData->GetArray("vtkValidPointMask"));
39 for (vtkIdType cc = 0; srcMask != nullptr && cc < numRows; ++cc)
40 {
41 if (srcMask->GetTypedComponent(cc, 0) == 0)
42 {
43 continue;
44 }
45
46 // Copy arrays from remote to current
47 const int numArray = srcRowData->GetNumberOfArrays();
48 for (int aidx = 0; aidx < numArray; aidx++)
49 {
50 auto srcArray = srcRowData->GetAbstractArray(aidx);
51 if (const char* name = srcArray ? srcArray->GetName() : nullptr)
52 {
53 auto destArray = destRowData->GetAbstractArray(name);
54 if (destArray == nullptr)
55 {
56 // add new array array if necessary
57 destRowData->AddArray(destArray);
58 }
59 else
60 {
61 destArray->InsertTuple(cc, cc, srcArray);
62 }
63 }
64 }
65 }
66 return dest;
67}
68}
69
70vtkStandardNewMacro(vtkPExtractDataArraysOverTime);

Callers 1

ReorganizeDataMethod · 0.85

Calls 9

GetRowDataMethod · 0.80
GetAbstractArrayMethod · 0.80
GetNumberOfRowsMethod · 0.45
GetArrayMethod · 0.45
GetTypedComponentMethod · 0.45
GetNumberOfArraysMethod · 0.45
GetNameMethod · 0.45
AddArrayMethod · 0.45
InsertTupleMethod · 0.45

Tested by

no test coverage detected