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

Method RequestData

Filters/Parallel/vtkGenerateProcessIds.cxx:29–68  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

27
28//------------------------------------------------------------------------------
29int vtkGenerateProcessIds::RequestData(vtkInformation* vtkNotUsed(request),
30 vtkInformationVector** inputVector, vtkInformationVector* outputVector)
31{
32 // get the info objects
33 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
34 vtkInformation* outInfo = outputVector->GetInformationObject(0);
35 if (!inInfo || !outInfo)
36 {
37 return 0;
38 }
39
40 // get the input and output
41 vtkDataSet* input = vtkDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
42 vtkDataSet* output = vtkDataSet::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
43 if (!input || !output)
44 {
45 return 0;
46 }
47
48 vtkIdType piece =
49 this->Controller ? static_cast<vtkIdType>(this->Controller->GetLocalProcessId()) : 0;
50 output->ShallowCopy(input);
51
52 if (this->GeneratePointData)
53 {
54 vtkIdType numberOfPoints = input->GetNumberOfPoints();
55 auto processIds = this->GenerateProcessIds(piece, numberOfPoints);
56 processIds->SetName("PointProcessIds");
57 output->GetPointData()->SetProcessIds(processIds);
58 }
59 if (this->GenerateCellData)
60 {
61 vtkIdType numberOfCells = input->GetNumberOfCells();
62 auto processIds = this->GenerateProcessIds(piece, numberOfCells);
63 processIds->SetName("CellProcessIds");
64 output->GetCellData()->SetProcessIds(processIds);
65 }
66
67 return 1;
68}
69
70//------------------------------------------------------------------------------
71vtkSmartPointer<vtkConstantArray<vtkIdType>> vtkGenerateProcessIds::GenerateProcessIds(

Callers

nothing calls this directly

Calls 11

GenerateProcessIdsMethod · 0.95
GetInformationObjectMethod · 0.80
SetProcessIdsMethod · 0.80
GetMethod · 0.45
GetLocalProcessIdMethod · 0.45
ShallowCopyMethod · 0.45
GetNumberOfPointsMethod · 0.45
SetNameMethod · 0.45
GetPointDataMethod · 0.45
GetNumberOfCellsMethod · 0.45
GetCellDataMethod · 0.45

Tested by

no test coverage detected