mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Well Log Plot and Well Distribution Plots no longer inherit Multiplot
* Also cleaned up RiuQwtPlotWidget
This commit is contained in:
@@ -87,4 +87,8 @@ list(APPEND CODE_SOURCE_FILES
|
||||
${SOURCE_GROUP_SOURCE_FILES}
|
||||
)
|
||||
|
||||
list(APPEND QT_MOC_HEADERS
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlot.h
|
||||
)
|
||||
|
||||
source_group( "ProjectDataModel\\Summary" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake )
|
||||
|
||||
@@ -496,9 +496,9 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
|
||||
if ( curveMerger.allXValues().size() > 0 )
|
||||
{
|
||||
m_qwtPlotCurve->setSamplesFromXValuesAndYValues( curveMerger.interpolatedYValuesForAllXValues( 0 ),
|
||||
curveMerger.interpolatedYValuesForAllXValues( 1 ),
|
||||
isLogCurve );
|
||||
this->setSamplesFromXYValues( curveMerger.interpolatedYValuesForAllXValues( 0 ),
|
||||
curveMerger.interpolatedYValuesForAllXValues( 1 ),
|
||||
isLogCurve );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -530,12 +530,12 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlotCurve->setSamplesFromXValuesAndYValues( timeSteps, curveValuesY, isLogCurve );
|
||||
this->setSamplesFromXYValues( timeSteps, curveValuesY, isLogCurve );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlotCurve->setSamplesFromTimeTAndYValues( curveTimeStepsY, curveValuesY, isLogCurve );
|
||||
this->setSamplesFromTimeTAndYValues( curveTimeStepsY, curveValuesY, isLogCurve );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -553,7 +553,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
}
|
||||
}
|
||||
|
||||
m_qwtPlotCurve->setSamplesFromXValuesAndYValues( timeFromSimulationStart, curveValuesY, isLogCurve );
|
||||
this->setSamplesFromXYValues( timeFromSimulationStart, curveValuesY, isLogCurve );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -564,7 +564,7 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
|
||||
if ( shouldPopulateViewWithEmptyData )
|
||||
{
|
||||
m_qwtPlotCurve->setSamplesFromXValuesAndYValues( std::vector<double>(), std::vector<double>(), isLogCurve );
|
||||
this->setSamplesFromXYValues( std::vector<double>(), std::vector<double>(), isLogCurve );
|
||||
}
|
||||
|
||||
if ( updateParentPlot && m_parentQwtPlot )
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimEnsembleCurveSetCollection.h"
|
||||
#include "RimGridTimeHistoryCurve.h"
|
||||
#include "RimMultiPlotWindow.h"
|
||||
#include "RimMultiPlot.h"
|
||||
#include "RimPlotAxisProperties.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCase.h"
|
||||
@@ -209,7 +209,6 @@ RimSummaryPlot::RimSummaryPlot()
|
||||
m_summaryCurves_OBSOLETE.uiCapability()->setUiTreeHidden( true );
|
||||
|
||||
m_isCrossPlot = false;
|
||||
m_isDraggable = true;
|
||||
|
||||
m_nameHelperAllCurves.reset( new RimSummaryPlotNameHelper );
|
||||
|
||||
@@ -543,6 +542,14 @@ void RimSummaryPlot::updatePlotTitle()
|
||||
|
||||
updateCurveNames();
|
||||
updateMdiWindowTitle();
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
QString plotTitle = description();
|
||||
m_plotWidget->setPlotTitle( plotTitle );
|
||||
m_plotWidget->setPlotTitleEnabled( m_showPlotTitle && isMdiWindow() );
|
||||
m_plotWidget->scheduleReplot();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1336,11 +1343,6 @@ void RimSummaryPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
{
|
||||
RimPlot::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
|
||||
if ( changedField == &m_showWindow )
|
||||
{
|
||||
updateWindowVisibility();
|
||||
}
|
||||
|
||||
if ( changedField == &m_showPlotTitle || changedField == &m_description || changedField == &m_useAutoPlotTitle )
|
||||
{
|
||||
updatePlotTitle();
|
||||
@@ -1425,8 +1427,7 @@ void RimSummaryPlot::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin
|
||||
void RimSummaryPlot::onLoadDataAndUpdate()
|
||||
{
|
||||
updatePlotTitle();
|
||||
|
||||
updateWindowVisibility();
|
||||
updateMdiWindowVisibility();
|
||||
|
||||
if ( m_summaryCurveCollection )
|
||||
{
|
||||
@@ -1567,14 +1568,6 @@ QString RimSummaryPlot::description() const
|
||||
return m_description();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::setDraggable( bool draggable )
|
||||
{
|
||||
m_isDraggable = draggable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1599,6 +1592,16 @@ void RimSummaryPlot::setAsCrossPlot()
|
||||
m_isCrossPlot = true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::onPlotZoomed()
|
||||
{
|
||||
setAutoScaleXEnabled( false );
|
||||
setAutoScaleYEnabled( false );
|
||||
updateZoomFromQwt();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1648,12 +1651,11 @@ void RimSummaryPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* RimSummaryPlot::createViewWidget( QWidget* mainWindowParent )
|
||||
RiuQwtPlotWidget* RimSummaryPlot::doCreatePlotViewWidget( QWidget* mainWindowParent )
|
||||
{
|
||||
if ( !m_plotWidget )
|
||||
{
|
||||
m_plotWidget = new RiuSummaryQwtPlot( this, mainWindowParent );
|
||||
m_plotWidget->setDraggable( m_isDraggable );
|
||||
|
||||
for ( RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves )
|
||||
{
|
||||
@@ -1674,6 +1676,10 @@ QWidget* RimSummaryPlot::createViewWidget( QWidget* mainWindowParent )
|
||||
{
|
||||
m_ensembleCurveSetCollection->setParentQwtPlotAndReplot( m_plotWidget );
|
||||
}
|
||||
|
||||
this->connect( m_plotWidget, SIGNAL( plotZoomed() ), SLOT( onPlotZoomed() ) );
|
||||
|
||||
updatePlotTitle();
|
||||
}
|
||||
|
||||
return m_plotWidget;
|
||||
@@ -1735,36 +1741,6 @@ void RimSummaryPlot::initAfterRead()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::updateMdiWindowTitle()
|
||||
{
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
if ( isMdiWindow() )
|
||||
{
|
||||
QString plotTitle = description();
|
||||
|
||||
m_plotWidget->setWindowTitle( plotTitle );
|
||||
|
||||
if ( m_showPlotTitle )
|
||||
{
|
||||
m_plotWidget->setTitle( plotTitle );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plotWidget->setTitle( "" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plotWidget->setTitle( "" );
|
||||
}
|
||||
m_plotWidget->scheduleReplot();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1817,22 +1793,6 @@ void RimSummaryPlot::updateNameHelperWithCurveData( RimSummaryPlotNameHelper* na
|
||||
nameHelper->setEnsembleCases( ensembleCases );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::updateWindowVisibility()
|
||||
{
|
||||
if ( isMdiWindow() )
|
||||
{
|
||||
updateMdiWindowVisibility();
|
||||
}
|
||||
else
|
||||
{
|
||||
updateParentLayout();
|
||||
}
|
||||
updateAxes();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -65,6 +65,7 @@ class QKeyEvent;
|
||||
//==================================================================================================
|
||||
class RimSummaryPlot : public RimPlot
|
||||
{
|
||||
Q_OBJECT;
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
@@ -76,8 +77,6 @@ public:
|
||||
void setDescription( const QString& description );
|
||||
QString description() const override;
|
||||
|
||||
void setDraggable( bool draggable );
|
||||
|
||||
void enableAutoPlotTitle( bool enable );
|
||||
bool autoPlotTitle() const;
|
||||
|
||||
@@ -155,7 +154,6 @@ public:
|
||||
void setNormalizationEnabled( bool enable );
|
||||
bool isNormalizationEnabled();
|
||||
|
||||
void handleKeyPressEvent( QKeyEvent* keyEvent );
|
||||
virtual RimSummaryPlotSourceStepping* sourceSteppingObjectForKeyEventHandling() const;
|
||||
virtual std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
||||
|
||||
@@ -172,20 +170,20 @@ public:
|
||||
|
||||
public:
|
||||
// RimViewWindow overrides
|
||||
QWidget* createViewWidget( QWidget* mainWindowParent = nullptr ) override;
|
||||
void deleteViewWidget() override;
|
||||
void initAfterRead() override;
|
||||
void deleteViewWidget() override;
|
||||
void initAfterRead() override;
|
||||
|
||||
private:
|
||||
void updateMdiWindowTitle() override;
|
||||
RiuQwtPlotWidget* doCreatePlotViewWidget( QWidget* mainWindowParent = nullptr ) override;
|
||||
|
||||
void updateNameHelperWithCurveData( RimSummaryPlotNameHelper* nameHelper ) const;
|
||||
|
||||
void updateWindowVisibility();
|
||||
void doUpdateLayout() override;
|
||||
|
||||
void detachAllPlotItems();
|
||||
|
||||
void doRemoveFromCollection() override;
|
||||
void handleKeyPressEvent( QKeyEvent* keyEvent ) override;
|
||||
|
||||
protected:
|
||||
// Overridden PDM methods
|
||||
@@ -201,6 +199,9 @@ protected:
|
||||
|
||||
void setAsCrossPlot();
|
||||
|
||||
private slots:
|
||||
void onPlotZoomed();
|
||||
|
||||
private:
|
||||
std::vector<RimSummaryCurve*> visibleSummaryCurvesForAxis( RiaDefines::PlotAxis plotAxis ) const;
|
||||
std::vector<RimGridTimeHistoryCurve*> visibleTimeHistoryCurvesForAxis( RiaDefines::PlotAxis plotAxis ) const;
|
||||
@@ -244,7 +245,6 @@ private:
|
||||
std::unique_ptr<QwtPlotTextLabel> m_plotInfoLabel;
|
||||
|
||||
bool m_isCrossPlot;
|
||||
bool m_isDraggable;
|
||||
|
||||
std::unique_ptr<RimSummaryPlotNameHelper> m_nameHelperAllCurves;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user