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

Method RequestData

Filters/ParallelMPI/vtkDistributedPointCloudFilter.cxx:51–96  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

49
50//------------------------------------------------------------------------------
51int vtkDistributedPointCloudFilter::RequestData(
52 vtkInformation*, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
53{
54 vtkPointSet* input = vtkPointSet::GetData(inputVector[0]);
55 if (!input)
56 {
57 vtkErrorMacro("No valid input!");
58 return 0;
59 }
60
61 vtkPolyData* output = vtkPolyData::GetData(outputVector);
62 if (!output)
63 {
64 vtkErrorMacro("No output object!");
65 return 0;
66 }
67
68 vtkMPIController* controller = vtkMPIController::SafeDownCast(this->Controller);
69 if (!controller)
70 {
71 // No MPI controller? Just pass points & point data
72 output->SetPoints(input->GetPoints());
73 output->GetPointData()->ShallowCopy(input->GetPointData());
74 return 1;
75 }
76
77 std::vector<vtkMPIController*> subControllersTree;
78 if (this->InitializeKdTree(subControllersTree))
79 {
80 double bounds[6];
81 this->OptimizeBoundingBox(subControllersTree, input, bounds);
82 vtkDistributedPointCloudFilter::GetPointsInsideBounds(controller, input, output, bounds);
83 }
84 else
85 {
86 vtkErrorMacro("Sub-communicators are not correctly initialized, no distribution performed");
87 return 0;
88 }
89 // Destroy the kdtree controllers
90 for (auto* c : subControllersTree)
91 {
92 c->Delete();
93 }
94
95 return 1;
96}
97
98//------------------------------------------------------------------------------
99bool vtkDistributedPointCloudFilter::InitializeKdTree(std::vector<vtkMPIController*>& kdTreeRounds)

Callers

nothing calls this directly

Calls 8

InitializeKdTreeMethod · 0.95
OptimizeBoundingBoxMethod · 0.95
DeleteMethod · 0.65
GetDataFunction · 0.50
SetPointsMethod · 0.45
GetPointsMethod · 0.45
ShallowCopyMethod · 0.45
GetPointDataMethod · 0.45

Tested by

no test coverage detected