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

Method PushToViewport

Rendering/Parallel/vtkSynchronizedRenderers.cxx:720–745  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

718
719//------------------------------------------------------------------------------
720bool vtkSynchronizedRenderers::vtkRawImage::PushToViewport(vtkRenderer* ren, bool blend)
721{
722 if (!this->IsValid())
723 {
724 vtkGenericWarningMacro("Image not valid. Cannot push to screen.");
725 return false;
726 }
727
728 int size[2], low_point[2];
729 ren->GetTiledSizeAndOrigin(&size[0], &size[1], &low_point[0], &low_point[1]);
730 vtkLogF(TRACE, "GetTiledSizeAndOrigin(w=%d, h=%d, x=%d, y=%d)", size[0], size[1], low_point[0],
731 low_point[1]);
732 if (size[0] <= 0 || size[1] <= 0)
733 {
734 vtkGenericWarningMacro("Viewport empty. Cannot push to screen.");
735 return false;
736 }
737
738 vtkOpenGLState* ostate = static_cast<vtkOpenGLRenderWindow*>(ren->GetVTKWindow())->GetState();
739 ostate->vtkglEnable(GL_SCISSOR_TEST);
740 ostate->vtkglViewport(low_point[0], low_point[1], size[0], size[1]);
741 ostate->vtkglScissor(low_point[0], low_point[1], size[0], size[1]);
742
743 ren->Clear();
744 return this->PushToFrameBuffer(ren, blend);
745}
746
747//------------------------------------------------------------------------------
748bool vtkSynchronizedRenderers::vtkRawImage::PushToFrameBuffer(vtkRenderer* ren, bool blend)

Callers 2

RenderMethod · 0.80
PushImageToScreenMethod · 0.80

Calls 9

PushToFrameBufferMethod · 0.95
GetVTKWindowMethod · 0.80
vtkglEnableMethod · 0.80
vtkglViewportMethod · 0.80
vtkglScissorMethod · 0.80
IsValidMethod · 0.45
GetTiledSizeAndOriginMethod · 0.45
GetStateMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected