File: TestWipe.tcl

package info (click to toggle)
paraview 4.0.1-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 526,572 kB
  • sloc: cpp: 2,284,430; ansic: 816,374; python: 239,936; xml: 70,162; tcl: 48,295; fortran: 39,116; yacc: 5,466; java: 3,518; perl: 3,107; lex: 1,620; sh: 1,555; makefile: 932; asm: 471; pascal: 228
file content (68 lines) | stat: -rw-r--r-- 1,813 bytes parent folder | download | duplicates (12)
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
67
68
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
  image1 Update

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
  image2 Update

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} SetInput1Data [image1 GetOutput]
      wiper${wipe} SetInput2Data [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 .