Originally Posted by
ifhmcos
Thanks again for your answer and help. Although I tried (still trying) to use the svn trunk version, there seems to be a problem with Qt deploying the shared library to android (I'm still trying to fix it).
I'm back with a few more dumb questions. I'm trying to shift the whole graph but I get a lot of jitter, is there a way to draw just the last piece of the image while shifting the image an amount of pixels instead of redrawing from qwt? Like accessing the back buffer shifting it 10px, drawing the last 10px for example and presenting that? Right now I'm shifting the graph by doing this
void plotter::update_graphic() {
linear_data *ld = static_cast<linear_data *>(curves[0]->data());
int added_points = ld->added_points;
if (added_points && ld->full()) {
for (size_t i = 0; i < curves.size(); i++) {
ld = static_cast<linear_data *>(curves[i]->data());
ld->add_stride(added_points);
ld->added_points = 0;
}
grid_offset = grid_offset + added_points;
setAxisScale(xBottom, grid_offset, + grid_offset + 2000, step);
}
points_frame = 0;
}
void plotter::update_graphic() {
linear_data *ld = static_cast<linear_data *>(curves[0]->data());
int added_points = ld->added_points;
if (added_points && ld->full()) {
for (size_t i = 0; i < curves.size(); i++) {
ld = static_cast<linear_data *>(curves[i]->data());
ld->add_stride(added_points);
ld->added_points = 0;
}
grid_offset = grid_offset + added_points;
setAxisScale(xBottom, grid_offset, + grid_offset + 2000, step);
}
QwtPlot::replot();
points_frame = 0;
}
To copy to clipboard, switch view to plain text mode
https://gist.github.com/araml/cb2fc4...193c4f33f80ff4
Which basically adds an offset to both the grid and the points, and reset the axis scale with that offset.
Thanks!
Bookmarks