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

Method Scale

Common/DataModel/vtkBoundingBox.cxx:388–428  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description: Scale each dimension of the box by some given factor. If the box is not valid, it stays unchanged. If the scalar factor is negative, bounds are flipped: for example, if (xMin,xMax)=(-2,4) and sx=-3, (xMin,xMax) becomes (-12,6).

Source from the content-addressed store, hash-verified

386// If the scalar factor is negative, bounds are flipped: for example,
387// if (xMin,xMax)=(-2,4) and sx=-3, (xMin,xMax) becomes (-12,6).
388void vtkBoundingBox::Scale(double sx, double sy, double sz)
389{
390 if (this->IsValid())
391 {
392 if (sx >= 0.0)
393 {
394 this->MinPnt[0] *= sx;
395 this->MaxPnt[0] *= sx;
396 }
397 else
398 {
399 double tmp = this->MinPnt[0];
400 this->MinPnt[0] = sx * this->MaxPnt[0];
401 this->MaxPnt[0] = sx * tmp;
402 }
403
404 if (sy >= 0.0)
405 {
406 this->MinPnt[1] *= sy;
407 this->MaxPnt[1] *= sy;
408 }
409 else
410 {
411 double tmp = this->MinPnt[1];
412 this->MinPnt[1] = sy * this->MaxPnt[1];
413 this->MaxPnt[1] = sy * tmp;
414 }
415
416 if (sz >= 0.0)
417 {
418 this->MinPnt[2] *= sz;
419 this->MaxPnt[2] *= sz;
420 }
421 else
422 {
423 double tmp = this->MinPnt[2];
424 this->MinPnt[2] = sz * this->MaxPnt[2];
425 this->MaxPnt[2] = sz * tmp;
426 }
427 }
428}
429
430//------------------------------------------------------------------------------
431void vtkBoundingBox::Scale(double s[3])

Callers 15

ComputeViewTransformMethod · 0.45
MouseWheelEventMethod · 0.45
ZoomAxesMethod · 0.45
ZoomMethod · 0.45
CalculateTransformsMethod · 0.45
ScaleUpAxesMethod · 0.45
ScaleDownAxesMethod · 0.45
InitializeFutureBoxMethod · 0.45

Calls 1

IsValidMethod · 0.95

Tested by 6

TestColumnTreeFunction · 0.36
TestHeatmapItemFunction · 0.36
TestDendrogramItemFunction · 0.36
TestTanglegramItemFunction · 0.36
TestTreeHeatmapItemFunction · 0.36