mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #8459 from OPM/8458-summary-drop-target
Closes #8458
This commit is contained in:
@@ -274,6 +274,21 @@ void RimPlot::updateZoomFromParentPlot()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmObject* RimPlot::findPdmObjectFromPlotCurve( const RiuPlotCurve* curve ) const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlot::handleDroppedObjects( const std::vector<caf::PdmObjectHandle*>& objects )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -98,7 +98,8 @@ public:
|
||||
virtual void updateZoomInParentPlot();
|
||||
virtual void updateZoomFromParentPlot();
|
||||
|
||||
virtual caf::PdmObject* findPdmObjectFromPlotCurve( const RiuPlotCurve* curve ) const { return nullptr; };
|
||||
virtual caf::PdmObject* findPdmObjectFromPlotCurve( const RiuPlotCurve* curve ) const;
|
||||
virtual void handleDroppedObjects( const std::vector<caf::PdmObjectHandle*>& objects );
|
||||
|
||||
protected:
|
||||
virtual RiuPlotWidget* doCreatePlotViewWidget( QWidget* parent ) = 0;
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "RimPlotAxisLogRangeCalculator.h"
|
||||
#include "RimPlotAxisProperties.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryAddress.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
@@ -1957,6 +1958,41 @@ void RimSummaryPlot::setAsCrossPlot()
|
||||
m_isCrossPlot = true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::handleDroppedObjects( const std::vector<caf::PdmObjectHandle*>& objects )
|
||||
{
|
||||
for ( auto obj : objects )
|
||||
{
|
||||
auto summaryAdr = dynamic_cast<RimSummaryAddress*>( obj );
|
||||
if ( summaryAdr )
|
||||
{
|
||||
if ( summaryAdr->isEnsemble() )
|
||||
{
|
||||
// TODO: Add drop support for ensemble curves
|
||||
}
|
||||
else
|
||||
{
|
||||
auto summaryCase = RiaSummaryTools::summaryCaseById( summaryAdr->caseId() );
|
||||
if ( summaryCase )
|
||||
{
|
||||
auto* newCurve = new RimSummaryCurve();
|
||||
|
||||
newCurve->setSummaryCaseY( summaryCase );
|
||||
newCurve->setSummaryAddressYAndApplyInterpolation( summaryAdr->address() );
|
||||
|
||||
addCurveNoUpdate( newCurve );
|
||||
|
||||
newCurve->loadDataAndUpdate( true );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -216,6 +216,7 @@ protected:
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
void handleDroppedObjects( const std::vector<caf::PdmObjectHandle*>& objects ) override;
|
||||
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user