----------------------------------------------------------------------------
| 176 | |
| 177 | //---------------------------------------------------------------------------- |
| 178 | int vtkGeometryFilter::RequestData(vtkInformation* vtkNotUsed(request), |
| 179 | vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 180 | { |
| 181 | // get the info objects |
| 182 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 183 | vtkInformation* excInfo = inputVector[1]->GetInformationObject(0); |
| 184 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 185 | |
| 186 | // get the input and output |
| 187 | vtkDataSet* input = vtkDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 188 | vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 189 | |
| 190 | vtkIdType numPts = input->GetNumberOfPoints(); |
| 191 | vtkIdType numCells = input->GetNumberOfCells(); |
| 192 | |
| 193 | if (numPts == 0 || numCells == 0) |
| 194 | { |
| 195 | return 1; |
| 196 | } |
| 197 | |
| 198 | // Check to see if excluded faces have been provided, and is so prepare the data |
| 199 | // for use. |
| 200 | vtkPolyData* excFaces = nullptr; |
| 201 | if (excInfo) |
| 202 | { |
| 203 | excFaces = vtkPolyData::SafeDownCast(excInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 204 | } |
| 205 | int wholeExtent[6] = { 0, -1, 0, -1, 0, -1 }; |
| 206 | if (input->GetExtentType() == VTK_3D_EXTENT) |
| 207 | { |
| 208 | const int* wholeExt32; |
| 209 | wholeExt32 = inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()); |
| 210 | std::copy(wholeExt32, wholeExt32 + 6, wholeExtent); |
| 211 | } |
| 212 | |
| 213 | // Prepare to delegate based on dataset type and characteristics. |
| 214 | if (vtkPolyData::SafeDownCast(input)) |
| 215 | { |
| 216 | return this->PolyDataExecute(input, output, excFaces); |
| 217 | } |
| 218 | else if (vtkUnstructuredGridBase::SafeDownCast(input)) |
| 219 | { |
| 220 | return this->UnstructuredGridExecute(input, output, nullptr, excFaces); |
| 221 | } |
| 222 | else if (vtkImageData::SafeDownCast(input) || vtkRectilinearGrid::SafeDownCast(input) || |
| 223 | vtkStructuredGrid::SafeDownCast(input)) |
| 224 | { |
| 225 | return this->StructuredExecute(input, output, wholeExtent, excFaces); |
| 226 | } |
| 227 | else |
| 228 | { |
| 229 | // Use the general case |
| 230 | return this->DataSetExecute(input, output, excFaces); |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | //------------------------------------------------------------------------------ |
| 235 | void vtkGeometryFilter::SetExcludedFacesData(vtkPolyData* input) |
nothing calls this directly
no test coverage detected