[vtkusers] Multiple renderers

Jens G. jens-devel at gmx.de
Thu Jan 12 13:15:51 EST 2006


Am Donnerstag, 12. Januar 2006 17:49 schrieben Sie:
> Ok , but I want the same viewport for both, so they are overlayed
No, devide the area of the viewport in two parts like this and add both 
renderer to the vtkRenderWindow with renWin->AddRenderer(..):
 ren1->SetViewport( 0, 0, 0.5, 1 );
 ren2->SetViewport( 0.5, 0, 1, 1 );
 renWin->AddRenderer( ren1 );
 renWin->AddRenderer( ren2 );
	// 0=0% of the Viewport-Width/Viewport-Height.
	// 0.5=50% of the Viewport-Width/Viewport-Height.
	// 1=100% of the Viewport-Width/Viewport-Height.
SetViewport asks for position of the left-upper-corner und right-lower-corner 
which the renderer should use.

		Greetings
			Jens
>
> 2006/1/10, Jens G. <jens-devel at gmx.de>:
> > Hi
> > You can have multiple renderers in a render window. Spezify the area of
> > the
> > window for each renderer with vtkRenderer::SetViewport(...)
> >
> >         Greetings
> >                 Jens
> >
> > Am Dienstag, 10. Januar 2006 14:19 schrieb Jesús Spí­nola:
> > > Hello,
> > >
> > > i'm developing a simple application that visualizes medical datasets in
> > > different views ( axial, coronal , sagittal ) with vtkImageViewer2.
> > >
> > > My purpose is to draw simple objects ( like spheres, quads, lines, etc
> > > )
> >
> > on
> >
> > > top of the current view, that represent annotations of that volume (
> >
> > like
> >
> > > distances, angles , ROI's, etc )
> > > For example, if i'm taking a distance, i wan't to see a little circle
> >
> > for
> >
> > > the first and the second point and a line that connects both points.
> > >
> > > I thought that could be a good idea to draw in a different renderer
> >
> > these
> >
> > > geometrics objects and then have two renderers in the same render
> > > window
> >
> > (
> >
> > > the vtkImageViewer2 one ). My question is how do I have two different
> > > layers ( the renderers ) for the same render window in vtkImageViewer2
> >
> > to
> >
> > > do this.
> > >
> > > Maybe having two renderers is not the best solution, so if there's any
> > > better solution, what's the best approach to do this?
> > >
> > > Thanks in advance
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list