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

Method testMapScalars

Rendering/Core/Testing/Python/TestMapperLUT.py:42–58  ·  view source on GitHub ↗

Test if the mapper sets the Alpha of the LUT.

(self)

Source from the content-addressed store, hash-verified

40
41class 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."""

Callers

nothing calls this directly

Calls 15

SetScalarsMethod · 0.80
GetAlphaMethod · 0.80
vtkPolyDataClass · 0.50
vtkPointsClass · 0.50
vtkFloatArrayClass · 0.50
vtkLookupTableClass · 0.50
vtkPolyDataMapperClass · 0.50
InsertNextPointMethod · 0.45
InsertNextValueMethod · 0.45
SetPointsMethod · 0.45
GetPointDataMethod · 0.45
SetInputDataMethod · 0.45

Tested by

no test coverage detected