------------------------------------------------------------------------------
| 313 | |
| 314 | //------------------------------------------------------------------------------ |
| 315 | int vtkExtractGeometry::RequestData( |
| 316 | vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 317 | { |
| 318 | // get the input |
| 319 | vtkDataSet* input = vtkDataSet::GetData(inputVector[0]->GetInformationObject(0)); |
| 320 | if (!input) |
| 321 | { |
| 322 | return 0; |
| 323 | } |
| 324 | if (input->GetNumberOfPoints() < 1) |
| 325 | { |
| 326 | return 1; |
| 327 | } |
| 328 | |
| 329 | if (!this->GetExtractInside() && this->GetExtractOnlyBoundaryCells() && |
| 330 | this->GetExtractBoundaryCells() && |
| 331 | vtk3DLinearGridCrinkleExtractor::CanFullyProcessDataObject(input)) |
| 332 | { |
| 333 | vtkNew<vtk3DLinearGridCrinkleExtractor> linear3DExtractor; |
| 334 | linear3DExtractor->SetImplicitFunction(this->GetImplicitFunction()); |
| 335 | linear3DExtractor->SetCopyPointData(true); |
| 336 | linear3DExtractor->SetCopyCellData(true); |
| 337 | |
| 338 | vtkNew<vtkEventForwarderCommand> progressForwarder; |
| 339 | progressForwarder->SetTarget(this); |
| 340 | linear3DExtractor->AddObserver(vtkCommand::ProgressEvent, progressForwarder); |
| 341 | |
| 342 | return linear3DExtractor->ProcessRequest(request, inputVector, outputVector); |
| 343 | } |
| 344 | |
| 345 | vtkDebugMacro(<< "Extracting geometry"); |
| 346 | |
| 347 | if (!this->ImplicitFunction) |
| 348 | { |
| 349 | vtkErrorMacro(<< "No implicit function specified"); |
| 350 | return 1; |
| 351 | } |
| 352 | |
| 353 | const double multiplier = this->ExtractInside ? 1.0 : -1.0; |
| 354 | |
| 355 | vtkNew<vtkUnsignedCharArray> insidenessArray; |
| 356 | vtkNew<vtkDoubleArray> scalarArray; |
| 357 | // call that to guarantee thread safety |
| 358 | this->ImplicitFunction->EvaluateFunction(0, 0, 0); |
| 359 | using PointsDispatcher = vtkArrayDispatch::DispatchByArray<vtkArrayDispatch::AllPointArrays>; |
| 360 | auto points = input->GetPoints()->GetData(); |
| 361 | if (!this->ExtractBoundaryCells) |
| 362 | { |
| 363 | EvaluatePointsInsidenessWorker worker; |
| 364 | if (!PointsDispatcher::Execute( |
| 365 | points, worker, this, this->ImplicitFunction, multiplier, insidenessArray.Get())) |
| 366 | { |
| 367 | worker(points, this, this->ImplicitFunction, multiplier, insidenessArray.Get()); |
| 368 | } |
| 369 | } |
| 370 | else |
| 371 | { |
| 372 | EvaluatePointsScalarsWorker worker; |
nothing calls this directly
no test coverage detected