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

Function CopyInputTreeToOutput

Testing/Core/Testing/Cxx/TestDataObjectCompare.cxx:1019–1045  ·  view source on GitHub ↗

* Recursively deep copy the input tree pointed by the cursor * to the output, ignoring masked branches. This will create a new HTG * with a totally different internal structure, * that should still be identical to the original one. */

Source from the content-addressed store, hash-verified

1017 * that should still be identical to the original one.
1018 */
1019void CopyInputTreeToOutput(vtkHyperTreeGridNonOrientedCursor* inCursor,
1020 vtkHyperTreeGridNonOrientedCursor* outCursor, vtkCellData* inCellData, vtkCellData* outCellData,
1021 vtkBitArray* inMask, vtkBitArray* outMask)
1022{
1023 vtkIdType outIdx = outCursor->GetGlobalNodeIndex();
1024 vtkIdType inIdx = inCursor->GetGlobalNodeIndex();
1025 if (inMask)
1026 {
1027 outMask->InsertTuple1(outIdx, inMask->GetValue(inIdx));
1028 }
1029 outCellData->InsertTuple(outIdx, inIdx, inCellData);
1030 if (!inCursor->IsMasked())
1031 {
1032 if (!inCursor->IsLeaf())
1033 {
1034 outCursor->SubdivideLeaf();
1035 for (int ichild = 0; ichild < inCursor->GetNumberOfChildren(); ++ichild)
1036 {
1037 outCursor->ToChild(ichild);
1038 inCursor->ToChild(ichild);
1039 ::CopyInputTreeToOutput(inCursor, outCursor, inCellData, outCellData, inMask, outMask);
1040 outCursor->ToParent();
1041 inCursor->ToParent();
1042 }
1043 }
1044 }
1045}
1046
1047/**
1048 * Compare HyperTreeGrid with a different memory layout.

Callers 1

Calls 10

InsertTuple1Method · 0.80
GetGlobalNodeIndexMethod · 0.45
GetValueMethod · 0.45
InsertTupleMethod · 0.45
IsMaskedMethod · 0.45
IsLeafMethod · 0.45
SubdivideLeafMethod · 0.45
GetNumberOfChildrenMethod · 0.45
ToChildMethod · 0.45
ToParentMethod · 0.45

Tested by

no test coverage detected