2017-02-13 01:40:27 -06:00
|
|
|
#include "RiuWellLogPlot.h"
|
|
|
|
|
2019-10-11 08:54:19 -05:00
|
|
|
#include "RimPlotWindow.h"
|
2017-02-13 01:40:27 -06:00
|
|
|
#include "RimWellLogPlot.h"
|
|
|
|
|
2019-10-11 08:54:19 -05:00
|
|
|
#include "cafAssert.h"
|
|
|
|
#include "cafPdmPointer.h"
|
2017-02-13 01:40:27 -06:00
|
|
|
|
|
|
|
#include <QScrollBar>
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 06:17:36 -05:00
|
|
|
///
|
2017-02-13 01:40:27 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 06:17:36 -05:00
|
|
|
RiuWellLogPlot::RiuWellLogPlot( RimWellLogPlot* plotDefinition, QWidget* parent )
|
2019-10-11 08:54:19 -05:00
|
|
|
: RiuGridPlotWindow( plotDefinition, parent )
|
2017-02-13 01:40:27 -06:00
|
|
|
{
|
2019-09-06 06:17:36 -05:00
|
|
|
connect( m_scrollBar, SIGNAL( valueChanged( int ) ), this, SLOT( slotSetMinDepth( int ) ) );
|
2019-09-06 08:52:45 -05:00
|
|
|
}
|
|
|
|
|
2019-10-04 03:26:55 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-10-11 08:54:19 -05:00
|
|
|
RimWellLogPlot* RiuWellLogPlot::wellLogPlotDefinition()
|
2019-10-04 03:26:55 -05:00
|
|
|
{
|
2019-10-11 08:54:19 -05:00
|
|
|
RimWellLogPlot* wellLogPlot = dynamic_cast<RimWellLogPlot*>( m_plotDefinition.p() );
|
|
|
|
CAF_ASSERT( wellLogPlot );
|
|
|
|
return wellLogPlot;
|
2019-10-04 03:26:55 -05:00
|
|
|
}
|
|
|
|
|
2019-10-07 01:32:34 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-10-11 08:54:19 -05:00
|
|
|
void RiuWellLogPlot::updateVerticalScrollBar( double minVisible, double maxVisible, double minAvailable, double maxAvailable )
|
2019-10-07 01:32:34 -05:00
|
|
|
{
|
2019-10-11 08:54:19 -05:00
|
|
|
maxAvailable += 0.01 * ( maxAvailable - minAvailable );
|
2019-10-10 06:33:57 -05:00
|
|
|
|
2019-10-11 08:54:19 -05:00
|
|
|
double visibleRange = maxVisible - minVisible;
|
2017-02-13 01:40:27 -06:00
|
|
|
|
2019-09-06 06:17:36 -05:00
|
|
|
m_scrollBar->blockSignals( true );
|
2017-02-13 01:40:27 -06:00
|
|
|
{
|
2019-10-11 08:54:19 -05:00
|
|
|
m_scrollBar->setRange( (int)minAvailable, (int)( ( maxAvailable - visibleRange ) ) );
|
|
|
|
m_scrollBar->setPageStep( (int)visibleRange );
|
|
|
|
m_scrollBar->setValue( (int)minVisible );
|
2019-09-06 06:17:36 -05:00
|
|
|
m_scrollBar->setVisible( true );
|
2017-02-13 01:40:27 -06:00
|
|
|
}
|
2019-09-06 06:17:36 -05:00
|
|
|
m_scrollBar->blockSignals( false );
|
2017-02-13 01:40:27 -06:00
|
|
|
}
|
|
|
|
|
2019-09-10 06:31:26 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 06:17:36 -05:00
|
|
|
void RiuWellLogPlot::slotSetMinDepth( int value )
|
2017-02-13 01:40:27 -06:00
|
|
|
{
|
|
|
|
double minimumDepth;
|
|
|
|
double maximumDepth;
|
2019-10-11 08:54:19 -05:00
|
|
|
wellLogPlotDefinition()->availableDepthRange( &minimumDepth, &maximumDepth );
|
2017-02-13 01:40:27 -06:00
|
|
|
|
|
|
|
double delta = value - minimumDepth;
|
2019-10-11 08:54:19 -05:00
|
|
|
wellLogPlotDefinition()->setDepthAxisRange( minimumDepth + delta, maximumDepth + delta );
|
|
|
|
wellLogPlotDefinition()->setAutoScaleYEnabled( false );
|
2017-03-31 02:17:49 -05:00
|
|
|
}
|