[vtkusers] vtkRenderWindow

Alex Cristopher Vivas Munar a-vivas at uniandes.edu.co
Tue Mar 15 14:19:36 EST 2005


hi...

i display an image with vtkRederWindow in tcltk:

	catch {imagen Delete}
	vtkTIFFReader imagen
		imagen SetFileName $file
		imagen Update

	set rango [[[[imagen GetOutput] GetPointData] GetScalars] GetRange]
         scan $rango "%d %d" min max
         set colores [expr ($max - $min) + 1]

	catch {tabla Delete}
	vtkLookupTable tabla
		tabla SetNumberOfColors $colores
		tabla SetTableRange $min $max
		tabla SetValueRange 0 1
		tabla SetSaturationRange 0 0
		tabla SetHueRange 0 1
		tabla SetAlphaRange 1 1
		tabla Build

	catch {textura Delete}
	vtkTexture textura
		textura SetInput [imagen GetOutput]
		textura InterpolateOn
		textura SetLookupTable tabla

	catch {plano Delete}
	vtkPlaneSource plano
		plano SetOrigin -0.5 -0.5 0.0
		plano SetPoint1  0.5 -0.5 0.0
		plano SetPoint2 -0.5  0.5 0.0

	catch {mapper Delete}
	vtkPolyDataMapper mapper
		mapper SetInput [plano GetOutput]
		eval mapper SetScalarRange $rango
		mapper ImmediateModeRenderingOn

	catch {actor Delete}
	vtkActor actor
		actor SetTexture textura
		actor SetMapper mapper
		actor PickableOn

	catch {ren Delete}
	vtkRenderer ren
		ren AddActor actor
		ren SetBackground 0.8 0.8 0.8

	catch {destroy .frIma.ren}
	set vtkw [vtkTkRenderWidget .frIma.ren]
	pack $vtkw -side top -expand 1 -fill both -anchor n
	::vtk::bind_tk_render_widget $vtkw

	set renwin [$vtkw GetRenderWindow]
	$renwin AddRenderer ren
	$renwin Render

	set iren [$renwin GetInteractor]
	$iren Initialize
	$iren Start


the problem is... i can't resize the render window



More information about the vtkusers mailing list