[vtkusers] How to add multiple viewports to vtkGenericOpenGLRenderWindow
Jay
jayavardhanravi at outlook.com
Mon Feb 25 11:03:14 EST 2019
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<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();*
Can we add multiple viewports to vtkGenericOpenGLRenderWindow ?
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
More information about the vtkusers
mailing list