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

Method StructuredExecute

Filters/Geometry/vtkGeometryFilter.cxx:3466–3529  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3464
3465//------------------------------------------------------------------------------
3466int vtkGeometryFilter::StructuredExecute(vtkDataSet* input, vtkPolyData* output, int* wholeExtent,
3467 vtkPolyData* excludedFaces, bool* extractFace)
3468{
3469 int dataDim = -1;
3470 if (auto imageData = vtkImageData::SafeDownCast(input))
3471 {
3472 dataDim = imageData->GetDataDimension();
3473 }
3474 else if (auto structured = vtkStructuredGrid::SafeDownCast(input))
3475 {
3476 dataDim = structured->GetDataDimension();
3477 }
3478 else if (auto rectilinear = vtkRectilinearGrid::SafeDownCast(input))
3479 {
3480 dataDim = rectilinear->GetDataDimension();
3481 }
3482 assert(dataDim != -1);
3483
3484 // Delegate to the generic dataset processing if structuredGrid is not 3d or cell/point/extent
3485 // clipping is requested. Otherwise. use the fast structured algorithms. This is done for
3486 // simplification purposes.
3487 if (dataDim != 3 || this->GetCellClipping() || this->GetPointClipping() ||
3488 this->GetExtentClipping())
3489 {
3490 return this->DataSetExecute(input, output, excludedFaces);
3491 }
3492
3493#ifdef VTK_USE_64BIT_IDS
3494 bool use64BitsIds = (input->GetNumberOfPoints() > VTK_TYPE_INT32_MAX ||
3495 input->GetNumberOfCells() > VTK_TYPE_INT32_MAX);
3496 if (use64BitsIds)
3497 {
3498 using TInputIdType = vtkTypeInt64;
3499 vtkExcludedFaces<TInputIdType> exc;
3500 if (excludedFaces)
3501 {
3502 exc.ExcludedFaces = excludedFaces;
3503 vtkCellArray* excPolys = excludedFaces->GetPolys();
3504 if (excPolys->GetNumberOfCells() > 0)
3505 {
3506 exc.Links = new vtkStaticCellLinksTemplate<TInputIdType>;
3507 exc.Links->BuildLinks(input->GetNumberOfPoints(), excPolys->GetNumberOfCells(), excPolys);
3508 }
3509 }
3510 return ExecuteStructured<TInputIdType>(this, input, output, wholeExtent, &exc, extractFace);
3511 }
3512 else
3513#endif
3514 {
3515 using TInputIdType = vtkTypeInt32;
3516 vtkExcludedFaces<TInputIdType> exc;
3517 if (excludedFaces)
3518 {
3519 exc.ExcludedFaces = excludedFaces;
3520 vtkCellArray* excPolys = excludedFaces->GetPolys();
3521 if (excPolys->GetNumberOfCells() > 0)
3522 {
3523 exc.Links = new vtkStaticCellLinksTemplate<TInputIdType>;

Callers 3

RequestDataMethod · 0.95

Calls 7

DataSetExecuteMethod · 0.95
GetPolysMethod · 0.80
assertFunction · 0.50
GetDataDimensionMethod · 0.45
GetNumberOfPointsMethod · 0.45
GetNumberOfCellsMethod · 0.45
BuildLinksMethod · 0.45

Tested by 1