mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#639) Updated axis cross texts
This commit is contained in:
parent
0b097ec2eb
commit
95e22b581c
@ -186,7 +186,6 @@ void RimEclipseView::clampCurrentTimestep()
|
||||
if (m_currentTimeStep < 0 ) m_currentTimeStep = 0;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -200,6 +199,7 @@ void RimEclipseView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
{
|
||||
bool generateDisplayModel = (viewer() == NULL);
|
||||
updateViewerWidget();
|
||||
|
||||
if (generateDisplayModel)
|
||||
{
|
||||
updateDisplayModelForWellResults();
|
||||
@ -1718,6 +1718,18 @@ void RimEclipseView::updateIconStateForFilterCollections()
|
||||
m_propertyFilterCollection()->uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseView::axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel)
|
||||
{
|
||||
CVF_ASSERT(xLabel && yLabel && zLabel);
|
||||
|
||||
*xLabel = "E(X)";
|
||||
*yLabel = "N(Y)";
|
||||
*zLabel = "Z";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -134,6 +134,8 @@ public:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
void updateIconStateForFilterCollections();
|
||||
|
||||
virtual void axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel);
|
||||
|
||||
protected:
|
||||
virtual void initAfterRead();
|
||||
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
||||
@ -171,7 +173,6 @@ private:
|
||||
|
||||
void clampCurrentTimestep();
|
||||
|
||||
|
||||
virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility);
|
||||
|
||||
|
||||
|
@ -155,7 +155,6 @@ void RimGeoMechView::loadDataAndUpdate()
|
||||
progress.setProgressDescription("Create Display model");
|
||||
|
||||
updateViewerWidget();
|
||||
setCustomAxisCrossLabels();
|
||||
|
||||
this->geoMechPropertyFilterCollection()->loadAndInitializePropertyFilters();
|
||||
|
||||
@ -483,7 +482,6 @@ void RimGeoMechView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
||||
{
|
||||
bool generateDisplayModel = (viewer() == NULL);
|
||||
updateViewerWidget();
|
||||
setCustomAxisCrossLabels();
|
||||
|
||||
if (generateDisplayModel)
|
||||
{
|
||||
@ -516,18 +514,6 @@ void RimGeoMechView::initAfterRead()
|
||||
this->updateUiIconFromToggleField();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechView::setCustomAxisCrossLabels()
|
||||
{
|
||||
// Minimalistic - size of axis cross does not have to be adjusted
|
||||
if (m_viewer) m_viewer->setAxisLabels("E-x1", "N-y2", "Z-3");
|
||||
|
||||
// A bit larger - size of axis cross is slightly larger
|
||||
//if (m_viewer) m_viewer->setAxisLabels("E(x,1)", "N(y,2)", "Z(3)");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -642,6 +628,18 @@ void RimGeoMechView::updateIconStateForFilterCollections()
|
||||
m_propertyFilterCollection()->uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechView::axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel)
|
||||
{
|
||||
CVF_ASSERT(xLabel && yLabel && zLabel);
|
||||
|
||||
*xLabel = "E(X,1)";
|
||||
*yLabel = "N(Y,2)";
|
||||
*zLabel = "Z(3)";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -78,6 +78,8 @@ public:
|
||||
virtual void scheduleGeometryRegen(RivCellSetEnum geometryType);
|
||||
void updateIconStateForFilterCollections();
|
||||
|
||||
virtual void axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel);
|
||||
|
||||
protected:
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "");
|
||||
|
||||
@ -101,9 +103,6 @@ private:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual void initAfterRead();
|
||||
|
||||
void setCustomAxisCrossLabels();
|
||||
|
||||
|
||||
virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility);
|
||||
|
||||
|
||||
|
@ -144,6 +144,7 @@ public:
|
||||
cvf::ref<cvf::UByteArray> currentTotalCellVisibility();
|
||||
|
||||
virtual bool showActiveCellsOnly();
|
||||
virtual void axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel) = 0;
|
||||
|
||||
public:
|
||||
virtual void loadDataAndUpdate() = 0;
|
||||
|
@ -53,7 +53,6 @@
|
||||
#include <QLabel>
|
||||
#include <QMouseEvent>
|
||||
#include <QProgressBar>
|
||||
#include "RimCase.h"
|
||||
|
||||
using cvf::ManipulatorTrackball;
|
||||
|
||||
@ -78,7 +77,7 @@ RiuViewer::RiuViewer(const QGLFormat& format, QWidget* parent)
|
||||
{
|
||||
cvf::Font* standardFont = RiaApplication::instance()->standardFont();
|
||||
m_axisCross = new cvf::OverlayAxisCross(m_mainCamera.p(), standardFont);
|
||||
m_axisCross->setAxisLabels("E", "N", "Z");
|
||||
m_axisCross->setAxisLabels("X", "Y", "Z");
|
||||
m_axisCross->setLayout(cvf::OverlayItem::VERTICAL, cvf::OverlayItem::BOTTOM_LEFT);
|
||||
m_mainRendering->addOverlayItem(m_axisCross.p());
|
||||
|
||||
@ -300,6 +299,13 @@ void RiuViewer::setOwnerReservoirView(RimView * owner)
|
||||
{
|
||||
m_rimView = owner;
|
||||
m_viewerCommands->setOwnerView(owner);
|
||||
|
||||
cvf::String xLabel;
|
||||
cvf::String yLabel;
|
||||
cvf::String zLabel;
|
||||
|
||||
m_rimView->axisLabels(&xLabel, &yLabel, &zLabel);
|
||||
setAxisLabels(xLabel, yLabel, zLabel);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -579,19 +585,24 @@ void RiuViewer::setAxisLabels(const cvf::String& xLabel, const cvf::String& yLab
|
||||
{
|
||||
m_axisCross->setAxisLabels(xLabel, yLabel, zLabel);
|
||||
|
||||
size_t maxAxisLabelLength = xLabel.size();
|
||||
if (yLabel.size() > maxAxisLabelLength) maxAxisLabelLength = yLabel.size();
|
||||
if (zLabel.size() > maxAxisLabelLength) maxAxisLabelLength = zLabel.size();
|
||||
// The axis cross is designed for short labels, longer labels causes clipping of text
|
||||
// The commented out code adjust the size of the axis cross, and this makes the axis cross labels visible
|
||||
// Side effect is also that the axis cross is zoomed (will be larger)
|
||||
/*
|
||||
size_t maxAxisLabelLength = xLabel.size();
|
||||
if (yLabel.size() > maxAxisLabelLength) maxAxisLabelLength = yLabel.size();
|
||||
if (zLabel.size() > maxAxisLabelLength) maxAxisLabelLength = zLabel.size();
|
||||
|
||||
if (maxAxisLabelLength > 4)
|
||||
{
|
||||
if (maxAxisLabelLength < 6)
|
||||
if (maxAxisLabelLength > 4)
|
||||
{
|
||||
m_axisCross->setSize(cvf::Vec2ui(140, 140));
|
||||
if (maxAxisLabelLength < 6)
|
||||
{
|
||||
m_axisCross->setSize(cvf::Vec2ui(140, 140));
|
||||
}
|
||||
else if (maxAxisLabelLength < 8)
|
||||
{
|
||||
m_axisCross->setSize(cvf::Vec2ui(160, 160));
|
||||
}
|
||||
}
|
||||
else if (maxAxisLabelLength < 8)
|
||||
{
|
||||
m_axisCross->setSize(cvf::Vec2ui(160, 160));
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user