103 vtkInformation *vtkNotUsed(request),
104 vtkInformationVector **inputVector,
105 vtkInformationVector *outputVector)
107 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
108 vtkInformation *outInfo = outputVector->GetInformationObject(0);
110 vtkDataSet *input = vtkDataSet::SafeDownCast(
111 inInfo->Get(vtkDataObject::DATA_OBJECT()));
112 vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast(
113 outInfo->Get(vtkUnstructuredGrid::DATA_OBJECT()));
115 vtkIdType numberOfCells = input->GetNumberOfCells();
117 vtkIntArray *cellDimensionArray = vtkIntArray::New();
118 cellDimensionArray->SetName(
"CellDimensionArray");
119 cellDimensionArray->SetNumberOfComponents(1);
120 cellDimensionArray->SetNumberOfTuples(numberOfCells);
122 for (
int i=0; i<numberOfCells; i++)
124 cellDimensionArray->SetValue(i,input->GetCell(i)->GetCellDimension());
127 input->GetCellData()->AddArray(cellDimensionArray);
130 Threshold->SetInputArrayToProcess(0,0,0,1,
"CellDimensionArray");
132 output->DeepCopy(
Threshold->GetOutput());
136 input->GetCellData()->RemoveArray(
"CellDimensionArray");
137 cellDimensionArray->Delete();