fix 3d plot performance issues

Scrolling up and down the ride files is painfully slow when
3d is compiled in. This patch uses a setActive mechanism in
the same fashion as the pfpv and performance manager tabs.

Additionally, a recent patch to support user preferences for
units added a settings lookup that was called for every point.
This is also fixed.

fixes #16
This commit is contained in:
Mark Liversedge
2010-01-13 18:58:21 +00:00
committed by Sean Rhea
parent 195937f186
commit 4d1783276c
4 changed files with 29 additions and 19 deletions

View File

@@ -46,7 +46,7 @@ ModelWindow::addStandardChannels(QComboBox *box)
//box->addItem(tr("Longitude"), MODEL_LONG); //XXX weird values make the plot ugly
}
ModelWindow::ModelWindow(MainWindow *parent, const QDir &home) : QWidget(parent), home(home), main(parent)
ModelWindow::ModelWindow(MainWindow *parent, const QDir &home) : QWidget(parent), home(home), main(parent), active(false)
{
// Layouts
QVBoxLayout *mainLayout = new QVBoxLayout;
@@ -182,11 +182,17 @@ ModelWindow::ModelWindow(MainWindow *parent, const QDir &home) : QWidget(parent)
connect(zpane, SIGNAL(valueChanged(int)), this, SLOT(setZPane(int)));
}
void
ModelWindow::setActive(bool active)
{
this->active = active;
if (active) setData(true);
}
void
ModelWindow::rideSelected()
{
ride = main->rideItem();
setData(true);
if (active) setData(true);
}
void