MCPcopy Create free account
hub / github.com/Kitware/VTK / testSync3dAll

Method testSync3dAll

Filters/Modeling/Testing/Python/sync3dAll.py:60–146  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

58 return rgba
59
60 def testSync3dAll(self):
61
62 # Create the RenderWindow, Renderer and both Actors
63 #
64 ren = vtkRenderer()
65 renWin = vtkRenderWindow()
66 renWin.AddRenderer(ren)
67
68 # create pipeline
69 #
70 slc = vtkStructuredPointsReader()
71 slc.SetFileName(VTK_DATA_ROOT + "/Data/ironProt.vtk")
72
73 colors = ["flesh", "banana", "grey", "pink", "carrot", "gainsboro", "tomato", "gold", "thistle", "chocolate"]
74
75 types = ["UnsignedChar", "Char", "Short", "UnsignedShort", "Int", "UnsignedInt", "Long", "UnsignedLong", "Float", "Double"]
76
77 i = 1
78 c = 0
79 clip = list()
80 cast = list()
81 iso = list()
82 mapper = list()
83 actor = list()
84
85 colorWrapper = self.Colors()
86
87 for idx, vtkType in enumerate(types):
88 clip.append(vtkImageClip())
89 clip[idx].SetInputConnection(slc.GetOutputPort())
90 clip[idx].SetOutputWholeExtent(-1000, 1000, -1000, 1000, i, i + 5)
91 i += 5
92 cast.append(vtkImageCast())
93 eval('cast[idx].SetOutputScalarTypeTo' + vtkType + '()')
94 cast[idx].SetInputConnection(clip[idx].GetOutputPort())
95 cast[idx].ClampOverflowOn()
96
97 iso.append(vtkSynchronizedTemplates3D())
98 iso[idx].SetInputConnection(cast[idx].GetOutputPort())
99 iso[idx].GenerateValues(1, 30, 30)
100
101 mapper.append(vtkPolyDataMapper())
102 mapper[idx].SetInputConnection(iso[idx].GetOutputPort())
103 mapper[idx].ScalarVisibilityOff()
104
105 actor.append(vtkActor())
106 actor[idx].SetMapper(mapper[idx])
107 # actor[idx].Actor.GetProperty().SetDiffuseColor(lindex.colors.c.lindex.colors.c+1.lindex.colors.c+1)
108 actor[idx].GetProperty().SetDiffuseColor(colorWrapper.GetRGBColor(colors[c]))
109 actor[idx].GetProperty().SetSpecularPower(30)
110 actor[idx].GetProperty().SetDiffuse(.7)
111 actor[idx].GetProperty().SetSpecular(.5)
112 c += 1
113 ren.AddActor(actor[idx])
114
115
116 outline = vtkOutlineFilter()
117 outline.SetInputConnection(slc.GetOutputPort())

Callers

nothing calls this directly

Calls 15

GetRGBColorMethod · 0.95
enumerateFunction · 0.85
vtkImageCastClass · 0.85
SetDiffuseColorMethod · 0.80
SetSpecularPowerMethod · 0.80
SetViewAngleMethod · 0.80
GetActiveCameraMethod · 0.80
interactMethod · 0.80
RenderMethod · 0.65
vtkRendererClass · 0.50
vtkRenderWindowClass · 0.50
listClass · 0.50

Tested by

no test coverage detected