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

Method ComputeScalarRange

Common/DataModel/vtkStructuredGrid.cxx:461–508  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Override this method because of blanking

Source from the content-addressed store, hash-verified

459//------------------------------------------------------------------------------
460// Override this method because of blanking
461void vtkStructuredGrid::ComputeScalarRange()
462{
463 if (this->GetMTime() > this->ScalarRangeComputeTime)
464 {
465 vtkDataArray* ptScalars = this->PointData->GetScalars();
466 vtkDataArray* cellScalars = this->CellData->GetScalars();
467 double ptRange[2];
468 double cellRange[2];
469 double s;
470
471 ptRange[0] = VTK_DOUBLE_MAX;
472 ptRange[1] = VTK_DOUBLE_MIN;
473 if (ptScalars)
474 {
475 vtkIdType num = this->GetNumberOfPoints();
476 for (vtkIdType id = 0; id < num; ++id)
477 {
478 if (this->IsPointVisible(id))
479 {
480 s = ptScalars->GetComponent(id, 0);
481 ptRange[0] = std::min(s, ptRange[0]);
482 ptRange[1] = std::max(s, ptRange[1]);
483 }
484 }
485 }
486
487 cellRange[0] = ptRange[0];
488 cellRange[1] = ptRange[1];
489 if (cellScalars)
490 {
491 vtkIdType num = this->GetNumberOfCells();
492 for (vtkIdType id = 0; id < num; ++id)
493 {
494 if (this->IsCellVisible(id))
495 {
496 s = cellScalars->GetComponent(id, 0);
497 cellRange[0] = std::min(s, cellRange[0]);
498 cellRange[1] = std::max(s, cellRange[1]);
499 }
500 }
501 }
502
503 this->ScalarRange[0] = (cellRange[0] >= VTK_DOUBLE_MAX ? 0.0 : cellRange[0]);
504 this->ScalarRange[1] = (cellRange[1] <= VTK_DOUBLE_MIN ? 1.0 : cellRange[1]);
505
506 this->ScalarRangeComputeTime.Modified();
507 }
508}
509
510//------------------------------------------------------------------------------
511void vtkStructuredGrid::Crop(const int* updateExtent)

Callers

nothing calls this directly

Calls 10

IsPointVisibleMethod · 0.95
GetNumberOfCellsMethod · 0.95
IsCellVisibleMethod · 0.95
minFunction · 0.50
maxFunction · 0.50
GetMTimeMethod · 0.45
GetScalarsMethod · 0.45
GetNumberOfPointsMethod · 0.45
GetComponentMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected