File: subdividePointData.tcl

package info (click to toggle)
vtk7 7.1.1%2Bdfsg2-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 127,396 kB
  • sloc: cpp: 1,539,584; ansic: 124,382; python: 78,038; tcl: 47,013; xml: 8,142; yacc: 5,040; java: 4,439; perl: 3,132; lex: 1,926; sh: 1,500; makefile: 126; objc: 83
file content (111 lines) | stat: -rw-r--r-- 2,394 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package require vtk
package require vtkinteraction

#
# Test butterfly subdivision of point data
#
vtkSphereSource sphere
    sphere SetPhiResolution 11
    sphere SetThetaResolution 11

vtkElevationFilter colorIt
  colorIt SetInputConnection [sphere GetOutputPort]
  colorIt SetLowPoint 0 0 -.5
  colorIt SetHighPoint 0 0 .5

vtkButterflySubdivisionFilter butterfly
  butterfly SetInputConnection [colorIt GetOutputPort]
  butterfly SetNumberOfSubdivisions 3

vtkLookupTable lut
  lut SetNumberOfColors 256
  lut Build

vtkPolyDataMapper mapper
  mapper SetInputConnection [butterfly GetOutputPort]
  mapper SetLookupTable lut

vtkActor actor
  actor SetMapper mapper

vtkLinearSubdivisionFilter linear
  linear SetInputConnection [colorIt GetOutputPort]
  linear SetNumberOfSubdivisions 3

vtkPolyDataMapper mapper2
  mapper2 SetInputConnection [linear GetOutputPort]
  mapper2 SetLookupTable lut

vtkActor actor2
  actor2 SetMapper mapper2

vtkPolyDataMapper mapper3
  mapper3 SetInputConnection [colorIt GetOutputPort]
  mapper3 SetLookupTable lut

vtkActor actor3
  actor3 SetMapper mapper3

vtkRenderer ren1
vtkRenderer ren2
vtkRenderer ren3

vtkRenderWindow renWin
    renWin AddRenderer ren1
    renWin AddRenderer ren2
    renWin AddRenderer ren3

vtkRenderWindowInteractor iren
    iren SetRenderWindow renWin

ren1 AddActor actor
ren1 SetBackground 1 1 1

ren2 AddActor actor2
ren2 SetBackground 1 1 1

ren3 AddActor actor3
ren3 SetBackground 1 1 1

renWin SetSize 600 200
vtkCamera aCamera
  aCamera Azimuth 70
vtkLight aLight
eval aLight SetPosition [aCamera GetPosition]
eval aLight SetFocalPoint [aCamera GetFocalPoint]

ren1 SetActiveCamera aCamera
ren1 AddLight aLight
ren1 ResetCamera
aCamera Dolly 1.4
ren1 ResetCameraClippingRange

ren2 SetActiveCamera aCamera
ren2 AddLight aLight

ren3 SetActiveCamera aCamera
ren3 AddLight aLight

ren3 SetViewport 0 0 .33 1
ren2 SetViewport .33 0 .67 1
ren1 SetViewport .67 0 1 1

iren AddObserver UserEvent {wm deiconify .vtkInteract}
iren Initialize

proc flat {} {
    [actor GetProperty] SetInterpolationToFlat
    [actor2 GetProperty] SetInterpolationToFlat
    [actor3 GetProperty] SetInterpolationToFlat
    renWin Render
}

proc smooth {} {
    [actor GetProperty] SetInterpolationToGouraud
    [actor2 GetProperty] SetInterpolationToGouraud
    [actor3 GetProperty] SetInterpolationToGouraud
    renWin Render
}


wm withdraw .