48 vtkInformationVector **inputVector,
49 vtkInformationVector *outputVector) {
55 auto input = vtkUnstructuredGrid::GetData(inputVector[0]);
56 if(input ==
nullptr) {
60 size_t const nInputPoints = input->GetNumberOfPoints();
61 size_t const nInputCells = input->GetNumberOfCells();
63 auto inputPointSizes = this->GetInputArrayToProcess(0, inputVector);
64 if(!inputPointSizes) {
65 this->
printErr(
"Unable to retrieve point size array.");
74 auto inputPoints = input->GetPoints();
77 outputPoints->SetDataType(inputPoints->GetDataType());
81 outputPoints->SetNumberOfPoints(nOutputPoints);
84 auto inputConnectivityArray = input->GetCells()->GetConnectivityArray();
92 inputConnectivityArray->NewInstance());
93 outputConnectivityArray->SetNumberOfValues(outputTopologySize);
96 inputConnectivityArray->NewInstance());
97 outputOffsetArray->SetNumberOfValues(nOutputCells + 1);
106 inputPoints->GetDataType(), inputPointSizes->GetDataType(),
107 outputConnectivityArray->GetDataType(),
108 (status = this->execute<T2, T0, T1>(
110 ttkUtils::GetPointer<T0>(outputPoints->GetData()),
111 ttkUtils::GetPointer<T2>(outputConnectivityArray),
112 ttkUtils::GetPointer<T2>(outputOffsetArray),
115 ttkUtils::GetPointer<T0>(inputPoints->GetData()),
116 ttkUtils::GetPointer<T2>(input->GetCells()->GetConnectivityArray()),
117 nInputPoints, nInputCells, ttkUtils::GetPointer<T1>(inputPointSizes),
118 this->GetSizeScale(), this->GetSizeAxis())));
121 inputPoints->GetDataType(), inputPointSizes->GetDataType(),
122 outputConnectivityArray->GetDataType(),
123 (status = this->execute2<T2, T0, T1>(
125 ttkUtils::GetPointer<T0>(outputPoints->GetData()),
126 ttkUtils::GetPointer<T2>(outputConnectivityArray),
127 ttkUtils::GetPointer<T2>(outputOffsetArray),
130 ttkUtils::GetPointer<T0>(inputPoints->GetData()),
131 ttkUtils::GetPointer<T2>(input->GetCells()->GetConnectivityArray()),
132 nInputPoints, nInputCells, this->GetSubdivisions(),
133 ttkUtils::GetPointer<T1>(inputPointSizes), this->GetSizeScale(),
134 this->GetSizeAxis())));
144 auto meshedGraph = vtkUnstructuredGrid::GetData(outputVector);
146 meshedGraph->SetPoints(outputPoints);
149 outputCellArray->SetData(outputOffsetArray, outputConnectivityArray);
150 meshedGraph->SetCells(
156 auto iPointData = input->GetPointData();
157 auto oPointData = meshedGraph->GetPointData();
159 for(
int i = 0; i < iPointData->GetNumberOfArrays(); i++) {
160 auto iArray = iPointData->GetArray(i);
161 if(iArray->GetNumberOfComponents() > 1)
165 vtkDataArray::CreateDataArray(iArray->GetDataType()));
166 oArray->SetName(iArray->GetName());
167 oArray->SetNumberOfTuples(nOutputPoints);
168 oArray->SetNumberOfComponents(1);
169 oPointData->AddArray(oArray);
172 iArray->GetDataType(), inputConnectivityArray->GetDataType(),
173 (status = this->mapInputPointDataToOutputPointData<T0, T1>(
174 ttkUtils::GetPointer<T0>(oArray),
176 nInputPoints, nInputCells,
177 ttkUtils::GetPointer<T1>(inputConnectivityArray),
178 ttkUtils::GetPointer<T0>(iArray), this->GetUseQuadraticCells(),
179 this->GetSubdivisions())));
188 auto iCellData = input->GetCellData();
189 auto oCellData = meshedGraph->GetCellData();
191 for(
int i = 0; i < iCellData->GetNumberOfArrays(); i++) {
192 auto iArray = iCellData->GetArray(i);
193 if(iArray->GetNumberOfComponents() > 1)
197 vtkDataArray::CreateDataArray(iArray->GetDataType()));
198 oArray->SetName(iArray->GetName());
199 oArray->SetNumberOfTuples(nOutputCells);
200 oArray->SetNumberOfComponents(1);
201 oCellData->AddArray(oArray);
204 iArray->GetDataType(),
205 (status = this->mapInputCellDataToOutputCellData<T0>(
206 ttkUtils::GetPointer<T0>(oArray), nInputCells,
207 ttkUtils::GetPointer<T0>(iArray), this->GetUseQuadraticCells())));