def __paintSplines( self, painter ) :

		# update the evaluation of our splines if necessary
		numPoints = 50
		if not self.__splinesToDraw :
			self.__splinesToDraw = []
			interval = self.__spline.interval()
			if isinstance( self.__spline, IECore.Splineff ) :
				spline = IECore.Struct()
				spline.color = IECore.Color3f( 1 )
				spline.path = QtGui.QPainterPath()
				for i in range( 0, numPoints ) :
					t = float( i ) / ( numPoints - 1 )
					tt = interval[0] + (interval[1] - interval[0]) * t
					c = self.__spline( tt )
					if i==0 :
						spline.path.moveTo( t, c )
					else :
						spline.path.lineTo( t, c )
				self.__splinesToDraw.append( spline )
			else :
				for i in range( 0, self.__spline( 0 ).dimensions() ) :
					spline = IECore.Struct()
					if i==3 :
						spline.color = IECore.Color3f( 1 )
					else :
						c = IECore.Color3f( 0 )
						c[i] = 1
						spline.color = c
					spline.path = QtGui.QPainterPath()
					self.__splinesToDraw.append( spline )

				for i in range( 0, numPoints ) :
					t = float( i ) / ( numPoints - 1 )
					tt = interval[0] + (interval[1] - interval[0]) * t
					c = self.__spline( tt )
					for j in range( 0, c.dimensions() ) :
						if i == 0 :
							self.__splinesToDraw[j].path.moveTo( t, c[j] )
						else :
							self.__splinesToDraw[j].path.lineTo( t, c[j] )

			self.__splineBound = QtCore.QRectF()
			for s in self.__splinesToDraw :
				self.__splineBound = self.__splineBound.united( s.path.controlPointRect() )

		# draw the splines
		rect = self._qtWidget().contentsRect()
		transform = QtGui.QTransform()
		if self.__splineBound.width() :
			transform.translate( rect.x(), 0 )
			transform.scale( rect.width() / self.__splineBound.width(), 1 )
		if self.__splineBound.height() :
			transform.translate( 0, rect.y() + rect.height() )
			transform.scale( 1, -rect.height() / self.__splineBound.height() )

		painter.setTransform( transform )
		for s in self.__splinesToDraw :
			pen = QtGui.QPen( self._qtColor( s.color ) )
			painter.setPen( pen )
			painter.drawPath( s.path )
dataset/ETHPy150Open ImageEngine/gaffer/python/GafferUI/SplineWidget.py/SplineWidget.__paintSplines/original