// class Scale : public QDockWidget
// QComboBox::m_cbScale;
// QComboBox::m_cbAzimuth;
// QComboBox::m_cbDistance;
// QwtPolarPlot::m_screen
const double MAX_DISPLAY_FACTOR = 0.99; // for squared displaying
void Scale::changedScale()
{
// Azimuth scale
m_screen->setScale(QwtPolar::Azimuth, 360, 0, m_cbAzimuth->currentText().toDouble());
// Distance scale
m_screen->setScale(QwtPolar::Radius, 0, 600.0, m_cbDistance->currentText().toDouble());
m_screen->setScaleMaxMajor(QwtPolar::Radius, 600.0 / m_cbDistance->currentText().toDouble());
// Zoom scale
if(qFuzzyCompare(m_cbScale->currentText().toDouble(), 600.0)) {
m_screen->zoom(QwtPointPolar(0, 0), MAX_DISPLAY_FACTOR);
} else {
m_screen->zoom(QwtPointPolar(0, 0), m_cbScale->currentText().toDouble() / 600.0);
}
m_screen->replot();
}
// class Scale : public QDockWidget
// QComboBox::m_cbScale;
// QComboBox::m_cbAzimuth;
// QComboBox::m_cbDistance;
// QwtPolarPlot::m_screen
const double MAX_DISPLAY_FACTOR = 0.99; // for squared displaying
void Scale::changedScale()
{
// Azimuth scale
m_screen->setScale(QwtPolar::Azimuth, 360, 0, m_cbAzimuth->currentText().toDouble());
// Distance scale
m_screen->setScale(QwtPolar::Radius, 0, 600.0, m_cbDistance->currentText().toDouble());
m_screen->setScaleMaxMajor(QwtPolar::Radius, 600.0 / m_cbDistance->currentText().toDouble());
// Zoom scale
if(qFuzzyCompare(m_cbScale->currentText().toDouble(), 600.0)) {
m_screen->zoom(QwtPointPolar(0, 0), MAX_DISPLAY_FACTOR);
} else {
m_screen->zoom(QwtPointPolar(0, 0), m_cbScale->currentText().toDouble() / 600.0);
}
m_screen->replot();
}
To copy to clipboard, switch view to plain text mode
Bookmarks