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

Method Render

Interaction/Image/vtkImageViewer2.cxx:618–669  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

616
617//------------------------------------------------------------------------------
618void vtkImageViewer2::Render()
619{
620 if (this->FirstRender)
621 {
622 // Initialize the size if not set yet
623
624 vtkAlgorithm* input = this->GetInputAlgorithm();
625 if (input)
626 {
627 input->UpdateInformation();
628 int* w_ext =
629 this->GetInputInformation()->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT());
630 int xs = 0, ys = 0;
631
632 switch (this->SliceOrientation)
633 {
634 case vtkImageViewer2::SLICE_ORIENTATION_XY:
635 default:
636 xs = w_ext[1] - w_ext[0] + 1;
637 ys = w_ext[3] - w_ext[2] + 1;
638 break;
639
640 case vtkImageViewer2::SLICE_ORIENTATION_XZ:
641 xs = w_ext[1] - w_ext[0] + 1;
642 ys = w_ext[5] - w_ext[4] + 1;
643 break;
644
645 case vtkImageViewer2::SLICE_ORIENTATION_YZ:
646 xs = w_ext[3] - w_ext[2] + 1;
647 ys = w_ext[5] - w_ext[4] + 1;
648 break;
649 }
650
651 // if it would be smaller than 150 by 100 then limit to 150 by 100
652 if (this->RenderWindow->GetSize()[0] == 0)
653 {
654 this->RenderWindow->SetSize(xs < 150 ? 150 : xs, ys < 100 ? 100 : ys);
655 }
656
657 if (this->Renderer)
658 {
659 this->Renderer->ResetCamera();
660 this->Renderer->GetActiveCamera()->SetParallelScale(xs < 150 ? 75 : (xs - 1) / 2.0);
661 }
662 this->FirstRender = 0;
663 }
664 }
665 if (this->GetInput())
666 {
667 this->RenderWindow->Render();
668 }
669}
670
671//------------------------------------------------------------------------------
672const char* vtkImageViewer2::GetWindowName()

Callers 2

SetSliceMethod · 0.95
SetSliceOrientationMethod · 0.95

Calls 11

GetInputAlgorithmMethod · 0.95
GetInputInformationMethod · 0.95
GetInputMethod · 0.95
SetParallelScaleMethod · 0.80
GetActiveCameraMethod · 0.80
RenderMethod · 0.65
UpdateInformationMethod · 0.45
GetMethod · 0.45
GetSizeMethod · 0.45
SetSizeMethod · 0.45
ResetCameraMethod · 0.45

Tested by

no test coverage detected