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

Method RequestData

Filters/Geometry/vtkDataSetSurfaceFilter.cxx:382–491  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

380
381//------------------------------------------------------------------------------
382int vtkDataSetSurfaceFilter::RequestData(vtkInformation* vtkNotUsed(request),
383 vtkInformationVector** inputVector, vtkInformationVector* outputVector)
384{
385 // get the info objects
386 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
387 vtkInformation* outInfo = outputVector->GetInformationObject(0);
388
389 // get the input and output
390 vtkDataSet* input = vtkDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
391 vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
392
393 vtkIdType numCells = input->GetNumberOfCells();
394 int wholeExt[6] = { 0, -1, 0, -1, 0, -1 };
395 if (input->CheckAttributes())
396 {
397 return 1;
398 }
399
400 if (numCells == 0)
401 {
402 vtkDebugMacro(<< "Number of cells is zero, no data to process.");
403 return 1;
404 }
405
406 if (input->GetExtentType() == VTK_3D_EXTENT)
407 {
408 const int* wholeExt32;
409 wholeExt32 = inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT());
410 std::copy(wholeExt32, wholeExt32 + 6, wholeExt);
411 }
412
413 switch (input->GetDataObjectType())
414 {
415 case VTK_UNSTRUCTURED_GRID:
416 case VTK_UNSTRUCTURED_GRID_BASE:
417 {
418 this->UnstructuredGridExecute(input, output);
419 output->CheckAttributes();
420 return 1;
421 }
422 case VTK_RECTILINEAR_GRID:
423 {
424 auto rg = vtkRectilinearGrid::SafeDownCast(input);
425 return this->StructuredExecute(input, output, rg->GetExtent(), wholeExt);
426 }
427 case VTK_STRUCTURED_GRID:
428 {
429 auto sg = vtkStructuredGrid::SafeDownCast(input);
430 return this->StructuredExecute(input, output, sg->GetExtent(), wholeExt);
431 }
432 case VTK_UNIFORM_GRID:
433 case VTK_STRUCTURED_POINTS:
434 case VTK_IMAGE_DATA:
435 {
436 auto img = vtkImageData::SafeDownCast(input);
437 return this->StructuredExecute(input, output, img->GetExtent(), wholeExt);
438 }
439 case VTK_POLY_DATA:

Callers

nothing calls this directly

Calls 15

StructuredExecuteMethod · 0.95
DataSetExecuteMethod · 0.95
GetInformationObjectMethod · 0.80
CheckAttributesMethod · 0.80
GetDataObjectTypeMethod · 0.80
CheckAbortMethod · 0.80
DeleteMethod · 0.65
copyFunction · 0.50
NewFunction · 0.50
GetMethod · 0.45
GetNumberOfCellsMethod · 0.45

Tested by

no test coverage detected