#3790 Z scale label. Display in upper left corner

This commit is contained in:
Bjørn Erik Jensen
2018-12-10 13:03:53 +01:00
parent a6493042d4
commit 488798c3d8
7 changed files with 64 additions and 5 deletions

View File

@@ -115,7 +115,6 @@ RiuMainWindow* RiuMainWindow::sm_mainWindowInstance = nullptr;
//--------------------------------------------------------------------------------------------------
RiuMainWindow::RiuMainWindow()
: m_pdmRoot(nullptr),
m_mainViewer(nullptr),
m_relPermPlotPanel(nullptr),
m_pvtPlotPanel(nullptr),
m_mohrsCirclePlot(nullptr),

View File

@@ -47,7 +47,6 @@ class RiuMessagePanel;
class RiuProcessMonitor;
class RiuResultInfoPanel;
class RiuResultQwtPlot;
class RiuViewer;
class RiuRelativePermeabilityPlotPanel;
class RiuPvtPlotPanel;
class RiuMohrsCirclePlot;
@@ -176,7 +175,6 @@ private:
caf::AnimationToolBar* m_animationToolBar;
QMdiArea* m_mdiArea;
RiuViewer* m_mainViewer;
RiuResultInfoPanel* m_resultInfoPanel;
RiuProcessMonitor* m_processMonitor;
QPointer<RiuMessagePanel> m_messagePanel;

View File

@@ -146,11 +146,19 @@ RiuViewer::RiuViewer(const QGLFormat& format, QWidget* parent)
m_versionInfoLabel->setAlignment(Qt::AlignRight);
m_versionInfoLabel->setText(QString("%1 v%2").arg(RI_APPLICATION_NAME, RiaApplication::getVersionStringApp(false)));
// Z scale label
m_zScaleLabel = new QLabel();
m_zScaleLabel->setFrameShape(QFrame::NoFrame);
m_zScaleLabel->setAlignment(Qt::AlignLeft);
m_zScaleLabel->setText(QString("Z: "));
m_showZScaleLabel = true;
QPalette versionInfoPalette = p;
QColor versionInfoLabelColor = p.color(QPalette::Window);
versionInfoLabelColor.setAlpha(0);
versionInfoPalette.setColor(QPalette::Window, versionInfoLabelColor);
m_versionInfoLabel->setPalette(versionInfoPalette);
m_zScaleLabel->setPalette(versionInfoPalette);
// Animation progress bar
m_animationProgress = new QProgressBar();
@@ -181,6 +189,7 @@ RiuViewer::RiuViewer(const QGLFormat& format, QWidget* parent)
m_versionInfoLabel->setFont(regTestFont);
m_animationProgress->setFont(regTestFont);
m_histogramWidget->setFont(regTestFont);
m_zScaleLabel->setFont(regTestFont);
}
// When a context menu is created in the viewer is, and the action triggered is displaying a dialog,
@@ -437,6 +446,15 @@ void RiuViewer::paintOverlayItems(QPainter* painter)
m_versionInfoLabel->render(painter, pos);
}
if (m_showZScaleLabel) // Z scale Label
{
QSize size(m_zScaleLabel->sizeHint().width(), m_zScaleLabel->sizeHint().height());
QPoint pos(margin + edgeAxisFrameBorderWidth,
margin + edgeAxisFrameBorderHeight);
m_zScaleLabel->resize(size.width(), size.height());
m_zScaleLabel->render(painter, pos);
}
if (!m_cursorPositionDomainCoords.isUndefined())
{
if (mainCamera())
@@ -469,6 +487,22 @@ void RiuViewer::setInfoText(QString text)
m_infoLabel->setText(text);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::showZScaleLabel(bool enable)
{
m_showZScaleLabel = enable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::setZScale(int scale)
{
m_zScaleLabel->setText(QString("Z: %1").arg(scale));
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -82,6 +82,10 @@ public:
void showInfoText(bool enable);
void setInfoText(QString text);
void showZScaleLabel(bool enable);
void setZScale(int scale);
void showHistogram(bool enable);
void setHistogram(double min, double max, const std::vector<size_t>& histogram);
void setHistogramPercentiles(double pmin, double pmax, double mean);
@@ -152,6 +156,9 @@ private:
QLabel* m_versionInfoLabel;
bool m_showInfoText;
QLabel* m_zScaleLabel;
bool m_showZScaleLabel;
QProgressBar* m_animationProgress;
bool m_showAnimProgress;
RiuSimpleHistogramWidget* m_histogramWidget;