mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix CRLF line endings.
This commit is contained in:
@@ -1,130 +1,130 @@
|
||||
#include "RiuWellLogPlot.h"
|
||||
|
||||
#include "RimPlotWindow.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
|
||||
#include "RiuQwtPlotWidget.h"
|
||||
#include "RiuWellLogTrack.h"
|
||||
|
||||
#include "cafAssert.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include <QScrollBar>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuWellLogPlot::RiuWellLogPlot( RimWellLogPlot* plotDefinition, QWidget* parent )
|
||||
: RiuMultiPlotPage( plotDefinition, parent )
|
||||
{
|
||||
m_trackScrollBar = new QScrollBar( nullptr );
|
||||
m_trackScrollBar->setOrientation( Qt::Vertical );
|
||||
m_trackScrollBar->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
|
||||
|
||||
m_trackScrollBarLayout = new QVBoxLayout;
|
||||
m_trackScrollBarLayout->addWidget( m_trackScrollBar, 0 );
|
||||
|
||||
connect( m_trackScrollBar, SIGNAL( valueChanged( int ) ), this, SLOT( slotSetMinDepth( int ) ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogPlot* RiuWellLogPlot::wellLogPlotDefinition()
|
||||
{
|
||||
RimWellLogPlot* wellLogPlot = dynamic_cast<RimWellLogPlot*>( m_plotDefinition.p() );
|
||||
CAF_ASSERT( wellLogPlot );
|
||||
return wellLogPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewWindow* RiuWellLogPlot::ownerViewWindow() const
|
||||
{
|
||||
return m_plotDefinition;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::updateVerticalScrollBar( double minVisible, double maxVisible, double minAvailable, double maxAvailable )
|
||||
{
|
||||
maxAvailable += 0.01 * ( maxAvailable - minAvailable );
|
||||
|
||||
double visibleRange = maxVisible - minVisible;
|
||||
|
||||
m_trackScrollBar->blockSignals( true );
|
||||
{
|
||||
m_trackScrollBar->setRange( (int)minAvailable, (int)( ( maxAvailable - visibleRange ) ) );
|
||||
m_trackScrollBar->setPageStep( (int)visibleRange );
|
||||
m_trackScrollBar->setValue( (int)minVisible );
|
||||
}
|
||||
m_trackScrollBar->blockSignals( false );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::renderTo( QPaintDevice* paintDevice )
|
||||
{
|
||||
m_trackScrollBar->setVisible( false );
|
||||
RiuMultiPlotPage::renderTo( paintDevice );
|
||||
m_trackScrollBar->setVisible( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiuWellLogPlot::showYAxis( int row, int column ) const
|
||||
{
|
||||
return column == 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::reinsertScrollbar()
|
||||
{
|
||||
QList<QPointer<RiuQwtPlotWidget>> plotWidgets = this->visiblePlotWidgets();
|
||||
QList<QPointer<RiuQwtPlotLegend>> legends = this->legendsForVisiblePlots();
|
||||
int colCount = this->m_gridLayout->columnCount();
|
||||
|
||||
m_gridLayout->addLayout( m_trackScrollBarLayout, 2, colCount, 1, 1 );
|
||||
m_trackScrollBar->setVisible( !plotWidgets.empty() );
|
||||
m_gridLayout->setColumnStretch( colCount, 0 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::alignScrollbar( int offset )
|
||||
{
|
||||
m_trackScrollBarLayout->setContentsMargins( 0, offset, 0, 0 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::slotSetMinDepth( int value )
|
||||
{
|
||||
double minimumDepth;
|
||||
double maximumDepth;
|
||||
wellLogPlotDefinition()->visibleDepthRange( &minimumDepth, &maximumDepth );
|
||||
|
||||
double delta = value - minimumDepth;
|
||||
wellLogPlotDefinition()->setDepthAxisRange( minimumDepth + delta, maximumDepth + delta );
|
||||
wellLogPlotDefinition()->setAutoScaleDepthEnabled( false );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::performUpdate()
|
||||
{
|
||||
m_trackScrollBar->setVisible( false );
|
||||
reinsertPlotWidgets();
|
||||
reinsertScrollbar();
|
||||
int axisShift = alignCanvasTops();
|
||||
alignScrollbar( axisShift );
|
||||
}
|
||||
#include "RiuWellLogPlot.h"
|
||||
|
||||
#include "RimPlotWindow.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
|
||||
#include "RiuQwtPlotWidget.h"
|
||||
#include "RiuWellLogTrack.h"
|
||||
|
||||
#include "cafAssert.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include <QScrollBar>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuWellLogPlot::RiuWellLogPlot( RimWellLogPlot* plotDefinition, QWidget* parent )
|
||||
: RiuMultiPlotPage( plotDefinition, parent )
|
||||
{
|
||||
m_trackScrollBar = new QScrollBar( nullptr );
|
||||
m_trackScrollBar->setOrientation( Qt::Vertical );
|
||||
m_trackScrollBar->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
|
||||
|
||||
m_trackScrollBarLayout = new QVBoxLayout;
|
||||
m_trackScrollBarLayout->addWidget( m_trackScrollBar, 0 );
|
||||
|
||||
connect( m_trackScrollBar, SIGNAL( valueChanged( int ) ), this, SLOT( slotSetMinDepth( int ) ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogPlot* RiuWellLogPlot::wellLogPlotDefinition()
|
||||
{
|
||||
RimWellLogPlot* wellLogPlot = dynamic_cast<RimWellLogPlot*>( m_plotDefinition.p() );
|
||||
CAF_ASSERT( wellLogPlot );
|
||||
return wellLogPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewWindow* RiuWellLogPlot::ownerViewWindow() const
|
||||
{
|
||||
return m_plotDefinition;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::updateVerticalScrollBar( double minVisible, double maxVisible, double minAvailable, double maxAvailable )
|
||||
{
|
||||
maxAvailable += 0.01 * ( maxAvailable - minAvailable );
|
||||
|
||||
double visibleRange = maxVisible - minVisible;
|
||||
|
||||
m_trackScrollBar->blockSignals( true );
|
||||
{
|
||||
m_trackScrollBar->setRange( (int)minAvailable, (int)( ( maxAvailable - visibleRange ) ) );
|
||||
m_trackScrollBar->setPageStep( (int)visibleRange );
|
||||
m_trackScrollBar->setValue( (int)minVisible );
|
||||
}
|
||||
m_trackScrollBar->blockSignals( false );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::renderTo( QPaintDevice* paintDevice )
|
||||
{
|
||||
m_trackScrollBar->setVisible( false );
|
||||
RiuMultiPlotPage::renderTo( paintDevice );
|
||||
m_trackScrollBar->setVisible( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiuWellLogPlot::showYAxis( int row, int column ) const
|
||||
{
|
||||
return column == 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::reinsertScrollbar()
|
||||
{
|
||||
QList<QPointer<RiuQwtPlotWidget>> plotWidgets = this->visiblePlotWidgets();
|
||||
QList<QPointer<RiuQwtPlotLegend>> legends = this->legendsForVisiblePlots();
|
||||
int colCount = this->m_gridLayout->columnCount();
|
||||
|
||||
m_gridLayout->addLayout( m_trackScrollBarLayout, 2, colCount, 1, 1 );
|
||||
m_trackScrollBar->setVisible( !plotWidgets.empty() );
|
||||
m_gridLayout->setColumnStretch( colCount, 0 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::alignScrollbar( int offset )
|
||||
{
|
||||
m_trackScrollBarLayout->setContentsMargins( 0, offset, 0, 0 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::slotSetMinDepth( int value )
|
||||
{
|
||||
double minimumDepth;
|
||||
double maximumDepth;
|
||||
wellLogPlotDefinition()->visibleDepthRange( &minimumDepth, &maximumDepth );
|
||||
|
||||
double delta = value - minimumDepth;
|
||||
wellLogPlotDefinition()->setDepthAxisRange( minimumDepth + delta, maximumDepth + delta );
|
||||
wellLogPlotDefinition()->setAutoScaleDepthEnabled( false );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::performUpdate()
|
||||
{
|
||||
m_trackScrollBar->setVisible( false );
|
||||
reinsertPlotWidgets();
|
||||
reinsertScrollbar();
|
||||
int axisShift = alignCanvasTops();
|
||||
alignScrollbar( axisShift );
|
||||
}
|
||||
|
||||
@@ -1,53 +1,53 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- Equinor 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
|
||||
|
||||
#include "RiuInterfaceToViewWindow.h"
|
||||
#include "RiuMultiPlotPage.h"
|
||||
|
||||
class RiuQwtPlotWidget;
|
||||
class RimWellLogPlot;
|
||||
|
||||
class RiuWellLogPlot : public RiuMultiPlotPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
RiuWellLogPlot( RimWellLogPlot* plotDefinition, QWidget* parent );
|
||||
|
||||
RimViewWindow* ownerViewWindow() const override;
|
||||
|
||||
void updateVerticalScrollBar( double minVisible, double maxVisible, double minAvailable, double maxAvailable ) override;
|
||||
void renderTo( QPaintDevice* paintDevice ) override;
|
||||
|
||||
protected:
|
||||
bool showYAxis( int row, int column ) const override;
|
||||
|
||||
void reinsertScrollbar();
|
||||
void alignScrollbar( int offset );
|
||||
|
||||
private:
|
||||
RimWellLogPlot* wellLogPlotDefinition();
|
||||
|
||||
private slots:
|
||||
void slotSetMinDepth( int value );
|
||||
void performUpdate() override;
|
||||
|
||||
private:
|
||||
QPointer<QVBoxLayout> m_trackScrollBarLayout;
|
||||
QScrollBar* m_trackScrollBar;
|
||||
};
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- Equinor 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
|
||||
|
||||
#include "RiuInterfaceToViewWindow.h"
|
||||
#include "RiuMultiPlotPage.h"
|
||||
|
||||
class RiuQwtPlotWidget;
|
||||
class RimWellLogPlot;
|
||||
|
||||
class RiuWellLogPlot : public RiuMultiPlotPage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
RiuWellLogPlot( RimWellLogPlot* plotDefinition, QWidget* parent );
|
||||
|
||||
RimViewWindow* ownerViewWindow() const override;
|
||||
|
||||
void updateVerticalScrollBar( double minVisible, double maxVisible, double minAvailable, double maxAvailable ) override;
|
||||
void renderTo( QPaintDevice* paintDevice ) override;
|
||||
|
||||
protected:
|
||||
bool showYAxis( int row, int column ) const override;
|
||||
|
||||
void reinsertScrollbar();
|
||||
void alignScrollbar( int offset );
|
||||
|
||||
private:
|
||||
RimWellLogPlot* wellLogPlotDefinition();
|
||||
|
||||
private slots:
|
||||
void slotSetMinDepth( int value );
|
||||
void performUpdate() override;
|
||||
|
||||
private:
|
||||
QPointer<QVBoxLayout> m_trackScrollBarLayout;
|
||||
QScrollBar* m_trackScrollBar;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user