How to add multiple viewports to vtkGenericOpenGLRenderWindow

classic Classic list List threaded Threaded
1 message Options
Jay
Reply | Threaded
Open this post in threaded view
|

How to add multiple viewports to vtkGenericOpenGLRenderWindow

Jay
This post was updated on .
I had tried to add multiple view ports to vtkRenderWindow and was able to get
the various viewports displayed as expected.

*            vtkSmartPointer<vtkRenderer> testRendererA =
vtkSmartPointer<vtkRenderer>::New();
            vtkSmartPointer<vtkRenderer> testRendererB =
vtkSmartPointer<vtkRenderer>::New();
            vtkSmartPointer<vtkRenderWindow> testWindow =
vtkSmartPointer<vtkRenderWindow>::New();
            testRendererA->AddActor(customGraphics_->overtube_model);
            testRendererB->AddActor(customGraphics_->overtube_model);

            testWindow->AddRenderer(testRendererA);
            testRendererA->SetViewport(0,0,0.5,1);

            testWindow->AddRenderer(testRendererB);
            testRendererB->SetViewport(0.5,0,1,1);

            testWindow->Render();*

I tried to do the same for adding the viewports to the
vtkGenericOpenGLRenderWindow but was only able to display only one view port
and other viewport is blank. The last added renderer was displayed and the
previously added renderers were not displayed. In the below pseudo code
testRendererB was displayed & testRendererA was not displayed

*            vtkSmartPointer<vtkRenderer> testRendererA =
vtkSmartPointer<vtkRenderer>::New();
            vtkSmartPointer<vtkRenderer> testRendererB =
vtkSmartPointer<vtkRenderer>::New();
            vtkSmartPointer<vtkGenericOpenGLRenderWindow> testWindow =
vtkSmartPointer<vtkGenericOpenGLRenderWindow>::New();
            testRendererA->AddActor(customGraphics_->overtube_model);
            testRendererB->AddActor(customGraphics_->overtube_model);

            testWindow->AddRenderer(testRendererA);
            testRendererA->SetViewport(0,0,0.5,1);

            testWindow->AddRenderer(testRendererB);
            testRendererB->SetViewport(0.5,0,1,1);

            testWindow->Render();*

Can we add multiple viewports to vtkGenericOpenGLRenderWindow ?



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers