Skip to content

Commit 6bdda03

Browse files
committed
QwtPlotCurve.Fitted option was removed (won't implement curve fitting)
1 parent 30853bb commit 6bdda03

File tree

4 files changed

+17
-229
lines changed

4 files changed

+17
-229
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,17 @@ performance issues). As a consequence, when zooming in a plot curve, the
5757
entire curve is still painted (in other words, when working with large
5858
amount of data, there is no performance gain when zooming in).
5959

60+
The curve fitter feature is not implemented because powerful curve fitting
61+
features are already implemented in `guiqwt`.
62+
6063
Other API compatibility issues with `Qwt`:
61-
- `QwtPlot.MinimizeMemory` option was removed as this option has no sense
62-
in python-qwt (the polyline plotting is not taking more memory than the
63-
array data that is already there).
64+
65+
- `QwtPlot.MinimizeMemory` option was removed as this option has no sense
66+
in python-qwt (the polyline plotting is not taking more memory than the
67+
array data that is already there).
68+
69+
- `QwtPlotCurve.Fitted` option was removed as this option is not supported
70+
at the moment.
6471

6572
## Dependencies
6673

doc/overview.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ performance issues). As a consequence, when zooming in a plot curve, the
3131
entire curve is still painted (in other words, when working with large
3232
amount of data, there is no performance gain when zooming in).
3333

34+
The curve fitter feature is not implemented because powerful curve fitting
35+
features are already implemented in `guiqwt`.
36+
3437
Other API compatibility issues with `Qwt`:
3538

3639
- `QwtPlot.MinimizeMemory` option was removed as this option has no sense
3740
in python-qwt (the polyline plotting is not taking more memory than the
3841
array data that is already there).
42+
43+
- `QwtPlotCurve.Fitted` option was removed as this option is not supported
44+
at the moment.

qwt/curve_fitter.py

Lines changed: 0 additions & 208 deletions
This file was deleted.

qwt/plot_curve.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
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
98
from qwt.text import QwtText
109
from qwt.plot import QwtPlotItem, QwtPlotItem_PrivateData
1110
from 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

6866
class 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

Comments
 (0)