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

Method CreatePartition

Filters/General/vtkExplodeDataSet.cxx:54–76  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

52
53//------------------------------------------------------------------------------
54vtkPointSet* vtkExplodeDataSet::CreatePartition(vtkDataSet* input, vtkIdList* partCellIds)
55{
56 vtkPolyData* inputPD = vtkPolyData::SafeDownCast(input);
57 if (inputPD)
58 {
59 vtkPolyData* poly = vtkPolyData::New();
60 poly->AllocateCopy(inputPD);
61 // use input nb of points as a max. Squeeze it later.
62 poly->GetPointData()->CopyAllocate(input->GetPointData(), input->GetNumberOfPoints());
63 poly->GetCellData()->CopyAllocate(input->GetCellData(), partCellIds->GetNumberOfIds());
64 poly->CopyCells(inputPD, partCellIds);
65 poly->Squeeze();
66 return poly;
67 }
68
69 vtkNew<vtkExtractCells> extraction;
70 extraction->SetInputData(input);
71 extraction->SetCellList(partCellIds);
72 extraction->Update();
73 vtkUnstructuredGrid* ugrid = extraction->GetOutput();
74 ugrid->Register(nullptr);
75 return ugrid;
76}
77
78//------------------------------------------------------------------------------
79int vtkExplodeDataSet::RequestData(vtkInformation* vtkNotUsed(request),

Callers 1

RequestDataMethod · 0.95

Calls 14

AllocateCopyMethod · 0.80
SetCellListMethod · 0.80
NewFunction · 0.50
CopyAllocateMethod · 0.45
GetPointDataMethod · 0.45
GetNumberOfPointsMethod · 0.45
GetCellDataMethod · 0.45
GetNumberOfIdsMethod · 0.45
CopyCellsMethod · 0.45
SqueezeMethod · 0.45
SetInputDataMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected