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:
@@ -78,8 +78,13 @@
|
||||
#include "cafPdmUiSliderEditor.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QWheelEvent>
|
||||
|
||||
#define RI_LOGPLOTTRACK_MINX_DEFAULT -10.0
|
||||
#define RI_LOGPLOTTRACK_MAXX_DEFAULT 100.0
|
||||
#define RI_SCROLLWHEEL_ZOOMFACTOR 1.1
|
||||
#define RI_SCROLLWHEEL_PANFACTOR 0.1
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimWellLogTrack, "WellLogPlotTrack" );
|
||||
|
||||
@@ -482,11 +487,11 @@ void RimWellLogTrack::updateYZoom()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::doRemoveFromCollection()
|
||||
{
|
||||
RimMultiPlotWindow* multiPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType( multiPlot );
|
||||
if ( multiPlot )
|
||||
RimWellLogPlot* wellLogPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType( wellLogPlot );
|
||||
if ( wellLogPlot )
|
||||
{
|
||||
multiPlot->removePlot( this );
|
||||
wellLogPlot->removePlot( this );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1296,21 +1301,18 @@ RimWellLogTrack::TrajectoryType RimWellLogTrack::formationTrajectoryType() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* RimWellLogTrack::createViewWidget( QWidget* mainWindowParent )
|
||||
RiuQwtPlotWidget* RimWellLogTrack::doCreatePlotViewWidget( QWidget* mainWindowParent )
|
||||
{
|
||||
if ( m_plotWidget == nullptr )
|
||||
{
|
||||
m_plotWidget = new RiuWellLogTrack( this, mainWindowParent );
|
||||
m_plotWidget->setAxisInverted( QwtPlot::yLeft );
|
||||
|
||||
updateAxisScaleEngine();
|
||||
|
||||
for ( size_t cIdx = 0; cIdx < m_curves.size(); ++cIdx )
|
||||
{
|
||||
m_curves[cIdx]->setParentQwtPlotNoReplot( this->m_plotWidget );
|
||||
}
|
||||
|
||||
m_plotWidget->scheduleReplot();
|
||||
}
|
||||
return m_plotWidget;
|
||||
}
|
||||
@@ -1760,6 +1762,38 @@ RimWellLogPlot* RimWellLogTrack::parentWellLogPlot() const
|
||||
return wellLogPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::handleWheelEvent( QWheelEvent* event )
|
||||
{
|
||||
RimWellLogPlot* wellLogPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType( wellLogPlot );
|
||||
|
||||
if ( wellLogPlot )
|
||||
{
|
||||
if ( event->modifiers() & Qt::ControlModifier )
|
||||
{
|
||||
QwtScaleMap scaleMap = m_plotWidget->canvasMap( QwtPlot::yLeft );
|
||||
double zoomCenter = scaleMap.invTransform( event->pos().y() );
|
||||
|
||||
if ( event->delta() > 0 )
|
||||
{
|
||||
wellLogPlot->setDepthAxisRangeByFactorAndCenter( RI_SCROLLWHEEL_ZOOMFACTOR, zoomCenter );
|
||||
}
|
||||
else
|
||||
{
|
||||
wellLogPlot->setDepthAxisRangeByFactorAndCenter( 1.0 / RI_SCROLLWHEEL_ZOOMFACTOR, zoomCenter );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wellLogPlot->setDepthAxisRangeByPanDepth( event->delta() < 0 ? RI_SCROLLWHEEL_PANFACTOR
|
||||
: -RI_SCROLLWHEEL_PANFACTOR );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user