#NEWLINE# def set_on_vtk_volume_property( self , vtk_volume_property ) : #NEWLINE# #INDENT# of = vtk . vtkPiecewiseFunction ( ) #NEWLINE# cf = vtk . vtkColorTransferFunction ( ) #NEWLINE# vp = pt #NEWLINE# for pt in self . _pts : #NEWLINE# #INDENT# ( scalar , opacity , color ) = pt #NEWLINE# s = ( self . _min_range + ( ( self . _max_range - self . _min_range ) * scalar ) ) #NEWLINE# of . AddPoint ( s , opacity ) #NEWLINE# cf . AddRGBPoint ( s , color [ 0 ] , color [ 1 ] , color [ 2 ] ) #NEWLINE# #UNINDENT# vp . SetScalarOpacity ( of ) #NEWLINE# vp . SetColor ( cf )