Skip to content
Snippets Groups Projects
Commit 7cb443ef authored by Scott Wittenburg's avatar Scott Wittenburg
Browse files

Ensure GetRange() gets wrapped for vtkColorTransferFunction

parent 63977b90
No related branches found
No related tags found
No related merge requests found
......@@ -81,4 +81,7 @@ vtk_add_test_python(
vtk_add_test_python(
NO_DATA NO_VALID NO_OUTPUT
pickCellPoints.py
TestGetRangeColorTransferFunction.py
TestGetRangeDiscretizableColorTransferFunction.py
TestGetRangeLookupTable.py
)
#!/usr/bin/env python
import vtk
from vtk.test import Testing
class TestGetRangeColorTransferFunction(Testing.vtkTest):
def testGetRangeDoubleStarArg(self):
cmap = vtk.vtkColorTransferFunction()
localRange = [-1, -1]
cmap.GetRange(localRange)
self.assertEqual(localRange[0], 0.0)
self.assertEqual(localRange[1], 0.0)
def testGetRangeTwoDoubleStarArg(self):
cmap = vtk.vtkColorTransferFunction()
localMin = vtk.mutable(-1)
localMax = vtk.mutable(-1)
cmap.GetRange(localMin, localMax)
self.assertEqual(localMin, 0.0)
self.assertEqual(localMax, 0.0)
def testGetRangeNoArg(self):
cmap = vtk.vtkColorTransferFunction()
crange = cmap.GetRange()
self.assertEqual(len(crange), 2)
self.assertEqual(crange[0], 0.0)
self.assertEqual(crange[1], 0.0)
if __name__ == "__main__":
Testing.main([(TestGetRangeColorTransferFunction, 'test')])
#!/usr/bin/env python
import vtk
from vtk.test import Testing
class TestGetRangeDiscretizableColorTransferFunction(Testing.vtkTest):
def testGetRangeDoubleStarArg(self):
cmap = vtk.vtkDiscretizableColorTransferFunction()
localRange = [-1, -1]
cmap.GetRange(localRange)
self.assertEqual(localRange[0], 0.0)
self.assertEqual(localRange[1], 0.0)
def testGetRangeTwoDoubleStarArg(self):
cmap = vtk.vtkDiscretizableColorTransferFunction()
localMin = vtk.mutable(-1)
localMax = vtk.mutable(-1)
cmap.GetRange(localMin, localMax)
self.assertEqual(localMin, 0.0)
self.assertEqual(localMax, 0.0)
def testGetRangeNoArg(self):
cmap = vtk.vtkDiscretizableColorTransferFunction()
crange = cmap.GetRange()
self.assertEqual(len(crange), 2)
self.assertEqual(crange[0], 0.0)
self.assertEqual(crange[1], 0.0)
if __name__ == "__main__":
Testing.main([(TestGetRangeDiscretizableColorTransferFunction, 'test')])
#!/usr/bin/env python
import vtk
from vtk.test import Testing
class TestGetRangeLookupTable(Testing.vtkTest):
###
# GetRange test
###
def testGetRangeNoArg(self):
cmap = vtk.vtkLookupTable()
cmap.SetRange(0.0, 1.0)
crange = cmap.GetRange()
self.assertEqual(len(crange), 2)
self.assertEqual(crange[0], 0.0)
self.assertEqual(crange[1], 1.0)
###
# GetHueRange test
###
def testGetHueRangeNoArg(self):
cmap = vtk.vtkLookupTable()
cmap.SetHueRange(0.0, 1.0)
crange = cmap.GetHueRange()
self.assertEqual(len(crange), 2)
self.assertEqual(crange[0], 0.0)
self.assertEqual(crange[1], 1.0)
###
# GetSaturationRange test
###
def testGetSaturationRangeNoArg(self):
cmap = vtk.vtkLookupTable()
cmap.SetSaturationRange(0.0, 1.0)
crange = cmap.GetSaturationRange()
self.assertEqual(len(crange), 2)
self.assertEqual(crange[0], 0.0)
self.assertEqual(crange[1], 1.0)
###
# GetAlphaRange test
###
def testGetAlphaRangeNoArg(self):
cmap = vtk.vtkLookupTable()
cmap.SetAlphaRange(0.0, 1.0)
crange = cmap.GetAlphaRange()
self.assertEqual(len(crange), 2)
self.assertEqual(crange[0], 0.0)
self.assertEqual(crange[1], 1.0)
if __name__ == "__main__":
Testing.main([(TestGetRangeLookupTable, 'test')])
......@@ -29,6 +29,7 @@ vtkCocoaRenderWindow GetPosition 304 2
vtkCocoaRenderWindow GetScreenSize 304 2
vtkCocoaRenderWindow GetSize 304 2
vtkColorTransferFunction GetColor 307 3
vtkColorTransferFunction GetRange 307 2
vtkCompositePolyDataMapper2 GetBounds 307 6
vtkCompositePolyDataMapper GetBounds 307 6
vtkCoordinate GetComputedDisplayValue 304 2
......@@ -159,6 +160,9 @@ vtkLongArray GetValueRange 306 2
vtkLongLongArray GetValueRange 30B 2
vtkLookupTable GetColor 307 3
vtkLookupTable GetRange 307 2
vtkLookupTable GetAlphaRange 307 2
vtkLookupTable GetHueRange 307 2
vtkLookupTable GetSaturationRange 307 2
vtkLookupTable GetTableValue 307 4
vtkMapper GetBounds 307 6
vtkMath HSVToRGB 307 3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment