mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3790 Z scale label. Display in upper left corner
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user