MCPcopy Create free account
hub / github.com/Kitware/VTK / RequestData

Method RequestData

Filters/Extraction/vtkExtractGeometry.cxx:315–407  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

313
314//------------------------------------------------------------------------------
315int 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;

Callers

nothing calls this directly

Calls 15

GetInformationObjectMethod · 0.80
CheckAbortMethod · 0.80
SetCellListMethod · 0.80
ExecuteFunction · 0.70
GetDataFunction · 0.50
ForFunction · 0.50
GetNumberOfPointsMethod · 0.45
SetTargetMethod · 0.45
AddObserverMethod · 0.45
ProcessRequestMethod · 0.45
EvaluateFunctionMethod · 0.45

Tested by

no test coverage detected