#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:
Jacob Støren 2017-03-31 09:17:49 +02:00
parent 9a11949f67
commit a914e38d53
12 changed files with 94 additions and 6 deletions

View File

@ -10,6 +10,7 @@ ${CEE_CURRENT_LIST_DIR}RiuCursors.h
${CEE_CURRENT_LIST_DIR}RiuDragDrop.h
${CEE_CURRENT_LIST_DIR}RiuFemResultTextBuilder.h
${CEE_CURRENT_LIST_DIR}RiuGeoQuestNavigation.h
${CEE_CURRENT_LIST_DIR}RiuInterfaceToViewWindow.h
${CEE_CURRENT_LIST_DIR}RiuLineSegmentQwtPlotCurve.h
${CEE_CURRENT_LIST_DIR}RiuMainPlotWindow.h
${CEE_CURRENT_LIST_DIR}RiuMainWindow.h

View File

@ -222,6 +222,14 @@ RimFlowCharacteristicsPlot* RiuFlowCharacteristicsPlot::ownerPlotDefinition()
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimViewWindow* RiuFlowCharacteristicsPlot::ownerViewWindow() const
{
return m_plotDefinition;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -24,6 +24,7 @@
#include <QPointer>
#include <QFrame>
#include "RiuInterfaceToViewWindow.h"
class RimFlowCharacteristicsPlot;
class RiuNightchartsWidget;
@ -41,7 +42,7 @@ namespace cvf {
//
//
//==================================================================================================
class RiuFlowCharacteristicsPlot : public QFrame
class RiuFlowCharacteristicsPlot : public QFrame, public RiuInterfaceToViewWindow
{
Q_OBJECT;
public:
@ -56,6 +57,7 @@ public:
void zoomAll();
RimFlowCharacteristicsPlot* ownerPlotDefinition();
virtual RimViewWindow* ownerViewWindow() const override;
static void addWindowZoom(QwtPlot* plot);
static RiuLineSegmentQwtPlotCurve* createEmptyCurve(QwtPlot* plot, const QString& curveName, const QColor& curveColor);

View 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;
};

View File

@ -106,6 +106,14 @@ RimSummaryPlot* RiuSummaryQwtPlot::ownerPlotDefinition()
return m_plotDefinition;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimViewWindow* RiuSummaryQwtPlot::ownerViewWindow() const
{
return m_plotDefinition;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -22,6 +22,7 @@
#include "cafPdmPointer.h"
#include <QPointer>
#include "RiuInterfaceToViewWindow.h"
class QwtPlotCurve;
class QwtPlotGrid;
@ -37,7 +38,7 @@ class RimSummaryPlot;
//
//
//==================================================================================================
class RiuSummaryQwtPlot : public QwtPlot
class RiuSummaryQwtPlot : public QwtPlot, public RiuInterfaceToViewWindow
{
Q_OBJECT;
public:
@ -45,6 +46,7 @@ public:
virtual ~RiuSummaryQwtPlot();
RimSummaryPlot* ownerPlotDefinition();
virtual RimViewWindow* ownerViewWindow() const override;
void useDateBasedTimeAxis();
void useTimeBasedTimeAxis();

View File

@ -648,6 +648,14 @@ RimView* RiuViewer::ownerReservoirView()
return m_rimView;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimViewWindow* RiuViewer::ownerViewWindow() const
{
return m_rimView;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -27,6 +27,7 @@
#include "cafMouseState.h"
#include "cvfStructGrid.h"
#include "RiuInterfaceToViewWindow.h"
class RicCommandFeature;
class RimView;
@ -52,7 +53,7 @@ namespace cvf
// RiuViewer
//
//==================================================================================================
class RiuViewer : public caf::Viewer
class RiuViewer : public caf::Viewer, public RiuInterfaceToViewWindow
{
Q_OBJECT
@ -65,6 +66,7 @@ public:
void setPointOfInterest(cvf::Vec3d poi);
void setOwnerReservoirView(RimView * owner);
RimView* ownerReservoirView();
RimViewWindow* ownerViewWindow() const override;
void setEnableMask(unsigned int mask);
void showInfoText(bool enable);

View File

@ -103,6 +103,14 @@ RimWellAllocationPlot* RiuWellAllocationPlot::ownerPlotDefinition()
return m_plotDefinition;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimViewWindow* RiuWellAllocationPlot::ownerViewWindow() const
{
return m_plotDefinition;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -155,6 +163,7 @@ void RiuWellAllocationPlot::clearLegend()
m_legendWidget->clear();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -25,6 +25,8 @@
#include <QPointer>
#include <QFrame>
#include "RiuInterfaceToViewWindow.h"
class RimWellAllocationPlot;
class RiuNightchartsWidget;
@ -39,7 +41,7 @@ namespace cvf {
//
//
//==================================================================================================
class RiuWellAllocationPlot : public QFrame
class RiuWellAllocationPlot : public QFrame, public RiuInterfaceToViewWindow
{
Q_OBJECT;
public:
@ -47,12 +49,15 @@ public:
virtual ~RiuWellAllocationPlot();
RimWellAllocationPlot* ownerPlotDefinition();
virtual RimViewWindow* ownerViewWindow() const override;
void showTitle(const QString& title);
void hideTitle();
void showLegend(bool doShow);
void addLegendItem(const QString& name, const cvf::Color3f& color, float value);
void clearLegend();
protected:
virtual QSize sizeHint() const override;
virtual QSize minimumSizeHint() const override;
@ -67,4 +72,3 @@ private:
QPointer<RiuNightchartsWidget> m_legendWidget;
QPointer<QLabel> m_titleLabel;
};

View File

@ -273,6 +273,14 @@ RimWellLogPlot* RiuWellLogPlot::ownerPlotDefinition()
return m_plotDefinition;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimViewWindow* RiuWellLogPlot::ownerViewWindow() const
{
return m_plotDefinition;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -25,6 +25,8 @@
#include <QPointer>
#include <QWidget>
#include "RiuInterfaceToViewWindow.h"
class RimWellLogPlot;
class RiuWellLogTrack;
@ -38,7 +40,7 @@ class QwtLegend;
// RiuWellLogPlot
//
//==================================================================================================
class RiuWellLogPlot : public QWidget
class RiuWellLogPlot : public QWidget, public RiuInterfaceToViewWindow
{
Q_OBJECT
@ -47,6 +49,7 @@ public:
virtual ~RiuWellLogPlot();
RimWellLogPlot* ownerPlotDefinition();
virtual RimViewWindow* ownerViewWindow() const override;
void addTrackPlot(RiuWellLogTrack* trackPlot);
void insertTrackPlot(RiuWellLogTrack* trackPlot, size_t index);