File: coneResolution.tcl

package info (click to toggle)
vtk 5.8.0-13
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 130,524 kB
  • sloc: cpp: 1,129,256; ansic: 708,203; tcl: 48,526; python: 20,875; xml: 6,779; yacc: 4,208; perl: 3,121; java: 2,788; lex: 931; sh: 660; asm: 471; makefile: 299
file content (69 lines) | stat: -rw-r--r-- 1,803 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
package require vtk
package require vtkinteraction

# create a rendering window and renderer
vtkRenderer ren1
vtkRenderWindow renWin
    renWin AddRenderer ren1
vtkRenderWindowInteractor iren
    iren SetRenderWindow renWin

# create cones of varying resolution
vtkConeSource cone0
  cone0 SetResolution 0
vtkConeSource cone1
  cone1 SetResolution 1
vtkConeSource cone2
  cone2 SetResolution 2
vtkConeSource cone8
  cone8 SetResolution 8

vtkPolyDataMapper cone0Mapper
  cone0Mapper SetInputConnection [cone0 GetOutputPort]
vtkActor cone0Actor
  cone0Actor SetMapper cone0Mapper

vtkPolyDataMapper cone1Mapper
  cone1Mapper SetInputConnection [cone1 GetOutputPort]
vtkActor cone1Actor
  cone1Actor SetMapper cone1Mapper

vtkPolyDataMapper cone2Mapper
  cone2Mapper SetInputConnection [cone2 GetOutputPort]
vtkActor cone2Actor
  cone2Actor SetMapper cone2Mapper

vtkPolyDataMapper cone8Mapper
  cone8Mapper SetInputConnection [cone8 GetOutputPort]
vtkActor cone8Actor
  cone8Actor SetMapper cone8Mapper

# assign our actor to the renderer
ren1 AddActor cone0Actor
ren1 AddActor cone1Actor
ren1 AddActor cone2Actor
ren1 AddActor cone8Actor
ren1 SetBackground .5 .5 .5
ren1 ResetCamera
[ren1 GetActiveCamera] Elevation 30
[ren1 GetActiveCamera] Dolly 1.3
ren1 ResetCameraClippingRange

renWin SetSize 301 91
cone0Actor SetPosition -1.5 0 0
cone1Actor SetPosition -.5 0 0
cone2Actor SetPosition .5 0 0
cone8Actor SetPosition 1.5 0 0

[cone0Actor GetProperty] SetDiffuseColor 1 0 0
[cone1Actor GetProperty] SetDiffuseColor 0 1 0
[cone8Actor GetProperty] BackfaceCullingOn
[cone8Actor GetProperty] SetDiffuseColor 0 0 1

# enable user interface interactor
iren AddObserver UserEvent {wm deiconify .vtkInteract}
iren Initialize

# prevent the tk window from showing up then start the event loop
wm withdraw .