55# Copyright (c) 2015 Pierre Raybaut, for the Python translation/optimization
66# (see LICENSE file for more details)
77
8- from qwt .curve_fitter import QwtSplineCurveFitter
98from qwt .text import QwtText
109from qwt .plot import QwtPlotItem , QwtPlotItem_PrivateData
1110from qwt .painter import QwtPainter
@@ -62,7 +61,6 @@ def __init__(self):
6261 self .legendAttributes = QwtPlotCurve .LegendShowLine
6362 self .pen = QPen (Qt .black )
6463 self .brush = QBrush ()
65- self .curveFitter = QwtSplineCurveFitter ()
6664
6765
6866class QwtPlotCurve (QwtPlotSeriesItem , QwtSeriesStore ):
@@ -74,7 +72,6 @@ class QwtPlotCurve(QwtPlotSeriesItem, QwtSeriesStore):
7472
7573 # enum CurveAttribute
7674 Inverted = 0x01
77- Fitted = 0x02
7875
7976 # enum LegendAttribute
8077 LegendNoAttribute = 0x00
@@ -213,9 +210,6 @@ def drawSeries(self, painter, xMap, yMap, canvasRect, from_, to):
213210
214211 def drawCurve (self , painter , style , xMap , yMap , canvasRect , from_ , to ):
215212 if style == self .Lines :
216- if self .testCurveAttribute (self .Fitted ):
217- from_ = 0
218- to = self .dataSize ()- 1
219213 self .drawLines (painter , xMap , yMap , canvasRect , from_ , to )
220214 elif style == self .Sticks :
221215 self .drawSticks (painter , xMap , yMap , canvasRect , from_ , to )
@@ -228,8 +222,6 @@ def drawLines(self, painter, xMap, yMap, canvasRect, from_, to):
228222 if from_ > to :
229223 return
230224 doAlign = QwtPainter .roundingAlignment (painter )
231- doFit = (self .__data .attributes & self .Fitted )\
232- and self .__data .curveFitter
233225 doFill = self .__data .brush .style () != Qt .NoBrush \
234226 and self .__data .brush .color ().alpha () > 0
235227 clipRect = QRectF ()
@@ -239,7 +231,7 @@ def drawLines(self, painter, xMap, yMap, canvasRect, from_, to):
239231 doIntegers = False
240232 if QT_VERSION < 0x040800 :
241233 if painter .paintEngine ().type () == QPaintEngine .Raster :
242- if not doFit and not doFill :
234+ if not doFill :
243235 doIntegers = True
244236 noDuplicates = self .__data .paintAttributes & self .FilterPoints
245237 mapper = QwtPointMapper ()
@@ -254,8 +246,6 @@ def drawLines(self, painter, xMap, yMap, canvasRect, from_, to):
254246 QwtPainter .drawPolyline (painter , polyline )
255247 else :
256248 polyline = mapper .toPolygonF (xMap , yMap , self .data (), from_ , to )
257- if doFit :
258- polyline = self .__data .curveFitter .fitCurve (polyline )
259249 if doFill :
260250 if painter .pen ().style () != Qt .NoPen :
261251 filled = QPolygonF (polyline )
@@ -373,13 +363,6 @@ def setCurveAttribute(self, attribute, on=True):
373363 def testCurveAttribute (self , attribute ):
374364 return self .__data .attributes & attribute
375365
376- def setCurveFitter (self , curveFitter ):
377- self .__data .curveFitter = curveFitter
378- self .itemChanged ()
379-
380- def curveFitter (self ):
381- return self .__data .curveFitter
382-
383366 def fillCurve (self , painter , xMap , yMap , canvasRect , polygon ):
384367 if self .__data .brush .style () == Qt .NoBrush :
385368 return
0 commit comments