(self)
| 22 | class TestWipe(vtkmodules.test.Testing.vtkTest): |
| 23 | |
| 24 | def testWipe(self): |
| 25 | |
| 26 | # Image pipeline |
| 27 | |
| 28 | renWin = vtkRenderWindow() |
| 29 | |
| 30 | image1 = vtkImageCanvasSource2D() |
| 31 | image1.SetNumberOfScalarComponents(3) |
| 32 | image1.SetScalarTypeToUnsignedChar() |
| 33 | image1.SetExtent(0, 79, 0, 79, 0, 0) |
| 34 | image1.SetDrawColor(255, 255, 0) |
| 35 | image1.FillBox(0, 79, 0, 79) |
| 36 | image1.Update() |
| 37 | |
| 38 | image2 = vtkImageCanvasSource2D() |
| 39 | image2.SetNumberOfScalarComponents(3) |
| 40 | image2.SetScalarTypeToUnsignedChar() |
| 41 | image2.SetExtent(0, 79, 0, 79, 0, 0) |
| 42 | image2.SetDrawColor(0, 255, 255) |
| 43 | image2.FillBox(0, 79, 0, 79) |
| 44 | image2.Update() |
| 45 | |
| 46 | mapper = vtkImageMapper() |
| 47 | mapper.SetInputConnection(image1.GetOutputPort()) |
| 48 | mapper.SetColorWindow(255) |
| 49 | mapper.SetColorLevel(127.5) |
| 50 | actor = vtkActor2D() |
| 51 | actor.SetMapper(mapper) |
| 52 | imager = vtkRenderer() |
| 53 | imager.AddViewProp(actor) |
| 54 | |
| 55 | renWin.AddRenderer(imager) |
| 56 | |
| 57 | wipes = ["Quad", "Horizontal", "Vertical", "LowerLeft", "LowerRight", "UpperLeft", "UpperRight"] |
| 58 | |
| 59 | wiper = dict() |
| 60 | mapper = dict() |
| 61 | actor = dict() |
| 62 | imagers = dict() |
| 63 | |
| 64 | for wipe in wipes: |
| 65 | wiper.update({wipe:vtkImageRectilinearWipe()}) |
| 66 | wiper[wipe].SetInput1Data(image1.GetOutput()) |
| 67 | wiper[wipe].SetInput2Data(image2.GetOutput()) |
| 68 | wiper[wipe].SetPosition(20, 20) |
| 69 | eval('wiper[wipe].SetWipeTo' + wipe + '()') |
| 70 | |
| 71 | mapper.update({wipe:vtkImageMapper()}) |
| 72 | mapper[wipe].SetInputConnection(wiper[wipe].GetOutputPort()) |
| 73 | mapper[wipe].SetColorWindow(255) |
| 74 | mapper[wipe].SetColorLevel(127.5) |
| 75 | |
| 76 | actor.update({wipe:vtkActor2D()}) |
| 77 | actor[wipe].SetMapper(mapper[wipe]) |
| 78 | |
| 79 | imagers.update({wipe:vtkRenderer()}) |
| 80 | imagers[wipe].AddViewProp(actor[wipe]) |
| 81 |
nothing calls this directly
no test coverage detected