TestStyleRubberBandZoom.tcl 1.15 KB
Newer Older
1 2
package require vtk

3
# Set up the pipeline
4

5 6
vtkTIFFReader reader
reader SetFileName "$VTK_DATA_ROOT/Data/beach.tif"
7

8 9 10
# "beach.tif" image contains ORIENTATION tag which is
# ORIENTATION_TOPLEFT (row 0 top, col 0 lhs) type. The TIFF
# reader parses this tag and sets the internal TIFF image
11 12 13 14 15
# orientation accordingly.  To overwrite this orientation with a vtk
# convention of ORIENTATION_BOTLEFT (row 0 bottom, col 0 lhs ), invoke
# SetOrientationType method with parameter value of 4.
reader SetOrientationType 4

16
vtkImageActor ia
17
[ia GetMapper] SetInputConnection [reader GetOutputPort]
18

19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
vtkRenderer ren
ren AddActor ia

vtkRenderWindow renWin
renWin AddRenderer ren
renWin SetSize 400 400

vtkRenderWindowInteractor iren
iren SetRenderWindow renWin

vtkInteractorStyleRubberBandZoom rbz
rbz SetInteractor iren

iren SetInteractorStyle rbz

renWin Render
Ken Martin's avatar
Ken Martin committed
35
[ren GetActiveCamera] SetClippingRange 538.2413295991446 551.8332823667997
36 37 38

# Test style

39
iren SetEventInformationFlipY 250 250 0 0 "0" 0 "0"
40
iren InvokeEvent "LeftButtonPressEvent"
41
iren SetEventInformationFlipY 100 100 0 0 "0" 0 "0"
42 43
iren InvokeEvent "MouseMoveEvent"
iren InvokeEvent "LeftButtonReleaseEvent"
44 45

wm withdraw .