File: TestWipe.tcl

package info (click to toggle)
vtk 5.0.2-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 51,080 kB
  • ctags: 67,442
  • sloc: cpp: 522,627; ansic: 221,292; tcl: 43,377; python: 14,072; perl: 3,102; java: 1,436; yacc: 1,033; sh: 469; lex: 248; makefile: 181; asm: 154
file content (66 lines) | stat: -rw-r--r-- 1,777 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package require vtk
package require vtkinteraction

# Image pipeline

vtkRenderWindow imgWin

vtkImageCanvasSource2D image1
  image1 SetNumberOfScalarComponents 3
  image1 SetScalarTypeToUnsignedChar
  image1 SetExtent 0 79 0 79 0 0
  image1 SetDrawColor 255 255 0
  image1 FillBox 0 79 0 79

vtkImageCanvasSource2D image2
  image2 SetNumberOfScalarComponents 3
  image2 SetScalarTypeToUnsignedChar
  image2 SetExtent 0 79 0 79 0 0
  image2 SetDrawColor 0 255 255
  image2 FillBox 0 79 0 79

vtkImageMapper mapper
  mapper SetInputConnection [image1 GetOutputPort]
  mapper SetColorWindow 255
  mapper SetColorLevel 127.5
vtkActor2D actor
  actor SetMapper mapper
vtkRenderer imager
  imager AddActor2D actor

imgWin AddRenderer imager

set wipes "Quad Horizontal Vertical LowerLeft LowerRight UpperLeft UpperRight"

foreach wipe $wipes {

    vtkImageRectilinearWipe wiper${wipe}
      wiper${wipe} SetInput 0 [image1 GetOutput]
      wiper${wipe} SetInput 1 [image2 GetOutput]
      wiper${wipe} SetPosition 20 20
      wiper${wipe} SetWipeTo${wipe}
  
    vtkImageMapper mapper${wipe}
      mapper${wipe} SetInputConnection [wiper${wipe} GetOutputPort]
      mapper${wipe} SetColorWindow 255
      mapper${wipe} SetColorLevel 127.5
    vtkActor2D actor${wipe}
      actor${wipe} SetMapper mapper${wipe}
    vtkRenderer imager${wipe}
      imager${wipe} AddActor2D actor${wipe}

    imgWin AddRenderer imager${wipe}
}
imagerQuad SetViewport 0 .5 .25 1
imagerHorizontal SetViewport .25 .5 .5 1
imagerVertical SetViewport .5 .5 .75 1
imagerLowerLeft SetViewport .75 .5 1 1
imagerLowerRight SetViewport 0 0 .25 .5
imagerUpperLeft SetViewport .25 0 .5 .5
imagerUpperRight SetViewport .5 0 .75 .5
imager SetViewport .75 0 1 .5

imgWin SetSize 400 200
imgWin Render

wm withdraw .