Hello,
I derived my own fitter class from QwtCurveFitter and implemented the abstract method fitCurve. When I debugged the program, I noticed that the points that are passed to that method are in screen coordinates. The problem is now, that I want to implement a proportional fit to my data and I need to add the point (0.0, 0.0) to the result data. However, that point is of course not in screen coordinates, but in coordinates of my data points. Since I have no access to the curve or the plot in my derived class, I wondered if there is any way to translate the origin point to screen coordinates in the method MyCurveFitterClass:fitCurve.
(A bad way would be to translate the coordinates before the fitter is appended to the curve and pass it to the instance of my class... I'd rather avoid that.)
Some code:
{
// Do some calculation...
// Add some calculated points.
return result;
}
QPolygonF MyCurveFitterClass::fitCurve(const QPolygonF &polygon) const
{
// Do some calculation...
QPolygonF result;
// Add some calculated points.
result.append(QPointF(0.0, 0.0));
return result;
}
To copy to clipboard, switch view to plain text mode
Bookmarks