Test if the mapper sets the Alpha of the LUT.
(self)
| 40 | |
| 41 | class TestMapperLUT(Testing.vtkTest): |
| 42 | def testMapScalars(self): |
| 43 | """Test if the mapper sets the Alpha of the LUT.""" |
| 44 | # Create dummy data. |
| 45 | p = vtkPolyData() |
| 46 | pts = vtkPoints() |
| 47 | pts.InsertNextPoint((0,0,0)) |
| 48 | sc = vtkFloatArray() |
| 49 | sc.InsertNextValue(10.0) |
| 50 | p.SetPoints(pts) |
| 51 | p.GetPointData().SetScalars(sc) |
| 52 | l = vtkLookupTable() |
| 53 | m = vtkPolyDataMapper() |
| 54 | m.SetInputData(p) |
| 55 | m.SetScalarRange(0.0, 10.0) |
| 56 | m.SetLookupTable(l) |
| 57 | ret = m.MapScalars(0.5) |
| 58 | self.assertEqual(l.GetAlpha(), 1.0) |
| 59 | |
| 60 | def testAboveAndBelowRange(self): |
| 61 | """Test if the mapper handles values above and below the scalar range correctly.""" |
nothing calls this directly
no test coverage detected