finding collection of points index on a curve
Hi,
I need to find index of all points that are into the area of a selected area by a picker. I could find index of an only one point index by this code:
Code:
connect( picker,
SIGNAL( selected
( const QPolygon & ),
SLOT(UpdVizir
( const QPolygon & )));
Code:
void TrendTop
::UpdVizir( const QPolygon &points
) {
if ( points.size() != 1 )
return;
double dist;
int index = curv1->closestPoint( points[0], &dist );
}
How all points into a selected area can be obtained?
Re: finding collection of points index on a curve
If you don't have an extra spatial index for our points you have to iterate over the points and use QRectF::contains().
In case your points are ordered in x or y direction you could use qwtUpperSampleIndex() to speed up the operation.
Uwe
Re: finding collection of points index on a curve
Quote:
Originally Posted by
Uwe
If you don't have an extra spatial index for our points you have to iterate over the points and use QRectF::contains().
In case your points are ordered in x or y direction you could use qwtUpperSampleIndex() to speed up the operation.
Uwe
Thanks for answering, but I dont want to input any X or Y. I want Only to select an area and then the output be index of points into the area. please help me in this way
Re: finding collection of points index on a curve
Quote:
Originally Posted by
Alex22
I want Only to select an area and then the output be index of points into the area. please help me in this way
How is your clarification contrary to the given answer ?
Uwe
Re: finding collection of points index on a curve
Uwe,
I can find nothing about "qwtUpperSampleIndex() " in the Doc. I am using multiaxes version.
My purpose is removing some points (that are noise in my signal), by selecting an area that includes these noise points. And after selecting the area by a picker, i need to replot() and after reploting, these points (noise points) be removed.
Re: finding collection of points index on a curve
Quote:
I can find nothing about "qwtUpperSampleIndex() " in the Doc. I am using multiaxes version.
It can be found in qwt_series_data.h.
Quote:
My purpose is removing some points (that are noise in my signal), by selecting an area that includes these noise points.
Still don't get what additional answer you are waiting for. By iterating ( or using an spatial index ) you can identify all points inside the selected area and build a new buffer without them.
If you don't want to create a second buffer and simply want to exclude points from being plotted you can implement your own type of QwtSeriesData bridge.
Uwe