Qwt User's Guide 6.0.1

- Main Page
- Related Pages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions

# QwtWeedingCurveFitter Class Reference

A curve fitter implementing Douglas and Peucker algorithm. More...

`#include <qwt_curve_fitter.h>`

Inheritance diagram for QwtWeedingCurveFitter:
[legend]

List of all members.

## Public Member Functions
virtual QPolygonF | fitCurve (const QPolygonF &) const
| QwtWeedingCurveFitter (double tolerance=1.0)
void | setTolerance (double)
double | tolerance () const
virtual | ~QwtWeedingCurveFitter ()

## Detailed Description

A curve fitter implementing Douglas and Peucker algorithm.

The purpose of the Douglas and Peucker algorithm is that given a 'curve' composed of line segments to find a curve not too dissimilar but that has fewer points. The algorithm defines 'too dissimilar' based on the maximum distance (tolerance) between the original curve and the smoothed curve.

The smoothed curve consists of a subset of the points that defined the original curve.

In opposite to QwtSplineCurveFitter the Douglas and Peucker algorithm reduces the number of points. By adjusting the tolerance parameter according to the axis scales QwtSplineCurveFitter can be used to implement different level of details to speed up painting of curves of many points.

## Constructor & Destructor Documentation

QwtWeedingCurveFitter::QwtWeedingCurveFitter | ( | double | tolerance = `1.0` | ) |

Constructor

Parameters:

  tolerance | Tolerance

See also:
  setTolerance(), tolerance()

QwtWeedingCurveFitter::~QwtWeedingCurveFitter | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

QPolygonF QwtWeedingCurveFitter::fitCurve | ( | const QPolygonF & | points | ) | const`[virtual]`

Parameters:

  points | Series of data points

Returns:
  Curve points

Implements QwtCurveFitter.

void QwtWeedingCurveFitter::setTolerance | ( | double | tolerance | ) |

Assign the tolerance

The tolerance is the maximum distance, that is accaptable between the original curve and the smoothed curve.

Increasing the tolerance will reduce the number of the resulting points.

Parameters:

  tolerance | Tolerance

See also:
  tolerance()

double QwtWeedingCurveFitter::tolerance | ( |  | ) | const

Returns:
  Tolerance

See also:
  setTolerance()