mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4200 Grid Cross Plot : Adjustments for Linux
This commit is contained in:
parent
59c83157d1
commit
a07f375daf
@ -85,6 +85,8 @@ void RimPlotAxisAnnotation::setEquilibriumData(RimEclipseCase* eclipseCas
|
|||||||
m_sourceCase = eclipseCase;
|
m_sourceCase = eclipseCase;
|
||||||
m_equilNum = zeroBasedEquilRegionIndex + 1;
|
m_equilNum = zeroBasedEquilRegionIndex + 1;
|
||||||
m_annotationType = annotationType;
|
m_annotationType = annotationType;
|
||||||
|
|
||||||
|
updateName();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -146,14 +148,6 @@ void RimPlotAxisAnnotation::fieldChangedByUi(const caf::PdmFieldHandle* changedF
|
|||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
const QVariant& newValue)
|
const QVariant& newValue)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
RimViewWindow* viewWindow = nullptr;
|
|
||||||
this->firstAncestorOrThisOfType(viewWindow);
|
|
||||||
if (viewWindow)
|
|
||||||
{
|
|
||||||
viewWindow->loadDataAndUpdate();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
RimRiuQwtPlotOwnerInterface* parentPlot = nullptr;
|
RimRiuQwtPlotOwnerInterface* parentPlot = nullptr;
|
||||||
this->firstAncestorOrThisOfType(parentPlot);
|
this->firstAncestorOrThisOfType(parentPlot);
|
||||||
if (parentPlot)
|
if (parentPlot)
|
||||||
@ -176,7 +170,7 @@ QList<caf::PdmOptionItemInfo> RimPlotAxisAnnotation::calculateValueOptions(const
|
|||||||
}
|
}
|
||||||
else if (fieldNeedingOptions == &m_equilNum)
|
else if (fieldNeedingOptions == &m_equilNum)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < equilItems().size(); i++)
|
for (int i = 0; i < static_cast<int>(equilItems().size()); i++)
|
||||||
{
|
{
|
||||||
QString uiText = QString("%1").arg(i + 1);
|
QString uiText = QString("%1").arg(i + 1);
|
||||||
options.push_back(caf::PdmOptionItemInfo(uiText, i));
|
options.push_back(caf::PdmOptionItemInfo(uiText, i));
|
||||||
@ -214,7 +208,7 @@ RigEquil RimPlotAxisAnnotation::selectedItem() const
|
|||||||
{
|
{
|
||||||
int index = m_equilNum() - 1;
|
int index = m_equilNum() - 1;
|
||||||
|
|
||||||
if (index < equilItems().size())
|
if (index < static_cast<int>(equilItems().size()))
|
||||||
{
|
{
|
||||||
return equilItems()[index];
|
return equilItems()[index];
|
||||||
}
|
}
|
||||||
@ -234,3 +228,22 @@ std::vector<RigEquil> RimPlotAxisAnnotation::equilItems() const
|
|||||||
|
|
||||||
return std::vector<RigEquil>();
|
return std::vector<RigEquil>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimPlotAxisAnnotation::updateName()
|
||||||
|
{
|
||||||
|
QString text;
|
||||||
|
|
||||||
|
if (m_annotationType() == PL_EQUIL_WATER_OIL_CONTACT)
|
||||||
|
{
|
||||||
|
text = QString("WOC %1").arg(value());
|
||||||
|
}
|
||||||
|
else if (m_annotationType() == PL_EQUIL_GAS_OIL_CONTACT)
|
||||||
|
{
|
||||||
|
text = QString("GOC %1").arg(value());
|
||||||
|
}
|
||||||
|
|
||||||
|
m_name = text;
|
||||||
|
}
|
||||||
|
@ -69,6 +69,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
RigEquil selectedItem() const;
|
RigEquil selectedItem() const;
|
||||||
std::vector<RigEquil> equilItems() const;
|
std::vector<RigEquil> equilItems() const;
|
||||||
|
void updateName();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<ExportKeywordEnum> m_annotationType;
|
caf::PdmField<ExportKeywordEnum> m_annotationType;
|
||||||
|
@ -17,14 +17,16 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#include "RiuInterfaceToViewWindow.h"
|
#include "RiuInterfaceToViewWindow.h"
|
||||||
|
#include "RiuPlotAnnotationTool.h"
|
||||||
#include "RiuQwtPlot.h"
|
#include "RiuQwtPlot.h"
|
||||||
|
|
||||||
#include "cafPdmPointer.h"
|
#include "cafPdmPointer.h"
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
class RimGridCrossPlotCurveSet;
|
class RimGridCrossPlotCurveSet;
|
||||||
class RiuCvfOverlayItemWidget;
|
class RiuCvfOverlayItemWidget;
|
||||||
class RiuPlotAnnotationTool;
|
class RiuPlotAnnotationTool;
|
||||||
@ -54,11 +56,11 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void updateLayout() override;
|
void updateLayout() override;
|
||||||
void updateLegendLayout();
|
void updateLegendLayout();
|
||||||
void resizeEvent(QResizeEvent *e) override;
|
void resizeEvent(QResizeEvent* e) override;
|
||||||
bool resizeOverlayItemToFitPlot(caf::TitledOverlayFrame* overlayItem);
|
bool resizeOverlayItemToFitPlot(caf::TitledOverlayFrame* overlayItem);
|
||||||
void contextMenuEvent(QContextMenuEvent*) override;
|
void contextMenuEvent(QContextMenuEvent*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::map<caf::PdmPointer<RimGridCrossPlotCurveSet>, QPointer<RiuCvfOverlayItemWidget>> m_legendWidgets;
|
std::map<caf::PdmPointer<RimGridCrossPlotCurveSet>, QPointer<RiuCvfOverlayItemWidget>> m_legendWidgets;
|
||||||
std::unique_ptr<RiuPlotAnnotationTool> m_annotationTool;
|
std::unique_ptr<RiuPlotAnnotationTool> m_annotationTool;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user