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

Method ProcessTrees

Filters/HyperTree/vtkHyperTreeGridAxisReflection.cxx:50–283  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

48
49//------------------------------------------------------------------------------
50int vtkHyperTreeGridAxisReflection::ProcessTrees(vtkHyperTreeGrid* input, vtkDataObject* outputDO)
51{
52 // Skip empty inputs
53 if (input->GetNumberOfLeaves() == 0)
54 {
55 return 1;
56 }
57
58 // Downcast output data object to hyper tree grid
59 vtkHyperTreeGrid* output = vtkHyperTreeGrid::SafeDownCast(outputDO);
60 if (!output)
61 {
62 vtkErrorMacro("Incorrect type of output: " << outputDO->GetClassName());
63 return 0;
64 }
65
66 // Shallow copy structure of input into output
67 output->CopyStructure(input);
68
69 // Shallow copy data of input into output
70 this->InData = input->GetCellData();
71 this->OutData = output->GetCellData();
72 this->OutData->PassData(this->InData);
73
74 // Retrieve reflection direction and coordinates to be reflected
75 unsigned int direction = 0;
76 double offset = 0.;
77 vtkUniformHyperTreeGrid* inputUHTG = vtkUniformHyperTreeGrid::SafeDownCast(input);
78 vtkUniformHyperTreeGrid* outputUHTG = vtkUniformHyperTreeGrid::SafeDownCast(outputDO);
79 if (inputUHTG)
80 {
81 assert(outputUHTG);
82 double origin[3];
83 inputUHTG->GetOrigin(origin);
84 double scale[3];
85 inputUHTG->GetGridScale(scale);
86 unsigned int pmod3 = this->Plane % 3;
87 if (!pmod3)
88 {
89 direction = 0;
90 }
91 else if (pmod3 == 1)
92 {
93 direction = 1;
94 }
95 else
96 {
97 direction = 2;
98 }
99
100 // Retrieve size of reflected coordinates array
101 unsigned int size = inputUHTG->GetCellDims()[direction];
102
103 // Compute offset
104 if (this->Plane < 3)
105 {
106 double u = origin[direction];
107 double v = origin[direction] + size * scale[0];

Callers

nothing calls this directly

Calls 15

GetNumberOfLeavesMethod · 0.80
SetGridScaleMethod · 0.80
GetTuple1Method · 0.80
SetTuple1Method · 0.80
GetHasInterfaceMethod · 0.80
GetTuple3Method · 0.80
SetTuple3Method · 0.80
SetVectorsMethod · 0.80
GetNextTreeMethod · 0.80
CheckAbortMethod · 0.80
DeleteMethod · 0.65

Tested by

no test coverage detected