mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1380 Wip: Started to allign all the view widgets, preparing to avoid duplicated code when mdi window to RimViewWindow translation.
This commit is contained in:
@@ -10,6 +10,7 @@ ${CEE_CURRENT_LIST_DIR}RiuCursors.h
|
|||||||
${CEE_CURRENT_LIST_DIR}RiuDragDrop.h
|
${CEE_CURRENT_LIST_DIR}RiuDragDrop.h
|
||||||
${CEE_CURRENT_LIST_DIR}RiuFemResultTextBuilder.h
|
${CEE_CURRENT_LIST_DIR}RiuFemResultTextBuilder.h
|
||||||
${CEE_CURRENT_LIST_DIR}RiuGeoQuestNavigation.h
|
${CEE_CURRENT_LIST_DIR}RiuGeoQuestNavigation.h
|
||||||
|
${CEE_CURRENT_LIST_DIR}RiuInterfaceToViewWindow.h
|
||||||
${CEE_CURRENT_LIST_DIR}RiuLineSegmentQwtPlotCurve.h
|
${CEE_CURRENT_LIST_DIR}RiuLineSegmentQwtPlotCurve.h
|
||||||
${CEE_CURRENT_LIST_DIR}RiuMainPlotWindow.h
|
${CEE_CURRENT_LIST_DIR}RiuMainPlotWindow.h
|
||||||
${CEE_CURRENT_LIST_DIR}RiuMainWindow.h
|
${CEE_CURRENT_LIST_DIR}RiuMainWindow.h
|
||||||
|
|||||||
@@ -222,6 +222,14 @@ RimFlowCharacteristicsPlot* RiuFlowCharacteristicsPlot::ownerPlotDefinition()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimViewWindow* RiuFlowCharacteristicsPlot::ownerViewWindow() const
|
||||||
|
{
|
||||||
|
return m_plotDefinition;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
|
#include "RiuInterfaceToViewWindow.h"
|
||||||
|
|
||||||
class RimFlowCharacteristicsPlot;
|
class RimFlowCharacteristicsPlot;
|
||||||
class RiuNightchartsWidget;
|
class RiuNightchartsWidget;
|
||||||
@@ -41,7 +42,7 @@ namespace cvf {
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RiuFlowCharacteristicsPlot : public QFrame
|
class RiuFlowCharacteristicsPlot : public QFrame, public RiuInterfaceToViewWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
public:
|
public:
|
||||||
@@ -56,6 +57,7 @@ public:
|
|||||||
void zoomAll();
|
void zoomAll();
|
||||||
|
|
||||||
RimFlowCharacteristicsPlot* ownerPlotDefinition();
|
RimFlowCharacteristicsPlot* ownerPlotDefinition();
|
||||||
|
virtual RimViewWindow* ownerViewWindow() const override;
|
||||||
|
|
||||||
static void addWindowZoom(QwtPlot* plot);
|
static void addWindowZoom(QwtPlot* plot);
|
||||||
static RiuLineSegmentQwtPlotCurve* createEmptyCurve(QwtPlot* plot, const QString& curveName, const QColor& curveColor);
|
static RiuLineSegmentQwtPlotCurve* createEmptyCurve(QwtPlot* plot, const QString& curveName, const QColor& curveColor);
|
||||||
|
|||||||
33
ApplicationCode/UserInterface/RiuInterfaceToViewWindow.h
Normal file
33
ApplicationCode/UserInterface/RiuInterfaceToViewWindow.h
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2017 Statoil ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
class RimViewWindow;
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//==================================================================================================
|
||||||
|
class RiuInterfaceToViewWindow
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual RimViewWindow* ownerViewWindow() const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -106,6 +106,14 @@ RimSummaryPlot* RiuSummaryQwtPlot::ownerPlotDefinition()
|
|||||||
return m_plotDefinition;
|
return m_plotDefinition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimViewWindow* RiuSummaryQwtPlot::ownerViewWindow() const
|
||||||
|
{
|
||||||
|
return m_plotDefinition;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "cafPdmPointer.h"
|
#include "cafPdmPointer.h"
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
#include "RiuInterfaceToViewWindow.h"
|
||||||
|
|
||||||
class QwtPlotCurve;
|
class QwtPlotCurve;
|
||||||
class QwtPlotGrid;
|
class QwtPlotGrid;
|
||||||
@@ -37,7 +38,7 @@ class RimSummaryPlot;
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RiuSummaryQwtPlot : public QwtPlot
|
class RiuSummaryQwtPlot : public QwtPlot, public RiuInterfaceToViewWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
public:
|
public:
|
||||||
@@ -45,6 +46,7 @@ public:
|
|||||||
virtual ~RiuSummaryQwtPlot();
|
virtual ~RiuSummaryQwtPlot();
|
||||||
|
|
||||||
RimSummaryPlot* ownerPlotDefinition();
|
RimSummaryPlot* ownerPlotDefinition();
|
||||||
|
virtual RimViewWindow* ownerViewWindow() const override;
|
||||||
|
|
||||||
void useDateBasedTimeAxis();
|
void useDateBasedTimeAxis();
|
||||||
void useTimeBasedTimeAxis();
|
void useTimeBasedTimeAxis();
|
||||||
|
|||||||
@@ -648,6 +648,14 @@ RimView* RiuViewer::ownerReservoirView()
|
|||||||
return m_rimView;
|
return m_rimView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimViewWindow* RiuViewer::ownerViewWindow() const
|
||||||
|
{
|
||||||
|
return m_rimView;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include "cafMouseState.h"
|
#include "cafMouseState.h"
|
||||||
#include "cvfStructGrid.h"
|
#include "cvfStructGrid.h"
|
||||||
|
#include "RiuInterfaceToViewWindow.h"
|
||||||
|
|
||||||
class RicCommandFeature;
|
class RicCommandFeature;
|
||||||
class RimView;
|
class RimView;
|
||||||
@@ -52,7 +53,7 @@ namespace cvf
|
|||||||
// RiuViewer
|
// RiuViewer
|
||||||
//
|
//
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RiuViewer : public caf::Viewer
|
class RiuViewer : public caf::Viewer, public RiuInterfaceToViewWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -65,6 +66,7 @@ public:
|
|||||||
void setPointOfInterest(cvf::Vec3d poi);
|
void setPointOfInterest(cvf::Vec3d poi);
|
||||||
void setOwnerReservoirView(RimView * owner);
|
void setOwnerReservoirView(RimView * owner);
|
||||||
RimView* ownerReservoirView();
|
RimView* ownerReservoirView();
|
||||||
|
RimViewWindow* ownerViewWindow() const override;
|
||||||
void setEnableMask(unsigned int mask);
|
void setEnableMask(unsigned int mask);
|
||||||
|
|
||||||
void showInfoText(bool enable);
|
void showInfoText(bool enable);
|
||||||
|
|||||||
@@ -103,6 +103,14 @@ RimWellAllocationPlot* RiuWellAllocationPlot::ownerPlotDefinition()
|
|||||||
return m_plotDefinition;
|
return m_plotDefinition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimViewWindow* RiuWellAllocationPlot::ownerViewWindow() const
|
||||||
|
{
|
||||||
|
return m_plotDefinition;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -155,6 +163,7 @@ void RiuWellAllocationPlot::clearLegend()
|
|||||||
m_legendWidget->clear();
|
m_legendWidget->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
|
|
||||||
|
#include "RiuInterfaceToViewWindow.h"
|
||||||
|
|
||||||
class RimWellAllocationPlot;
|
class RimWellAllocationPlot;
|
||||||
class RiuNightchartsWidget;
|
class RiuNightchartsWidget;
|
||||||
|
|
||||||
@@ -39,7 +41,7 @@ namespace cvf {
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RiuWellAllocationPlot : public QFrame
|
class RiuWellAllocationPlot : public QFrame, public RiuInterfaceToViewWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
public:
|
public:
|
||||||
@@ -47,12 +49,15 @@ public:
|
|||||||
virtual ~RiuWellAllocationPlot();
|
virtual ~RiuWellAllocationPlot();
|
||||||
|
|
||||||
RimWellAllocationPlot* ownerPlotDefinition();
|
RimWellAllocationPlot* ownerPlotDefinition();
|
||||||
|
virtual RimViewWindow* ownerViewWindow() const override;
|
||||||
|
|
||||||
void showTitle(const QString& title);
|
void showTitle(const QString& title);
|
||||||
void hideTitle();
|
void hideTitle();
|
||||||
void showLegend(bool doShow);
|
void showLegend(bool doShow);
|
||||||
void addLegendItem(const QString& name, const cvf::Color3f& color, float value);
|
void addLegendItem(const QString& name, const cvf::Color3f& color, float value);
|
||||||
void clearLegend();
|
void clearLegend();
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QSize sizeHint() const override;
|
virtual QSize sizeHint() const override;
|
||||||
virtual QSize minimumSizeHint() const override;
|
virtual QSize minimumSizeHint() const override;
|
||||||
@@ -67,4 +72,3 @@ private:
|
|||||||
QPointer<RiuNightchartsWidget> m_legendWidget;
|
QPointer<RiuNightchartsWidget> m_legendWidget;
|
||||||
QPointer<QLabel> m_titleLabel;
|
QPointer<QLabel> m_titleLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -273,6 +273,14 @@ RimWellLogPlot* RiuWellLogPlot::ownerPlotDefinition()
|
|||||||
return m_plotDefinition;
|
return m_plotDefinition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimViewWindow* RiuWellLogPlot::ownerViewWindow() const
|
||||||
|
{
|
||||||
|
return m_plotDefinition;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include "RiuInterfaceToViewWindow.h"
|
||||||
|
|
||||||
class RimWellLogPlot;
|
class RimWellLogPlot;
|
||||||
class RiuWellLogTrack;
|
class RiuWellLogTrack;
|
||||||
|
|
||||||
@@ -38,7 +40,7 @@ class QwtLegend;
|
|||||||
// RiuWellLogPlot
|
// RiuWellLogPlot
|
||||||
//
|
//
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RiuWellLogPlot : public QWidget
|
class RiuWellLogPlot : public QWidget, public RiuInterfaceToViewWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -47,6 +49,7 @@ public:
|
|||||||
virtual ~RiuWellLogPlot();
|
virtual ~RiuWellLogPlot();
|
||||||
|
|
||||||
RimWellLogPlot* ownerPlotDefinition();
|
RimWellLogPlot* ownerPlotDefinition();
|
||||||
|
virtual RimViewWindow* ownerViewWindow() const override;
|
||||||
|
|
||||||
void addTrackPlot(RiuWellLogTrack* trackPlot);
|
void addTrackPlot(RiuWellLogTrack* trackPlot);
|
||||||
void insertTrackPlot(RiuWellLogTrack* trackPlot, size_t index);
|
void insertTrackPlot(RiuWellLogTrack* trackPlot, size_t index);
|
||||||
|
|||||||
Reference in New Issue
Block a user