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

Method UniformScale

Interaction/Style/vtkInteractorStyleTrackballActor.cxx:466–496  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

464
465//------------------------------------------------------------------------------
466void vtkInteractorStyleTrackballActor::UniformScale()
467{
468 if (this->CurrentRenderer == nullptr || this->InteractionProp == nullptr)
469 {
470 return;
471 }
472
473 vtkRenderWindowInteractor* rwi = this->Interactor;
474
475 int dy = rwi->GetEventPosition()[1] - rwi->GetLastEventPosition()[1];
476
477 double* obj_center = this->InteractionProp->GetCenter();
478 double* center = this->CurrentRenderer->GetCenter();
479
480 double yf = dy / center[1] * this->MotionFactor;
481 double scaleFactor = pow(1.1, yf);
482
483 double** rotate = nullptr;
484
485 double scale[3];
486 scale[0] = scale[1] = scale[2] = scaleFactor;
487
488 this->Prop3DTransform(this->InteractionProp, obj_center, 0, rotate, scale);
489
490 if (this->AutoAdjustCameraClippingRange)
491 {
492 this->CurrentRenderer->ResetCameraClippingRange();
493 }
494
495 rwi->Render();
496}
497
498//------------------------------------------------------------------------------
499void vtkInteractorStyleTrackballActor::PrintSelf(ostream& os, vtkIndent indent)

Callers 1

OnMouseMoveMethod · 0.95

Calls 5

Prop3DTransformMethod · 0.95
RenderMethod · 0.65
powFunction · 0.50
GetCenterMethod · 0.45

Tested by

no test coverage detected