#NEWLINE# def __init__( self , tf , parent = None ) : #NEWLINE# #INDENT# QtGui . QGraphicsScene . __init__ ( self , parent ) #NEWLINE# self . _tf_items = [ ] #NEWLINE# poly = TransferFunctionPolygon ( ) #NEWLINE# poly . setup ( ) #NEWLINE# self . _tf_poly = poly #NEWLINE# self . addItem ( poly ) #NEWLINE# self . create_tf_items ( tf ) #NEWLINE# self . _sx = 1.0 #NEWLINE# self . _sy = 1.0 #NEWLINE# line_color = QtGui . QColor ( 200 , 200 , 200 ) #NEWLINE# pen = QtGui . QPen ( line_color ) #NEWLINE# ps = [ QtCore . QPointF ( 0.0 , 0.0 ) , QtCore . QPointF ( 1.0 , 0.0 ) , QtCore . QPointF ( 1.0 , 1.0 ) , QtCore . QPointF ( 0.0 , 1.0 ) ] #NEWLINE# outline = QtGui . QPolygonF ( ps ) #NEWLINE# self . addPolygon ( outline , pen ) #NEWLINE# for i in xrange ( 51 ) : #NEWLINE# #INDENT# u = ( float ( i ) / 50.0 ) #NEWLINE# self . addLine ( QtCore . QLineF ( u , 0.0 , u , 1.0 ) , pen ) #NEWLINE# self . addLine ( QtCore . QLineF ( 0.0 , u , 1.0 , u ) , pen )