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

Method ProcessTrees

Filters/HyperTree/vtkHyperTreeGridExtractGhostCells.cxx:31–111  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

29
30//------------------------------------------------------------------------------
31int vtkHyperTreeGridExtractGhostCells::ProcessTrees(
32 vtkHyperTreeGrid* input, vtkDataObject* outputDO)
33{
34 // Downcast output data object to hyper tree grid
35 vtkHyperTreeGrid* output = vtkHyperTreeGrid::SafeDownCast(outputDO);
36 if (!output)
37 {
38 vtkErrorMacro("Incorrect type of output: " << outputDO->GetClassName());
39 return 0;
40 }
41
42 output->ShallowCopy(input);
43
44 // Retrieve and copy input mask if it exists
45 this->InMask = input->HasMask() ? input->GetMask() : nullptr;
46 if (this->InMask)
47 {
48 this->OutMask->DeepCopy(this->InMask);
49 }
50 else
51 {
52 this->OutMask->SetNumberOfTuples(output->GetNumberOfCells());
53 }
54 output->SetMask(this->OutMask);
55
56 // Retrieve ghost array
57 if (input->HasAnyGhostCells())
58 {
59 this->InGhost = input->GetGhostCells();
60 }
61 else
62 {
63 vtkWarningMacro(<< "Input does not have a ghost array. Output HTG will be empty.");
64 }
65
66 // Iterate over
67 vtkIdType inIndex = 0;
68 vtkHyperTreeGrid::vtkHyperTreeGridIterator it;
69 output->InitializeTreeIterator(it);
70 vtkNew<vtkHyperTreeGridNonOrientedCursor> outCursor;
71 while (it.GetNextTree(inIndex))
72 {
73 if (this->CheckAbort())
74 {
75 break;
76 }
77
78 output->InitializeNonOrientedCursor(outCursor, inIndex, true);
79
80 if (!this->InGhost)
81 {
82 // Input has no ghost cell, mask the whole tree
83 this->OutMask->InsertValue(outCursor->GetGlobalNodeIndex(), 1);
84 }
85 else
86 {
87 this->RecursivelyMaskNonGhost(outCursor);
88 }

Callers

nothing calls this directly

Calls 15

HasMaskMethod · 0.80
GetGhostCellsMethod · 0.80
GetNextTreeMethod · 0.80
CheckAbortMethod · 0.80
GetClassNameMethod · 0.45
ShallowCopyMethod · 0.45
GetMaskMethod · 0.45
DeepCopyMethod · 0.45
SetNumberOfTuplesMethod · 0.45

Tested by

no test coverage detected