MCPcopy Create free account
hub / github.com/MITK/MITK / Fit

Method Fit

Modules/Core/src/Controllers/mitkCameraController.cpp:318–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318void mitk::CameraController::Fit()
319{
320 if (this->GetRenderer()->GetMapperID() == BaseRenderer::Standard2D)
321 {
322 this->GetRenderer()->GetVtkRenderer()->GetActiveCamera()->SetParallelScale(ComputeMaxParallelScale());
323
324 this->GetRenderer()->GetVtkRenderer()->GetActiveCamera()->SetClippingRange(0.1, 1000000);
325 // Reason for huge range: VTK seems to calculate the clipping planes wrong for small values. See VTK bug (id #7823)
326 // in VTK bugtracker.
327
328 Point2D planePoint;
329 planePoint[0] = this->GetRenderer()->GetCurrentWorldPlaneGeometry()->GetExtentInMM(0) * 0.5;
330 planePoint[1] = this->GetRenderer()->GetCurrentWorldPlaneGeometry()->GetExtentInMM(1) * 0.5;
331 MoveCameraToPoint(planePoint);
332 }
333}
334
335void mitk::CameraController::SetScaleFactorInMMPerDisplayUnit(ScalarType scale)
336{

Callers 3

InitSizeMethod · 0.45

Calls 3

GetExtentInMMMethod · 0.80
GetRendererMethod · 0.45
GetVtkRendererMethod · 0.45

Tested by

no test coverage detected