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

Method SetRenderWindowSize

Rendering/Parallel/vtkParallelRenderManager.cxx:1046–1074  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1044
1045//------------------------------------------------------------------------------
1046void vtkParallelRenderManager::SetRenderWindowSize()
1047{
1048 if (!this->RenderWindow->GetOffScreenRendering())
1049 {
1050 // Make sure we can support the requested image size.
1051 const int* screensize = this->RenderWindow->GetScreenSize();
1052 if (this->FullImageSize[0] > screensize[0])
1053 {
1054 // Reduce both dimensions to preserve aspect ratio.
1055 this->FullImageSize[1] = (this->FullImageSize[1] * screensize[0]) / this->FullImageSize[0];
1056 this->FullImageSize[0] = screensize[0];
1057 }
1058 if (this->FullImageSize[1] > screensize[1])
1059 {
1060 // Reduce both dimensions to preserve aspect ratio.
1061 this->FullImageSize[0] = (this->FullImageSize[0] * screensize[1]) / this->FullImageSize[1];
1062 this->FullImageSize[1] = screensize[1];
1063 }
1064
1065 // Make sure the reduced image is no bigger than the full image.
1066 this->ReducedImageSize[0] = std::min(this->ReducedImageSize[0], this->FullImageSize[0]);
1067 this->ReducedImageSize[1] = std::min(this->ReducedImageSize[1], this->FullImageSize[1]);
1068 }
1069
1070 // Correct image reduction factor.
1071 this->ImageReductionFactor = (double)this->FullImageSize[0] / this->ReducedImageSize[0];
1072
1073 this->RenderWindow->SetSize(this->FullImageSize[0], this->FullImageSize[1]);
1074}
1075
1076//------------------------------------------------------------------------------
1077vtkRendererCollection* vtkParallelRenderManager::GetRenderers()

Callers 1

SatelliteStartRenderMethod · 0.95

Calls 4

minFunction · 0.50
GetOffScreenRenderingMethod · 0.45
GetScreenSizeMethod · 0.45
SetSizeMethod · 0.45

Tested by

no test coverage detected