30 vtkDataArray *newArray,
31 const size_t &nSpheres,
32 const size_t &nVerticesPerSphere,
33 const size_t &nComponents) {
34 auto oldData = ttkUtils::GetPointer<VTK_TT>(oldArray);
35 auto newData = ttkUtils::GetPointer<VTK_TT>(newArray);
37 for(
size_t i = 0; i < nSpheres; i++) {
38 size_t const sphereIndex = i * nVerticesPerSphere * nComponents;
39 for(
size_t j = 0; j < nComponents; j++) {
40 const auto &value = oldData[i * nComponents + j];
41 size_t newIndex = sphereIndex + j;
42 for(
size_t k = 0; k < nVerticesPerSphere; k++) {
43 newData[newIndex] = value;
44 newIndex += nComponents;
52 vtkInformationVector **inputVector,
53 vtkInformationVector *outputVector) {
54 auto input = vtkPointSet::GetData(inputVector[0], 0);
57 size_t const nPoints = input->GetNumberOfPoints();
61 this->
SetCenters(input->GetPoints()->GetData());
70 size_t nTriangles = 0;
74 auto output = vtkDataSet::GetData(outputVector);
75 auto outputPD = output->GetPointData();
78 if(this->CopyPointData) {
80 auto inputPD = input->GetPointData();
81 for(
size_t i = 0, n = inputPD->GetNumberOfArrays(); i < n; i++) {
82 auto oldArray = vtkDataArray::SafeDownCast(inputPD->GetAbstractArray(i));
83 if(!oldArray || oldArray->GetName() ==
nullptr) {
86 std::string
const oldArrayName(oldArray->GetName());
92 size_t const nComponents = oldArray->GetNumberOfComponents();
93 newArray->SetName(oldArray->GetName());
94 newArray->SetNumberOfComponents(nComponents);
95 newArray->SetNumberOfTuples(nVertices * nPoints);
97 switch(newArray->GetDataType()) {
98 vtkTemplateMacro((copyArrayData<VTK_TT>(
99 oldArray, newArray, nPoints, nVertices, nComponents)));
101 outputPD->AddArray(newArray);