mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Clang-format changed files
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -21,11 +21,11 @@
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimContextCommandBuilder.h"
|
||||
#include "RimTofAccumulatedPhaseFractionsPlot.h"
|
||||
#include "RimTotalWellAllocationPlot.h"
|
||||
#include "RimWellAllocationPlot.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
#include "RimTofAccumulatedPhaseFractionsPlot.h"
|
||||
|
||||
#include "RiuContextMenuLauncher.h"
|
||||
#include "RiuNightchartsWidget.h"
|
||||
@@ -38,126 +38,120 @@
|
||||
#include <QLabel>
|
||||
#include <QMenu>
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuWellAllocationPlot::RiuWellAllocationPlot(RimWellAllocationPlot* plotDefinition, QWidget* parent)
|
||||
: RiuWellLogPlot(plotDefinition, parent)
|
||||
RiuWellAllocationPlot::RiuWellAllocationPlot( RimWellAllocationPlot* plotDefinition, QWidget* parent )
|
||||
: RiuWellLogPlot( plotDefinition, parent )
|
||||
{
|
||||
Q_ASSERT(m_plotDefinition);
|
||||
Q_ASSERT( m_plotDefinition );
|
||||
|
||||
QVBoxLayout* mainLayout = new QVBoxLayout();
|
||||
this->setLayout(mainLayout);
|
||||
this->layout()->setMargin(0);
|
||||
this->layout()->setSpacing(2);
|
||||
this->setLayout( mainLayout );
|
||||
this->layout()->setMargin( 0 );
|
||||
this->layout()->setSpacing( 2 );
|
||||
|
||||
new RiuPlotObjectPicker(m_plotTitle, m_plotDefinition);
|
||||
new RiuPlotObjectPicker( m_plotTitle, m_plotDefinition );
|
||||
|
||||
mainLayout->addWidget(m_plotTitle, 0, Qt::AlignCenter);
|
||||
mainLayout->addWidget( m_plotTitle, 0, Qt::AlignCenter );
|
||||
|
||||
auto plotWidgetsLayout = new QHBoxLayout();
|
||||
auto rightColumnLayout = new QVBoxLayout();
|
||||
|
||||
mainLayout->addLayout(plotWidgetsLayout);
|
||||
plotWidgetsLayout->addLayout(rightColumnLayout);
|
||||
|
||||
m_legendWidget = new RiuNightchartsWidget(this);
|
||||
RimWellAllocationPlot* wellAllocationPlot = dynamic_cast<RimWellAllocationPlot*>(m_plotDefinition.p());
|
||||
new RiuPlotObjectPicker(m_legendWidget, wellAllocationPlot->plotLegend());
|
||||
mainLayout->addLayout( plotWidgetsLayout );
|
||||
plotWidgetsLayout->addLayout( rightColumnLayout );
|
||||
|
||||
m_legendWidget = new RiuNightchartsWidget( this );
|
||||
RimWellAllocationPlot* wellAllocationPlot = dynamic_cast<RimWellAllocationPlot*>( m_plotDefinition.p() );
|
||||
new RiuPlotObjectPicker( m_legendWidget, wellAllocationPlot->plotLegend() );
|
||||
|
||||
caf::CmdFeatureMenuBuilder menuBuilder;
|
||||
menuBuilder << "RicShowTotalAllocationDataFeature";
|
||||
new RiuContextMenuLauncher(m_legendWidget, menuBuilder);
|
||||
new RiuContextMenuLauncher( m_legendWidget, menuBuilder );
|
||||
|
||||
rightColumnLayout->addWidget(m_legendWidget);
|
||||
m_legendWidget->showPie(false);
|
||||
rightColumnLayout->addWidget( m_legendWidget );
|
||||
m_legendWidget->showPie( false );
|
||||
|
||||
QWidget* totalFlowAllocationWidget = wellAllocationPlot->totalWellFlowPlot()->createViewWidget(this);
|
||||
new RiuPlotObjectPicker(totalFlowAllocationWidget, wellAllocationPlot->totalWellFlowPlot());
|
||||
new RiuContextMenuLauncher(totalFlowAllocationWidget, menuBuilder);
|
||||
QWidget* totalFlowAllocationWidget = wellAllocationPlot->totalWellFlowPlot()->createViewWidget( this );
|
||||
new RiuPlotObjectPicker( totalFlowAllocationWidget, wellAllocationPlot->totalWellFlowPlot() );
|
||||
new RiuContextMenuLauncher( totalFlowAllocationWidget, menuBuilder );
|
||||
|
||||
rightColumnLayout->addWidget(totalFlowAllocationWidget, Qt::AlignTop);
|
||||
rightColumnLayout->addWidget(wellAllocationPlot->tofAccumulatedPhaseFractionsPlot()->createViewWidget(this), Qt::AlignTop);
|
||||
rightColumnLayout->addWidget( totalFlowAllocationWidget, Qt::AlignTop );
|
||||
rightColumnLayout->addWidget( wellAllocationPlot->tofAccumulatedPhaseFractionsPlot()->createViewWidget( this ),
|
||||
Qt::AlignTop );
|
||||
rightColumnLayout->addStretch();
|
||||
|
||||
QWidget* wellFlowWidget = m_plotDefinition->createPlotWidget();
|
||||
|
||||
plotWidgetsLayout->addWidget(wellFlowWidget);
|
||||
plotWidgetsLayout->addWidget( wellFlowWidget );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuWellAllocationPlot::~RiuWellAllocationPlot()
|
||||
{
|
||||
}
|
||||
RiuWellAllocationPlot::~RiuWellAllocationPlot() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::showLegend(bool doShow)
|
||||
void RiuWellAllocationPlot::showLegend( bool doShow )
|
||||
{
|
||||
if (doShow)
|
||||
if ( doShow )
|
||||
m_legendWidget->show();
|
||||
else
|
||||
m_legendWidget->hide();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::addLegendItem(const QString& name, const cvf::Color3f& color, float value)
|
||||
void RiuWellAllocationPlot::addLegendItem( const QString& name, const cvf::Color3f& color, float value )
|
||||
{
|
||||
QColor sliceColor(color.rByte(), color.gByte(), color.bByte());
|
||||
QColor sliceColor( color.rByte(), color.gByte(), color.bByte() );
|
||||
|
||||
m_legendWidget->addItem(name, sliceColor, value);
|
||||
m_legendWidget->addItem( name, sliceColor, value );
|
||||
m_legendWidget->updateGeometry();
|
||||
m_legendWidget->update();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::clearLegend()
|
||||
{
|
||||
m_legendWidget->clear();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QSize RiuWellAllocationPlot::minimumSizeHint() const
|
||||
{
|
||||
return QSize(0, 100);
|
||||
return QSize( 0, 100 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::contextMenuEvent(QContextMenuEvent* event)
|
||||
void RiuWellAllocationPlot::contextMenuEvent( QContextMenuEvent* event )
|
||||
{
|
||||
QMenu menu;
|
||||
QMenu menu;
|
||||
caf::CmdFeatureMenuBuilder menuBuilder;
|
||||
|
||||
menuBuilder << "RicShowContributingWellsFromPlotFeature";
|
||||
|
||||
menuBuilder.appendToMenu(&menu);
|
||||
menuBuilder.appendToMenu( &menu );
|
||||
|
||||
if (menu.actions().size() > 0)
|
||||
if ( menu.actions().size() > 0 )
|
||||
{
|
||||
menu.exec(event->globalPos());
|
||||
menu.exec( event->globalPos() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QSize RiuWellAllocationPlot::sizeHint() const
|
||||
{
|
||||
return QSize(0, 0);
|
||||
return QSize( 0, 0 );
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -24,16 +24,17 @@
|
||||
|
||||
#include "qwt_plot.h"
|
||||
|
||||
#include <QPointer>
|
||||
#include <QFrame>
|
||||
#include <QPointer>
|
||||
|
||||
class RimWellAllocationPlot;
|
||||
class RiuNightchartsWidget;
|
||||
|
||||
class QLabel;
|
||||
|
||||
namespace cvf {
|
||||
class Color3f;
|
||||
namespace cvf
|
||||
{
|
||||
class Color3f;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
@@ -44,19 +45,20 @@ namespace cvf {
|
||||
class RiuWellAllocationPlot : public RiuWellLogPlot
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
RiuWellAllocationPlot(RimWellAllocationPlot* plotDefinition, QWidget* parent = nullptr);
|
||||
RiuWellAllocationPlot( RimWellAllocationPlot* plotDefinition, QWidget* parent = nullptr );
|
||||
~RiuWellAllocationPlot() override;
|
||||
|
||||
void showLegend(bool doShow);
|
||||
void addLegendItem(const QString& name, const cvf::Color3f& color, float value);
|
||||
void clearLegend();
|
||||
void showLegend( bool doShow );
|
||||
void addLegendItem( const QString& name, const cvf::Color3f& color, float value );
|
||||
void clearLegend();
|
||||
|
||||
protected:
|
||||
QSize sizeHint() const override;
|
||||
QSize minimumSizeHint() const override;
|
||||
QSize sizeHint() const override;
|
||||
QSize minimumSizeHint() const override;
|
||||
|
||||
void contextMenuEvent(QContextMenuEvent *) override;
|
||||
void contextMenuEvent( QContextMenuEvent* ) override;
|
||||
|
||||
private:
|
||||
QPointer<RiuNightchartsWidget> m_legendWidget;
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
//
|
||||
// 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -30,8 +30,8 @@
|
||||
#include "RiuPlotObjectPicker.h"
|
||||
#include "RiuWellLogTrack.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafCmdFeatureMenuBuilder.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
@@ -48,92 +48,97 @@
|
||||
#include <cmath>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuWellLogPlot::RiuWellLogPlot(RimWellLogPlot* plotDefinition, QWidget* parent)
|
||||
: QWidget(parent), m_scheduleUpdateChildrenLayoutTimer(nullptr)
|
||||
RiuWellLogPlot::RiuWellLogPlot( RimWellLogPlot* plotDefinition, QWidget* parent )
|
||||
: QWidget( parent )
|
||||
, m_scheduleUpdateChildrenLayoutTimer( nullptr )
|
||||
{
|
||||
Q_ASSERT(plotDefinition);
|
||||
Q_ASSERT( plotDefinition );
|
||||
m_plotDefinition = plotDefinition;
|
||||
|
||||
QPalette newPalette(palette());
|
||||
newPalette.setColor(QPalette::Background, Qt::white);
|
||||
setPalette(newPalette);
|
||||
QPalette newPalette( palette() );
|
||||
newPalette.setColor( QPalette::Background, Qt::white );
|
||||
setPalette( newPalette );
|
||||
|
||||
setAutoFillBackground(true);
|
||||
setAutoFillBackground( true );
|
||||
|
||||
m_plotTitle = new QLabel("PLOT TITLE HERE", this);
|
||||
QFont font = m_plotTitle->font();
|
||||
font.setPointSize(14);
|
||||
font.setBold(true);
|
||||
m_plotTitle->setFont(font);
|
||||
m_plotTitle = new QLabel( "PLOT TITLE HERE", this );
|
||||
QFont font = m_plotTitle->font();
|
||||
font.setPointSize( 14 );
|
||||
font.setBold( true );
|
||||
m_plotTitle->setFont( font );
|
||||
m_plotTitle->hide();
|
||||
m_scrollBar = new QScrollBar(this);
|
||||
m_scrollBar->setOrientation(Qt::Vertical);
|
||||
m_scrollBar->setVisible(true);
|
||||
m_scrollBar = new QScrollBar( this );
|
||||
m_scrollBar->setOrientation( Qt::Vertical );
|
||||
m_scrollBar->setVisible( true );
|
||||
|
||||
new RiuPlotObjectPicker(m_plotTitle, m_plotDefinition);
|
||||
new RiuPlotObjectPicker( m_plotTitle, m_plotDefinition );
|
||||
|
||||
this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
connect(m_scrollBar, SIGNAL(valueChanged(int)), this, SLOT(slotSetMinDepth(int)));
|
||||
this->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );
|
||||
|
||||
setFocusPolicy( Qt::StrongFocus );
|
||||
connect( m_scrollBar, SIGNAL( valueChanged( int ) ), this, SLOT( slotSetMinDepth( int ) ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuWellLogPlot::~RiuWellLogPlot()
|
||||
{
|
||||
if (m_plotDefinition)
|
||||
if ( m_plotDefinition )
|
||||
{
|
||||
m_plotDefinition->detachAllCurves();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::addTrackPlot(RiuWellLogTrack* trackPlot)
|
||||
void RiuWellLogPlot::addTrackPlot( RiuWellLogTrack* trackPlot )
|
||||
{
|
||||
// Insert the plot to the left of the scroll bar
|
||||
insertTrackPlot(trackPlot, m_trackPlots.size());
|
||||
insertTrackPlot( trackPlot, m_trackPlots.size() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::insertTrackPlot(RiuWellLogTrack* trackPlot, size_t index)
|
||||
void RiuWellLogPlot::insertTrackPlot( RiuWellLogTrack* trackPlot, size_t index )
|
||||
{
|
||||
trackPlot->setParent(this);
|
||||
|
||||
m_trackPlots.insert(static_cast<int>(index), trackPlot);
|
||||
trackPlot->setParent( this );
|
||||
|
||||
QwtLegend* legend = new QwtLegend(this);
|
||||
int legendColumns = 1;
|
||||
if (m_plotDefinition->areTrackLegendsHorizontal())
|
||||
m_trackPlots.insert( static_cast<int>( index ), trackPlot );
|
||||
|
||||
QwtLegend* legend = new QwtLegend( this );
|
||||
int legendColumns = 1;
|
||||
if ( m_plotDefinition->areTrackLegendsHorizontal() )
|
||||
{
|
||||
legendColumns = 0; // unlimited
|
||||
}
|
||||
legend->setMaxColumns(legendColumns);
|
||||
|
||||
legend->horizontalScrollBar()->setVisible(false);
|
||||
legend->verticalScrollBar()->setVisible(false);
|
||||
legend->setMaxColumns( legendColumns );
|
||||
|
||||
legend->connect(trackPlot, SIGNAL(legendDataChanged(const QVariant &, const QList< QwtLegendData > &)), SLOT(updateLegend(const QVariant &, const QList< QwtLegendData > &)));
|
||||
legend->contentsWidget()->layout()->setAlignment(Qt::AlignBottom | Qt::AlignHCenter);
|
||||
m_legends.insert(static_cast<int>(index), legend);
|
||||
|
||||
this->connect(trackPlot, SIGNAL(legendDataChanged(const QVariant &, const QList< QwtLegendData > &)), SLOT(scheduleUpdateChildrenLayout()));
|
||||
legend->horizontalScrollBar()->setVisible( false );
|
||||
legend->verticalScrollBar()->setVisible( false );
|
||||
|
||||
if (!m_plotDefinition->areTrackLegendsVisible())
|
||||
legend->connect( trackPlot,
|
||||
SIGNAL( legendDataChanged( const QVariant&, const QList<QwtLegendData>& ) ),
|
||||
SLOT( updateLegend( const QVariant&, const QList<QwtLegendData>& ) ) );
|
||||
legend->contentsWidget()->layout()->setAlignment( Qt::AlignBottom | Qt::AlignHCenter );
|
||||
m_legends.insert( static_cast<int>( index ), legend );
|
||||
|
||||
this->connect( trackPlot,
|
||||
SIGNAL( legendDataChanged( const QVariant&, const QList<QwtLegendData>& ) ),
|
||||
SLOT( scheduleUpdateChildrenLayout() ) );
|
||||
|
||||
if ( !m_plotDefinition->areTrackLegendsVisible() )
|
||||
{
|
||||
legend->hide();
|
||||
}
|
||||
|
||||
trackPlot->updateLegend();
|
||||
|
||||
if (trackPlot->isRimTrackVisible())
|
||||
if ( trackPlot->isRimTrackVisible() )
|
||||
{
|
||||
trackPlot->show();
|
||||
}
|
||||
@@ -144,67 +149,67 @@ void RiuWellLogPlot::insertTrackPlot(RiuWellLogTrack* trackPlot, size_t index)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::removeTrackPlot(RiuWellLogTrack* trackPlot)
|
||||
void RiuWellLogPlot::removeTrackPlot( RiuWellLogTrack* trackPlot )
|
||||
{
|
||||
if (!trackPlot) return;
|
||||
if ( !trackPlot ) return;
|
||||
|
||||
int trackIdx = m_trackPlots.indexOf(trackPlot);
|
||||
CVF_ASSERT(trackIdx >= 0);
|
||||
int trackIdx = m_trackPlots.indexOf( trackPlot );
|
||||
CVF_ASSERT( trackIdx >= 0 );
|
||||
|
||||
m_trackPlots.removeAt(trackIdx);
|
||||
trackPlot->setParent(nullptr);
|
||||
m_trackPlots.removeAt( trackIdx );
|
||||
trackPlot->setParent( nullptr );
|
||||
|
||||
QwtLegend* legend = m_legends[trackIdx];
|
||||
m_legends.removeAt(trackIdx);
|
||||
m_legends.removeAt( trackIdx );
|
||||
delete legend;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::setDepthZoomAndReplot(double minDepth, double maxDepth)
|
||||
{
|
||||
for (int tpIdx = 0; tpIdx < m_trackPlots.count(); tpIdx++)
|
||||
{
|
||||
m_trackPlots[tpIdx]->setDepthZoom(minDepth, maxDepth);
|
||||
m_trackPlots[tpIdx]->replot();
|
||||
}
|
||||
|
||||
updateScrollBar(minDepth, maxDepth);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::setPlotTitle(const QString& plotTitle)
|
||||
void RiuWellLogPlot::setDepthZoomAndReplot( double minDepth, double maxDepth )
|
||||
{
|
||||
m_plotTitle->setText(plotTitle);
|
||||
for ( int tpIdx = 0; tpIdx < m_trackPlots.count(); tpIdx++ )
|
||||
{
|
||||
m_trackPlots[tpIdx]->setDepthZoom( minDepth, maxDepth );
|
||||
m_trackPlots[tpIdx]->replot();
|
||||
}
|
||||
|
||||
updateScrollBar( minDepth, maxDepth );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::setPlotTitle( const QString& plotTitle )
|
||||
{
|
||||
m_plotTitle->setText( plotTitle );
|
||||
this->updateChildrenLayout();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QSize RiuWellLogPlot::preferredSize() const
|
||||
{
|
||||
int titleWidth = 0;
|
||||
int titleHeight = 0;
|
||||
if (m_plotTitle && m_plotTitle->isVisible())
|
||||
if ( m_plotTitle && m_plotTitle->isVisible() )
|
||||
{
|
||||
titleWidth = m_plotTitle->width();
|
||||
titleHeight = m_plotTitle->height() + 10;
|
||||
}
|
||||
|
||||
int sumTrackWidth = 0;
|
||||
int sumTrackWidth = 0;
|
||||
int maxTrackHeight = 0;
|
||||
for (QPointer<RiuWellLogTrack> track : m_trackPlots)
|
||||
for ( QPointer<RiuWellLogTrack> track : m_trackPlots )
|
||||
{
|
||||
sumTrackWidth += track->width();
|
||||
maxTrackHeight = std::max(maxTrackHeight, track->height());
|
||||
maxTrackHeight = std::max( maxTrackHeight, track->height() );
|
||||
}
|
||||
return QSize(std::max(titleWidth, sumTrackWidth), titleHeight + maxTrackHeight);
|
||||
return QSize( std::max( titleWidth, sumTrackWidth ), titleHeight + maxTrackHeight );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -224,23 +229,23 @@ void RiuWellLogPlot::hideTitle()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::contextMenuEvent(QContextMenuEvent* event)
|
||||
void RiuWellLogPlot::contextMenuEvent( QContextMenuEvent* event )
|
||||
{
|
||||
QMenu menu;
|
||||
QMenu menu;
|
||||
caf::CmdFeatureMenuBuilder menuBuilder;
|
||||
|
||||
caf::SelectionManager::instance()->setSelectedItem(ownerPlotDefinition());
|
||||
caf::SelectionManager::instance()->setSelectedItem( ownerPlotDefinition() );
|
||||
|
||||
menuBuilder << "RicShowPlotDataFeature";
|
||||
menuBuilder << "RicShowContributingWellsFromPlotFeature";
|
||||
|
||||
menuBuilder.appendToMenu(&menu);
|
||||
menuBuilder.appendToMenu( &menu );
|
||||
|
||||
if (menu.actions().size() > 0)
|
||||
if ( menu.actions().size() > 0 )
|
||||
{
|
||||
menu.exec(event->globalPos());
|
||||
menu.exec( event->globalPos() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,56 +254,56 @@ void RiuWellLogPlot::contextMenuEvent(QContextMenuEvent* event)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QSize RiuWellLogPlot::sizeHint() const
|
||||
{
|
||||
return QSize(1, 1);
|
||||
return QSize( 1, 1 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::keyPressEvent(QKeyEvent* keyEvent)
|
||||
void RiuWellLogPlot::keyPressEvent( QKeyEvent* keyEvent )
|
||||
{
|
||||
m_plotDefinition->handleKeyPressEvent(keyEvent);
|
||||
m_plotDefinition->handleKeyPressEvent( keyEvent );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::updateScrollBar(double minDepth, double maxDepth)
|
||||
void RiuWellLogPlot::updateScrollBar( double minDepth, double maxDepth )
|
||||
{
|
||||
double availableMinDepth;
|
||||
double availableMaxDepth;
|
||||
m_plotDefinition->availableDepthRange(&availableMinDepth, &availableMaxDepth);
|
||||
availableMaxDepth += 0.01*(availableMaxDepth-availableMinDepth);
|
||||
m_plotDefinition->availableDepthRange( &availableMinDepth, &availableMaxDepth );
|
||||
availableMaxDepth += 0.01 * ( availableMaxDepth - availableMinDepth );
|
||||
|
||||
double visibleDepth = maxDepth - minDepth;
|
||||
|
||||
m_scrollBar->blockSignals(true);
|
||||
m_scrollBar->blockSignals( true );
|
||||
{
|
||||
m_scrollBar->setRange((int) availableMinDepth, (int) ((availableMaxDepth - visibleDepth)));
|
||||
m_scrollBar->setPageStep((int) visibleDepth);
|
||||
m_scrollBar->setValue((int) minDepth);
|
||||
m_scrollBar->setRange( (int)availableMinDepth, (int)( ( availableMaxDepth - visibleDepth ) ) );
|
||||
m_scrollBar->setPageStep( (int)visibleDepth );
|
||||
m_scrollBar->setValue( (int)minDepth );
|
||||
|
||||
m_scrollBar->setVisible(true);
|
||||
m_scrollBar->setVisible( true );
|
||||
}
|
||||
m_scrollBar->blockSignals(false);
|
||||
m_scrollBar->blockSignals( false );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::slotSetMinDepth(int value)
|
||||
void RiuWellLogPlot::slotSetMinDepth( int value )
|
||||
{
|
||||
double minimumDepth;
|
||||
double maximumDepth;
|
||||
m_plotDefinition->depthZoomMinMax(&minimumDepth, &maximumDepth);
|
||||
m_plotDefinition->depthZoomMinMax( &minimumDepth, &maximumDepth );
|
||||
|
||||
double delta = value - minimumDepth;
|
||||
m_plotDefinition->setDepthZoomMinMax(minimumDepth + delta, maximumDepth + delta);
|
||||
m_plotDefinition->setDepthAutoZoom(false);
|
||||
m_plotDefinition->setDepthZoomMinMax( minimumDepth + delta, maximumDepth + delta );
|
||||
m_plotDefinition->setDepthAutoZoom( false );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellLogPlot* RiuWellLogPlot::ownerPlotDefinition()
|
||||
{
|
||||
@@ -306,7 +311,7 @@ RimWellLogPlot* RiuWellLogPlot::ownerPlotDefinition()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewWindow* RiuWellLogPlot::ownerViewWindow() const
|
||||
{
|
||||
@@ -314,77 +319,77 @@ RimViewWindow* RiuWellLogPlot::ownerViewWindow() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::resizeEvent(QResizeEvent *event)
|
||||
void RiuWellLogPlot::resizeEvent( QResizeEvent* event )
|
||||
{
|
||||
int height = event->size().height();
|
||||
int width = event->size().width();
|
||||
|
||||
placeChildWidgets(height, width);
|
||||
QWidget::resizeEvent(event);
|
||||
placeChildWidgets( height, width );
|
||||
QWidget::resizeEvent( event );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<int, int> RiuWellLogPlot::calculateTrackWidthsToMatchFrame(int frameWidth) const
|
||||
std::map<int, int> RiuWellLogPlot::calculateTrackWidthsToMatchFrame( int frameWidth ) const
|
||||
{
|
||||
int trackCount = m_trackPlots.size();
|
||||
|
||||
int visibleTrackCount = 0;
|
||||
|
||||
int visibleTrackCount = 0;
|
||||
int firstTrackAxisOffset = 0; // Account for first track having the y-axis labels and markers
|
||||
for (int tIdx = 0; tIdx < trackCount; ++tIdx)
|
||||
for ( int tIdx = 0; tIdx < trackCount; ++tIdx )
|
||||
{
|
||||
if (m_trackPlots[tIdx]->isVisible())
|
||||
if ( m_trackPlots[tIdx]->isVisible() )
|
||||
{
|
||||
if (visibleTrackCount == 0)
|
||||
if ( visibleTrackCount == 0 )
|
||||
{
|
||||
firstTrackAxisOffset = static_cast<int>(m_trackPlots[tIdx]->plotLayout()->canvasRect().left());
|
||||
firstTrackAxisOffset = static_cast<int>( m_trackPlots[tIdx]->plotLayout()->canvasRect().left() );
|
||||
}
|
||||
else if (visibleTrackCount == 1)
|
||||
else if ( visibleTrackCount == 1 )
|
||||
{
|
||||
// The others axes also have markers, and so we need to subtract for this to get the shift due to labels and title
|
||||
int otherTrackAxisOffset = static_cast<int>(m_trackPlots[tIdx]->plotLayout()->canvasRect().left());
|
||||
int otherTrackAxisOffset = static_cast<int>( m_trackPlots[tIdx]->plotLayout()->canvasRect().left() );
|
||||
firstTrackAxisOffset -= otherTrackAxisOffset;
|
||||
}
|
||||
++visibleTrackCount;
|
||||
++visibleTrackCount;
|
||||
}
|
||||
}
|
||||
|
||||
int scrollBarWidth = 0;
|
||||
if (m_scrollBar->isVisible()) scrollBarWidth = m_scrollBar->sizeHint().width();
|
||||
|
||||
if ( m_scrollBar->isVisible() ) scrollBarWidth = m_scrollBar->sizeHint().width();
|
||||
|
||||
std::map<int, int> trackWidths;
|
||||
|
||||
if (visibleTrackCount)
|
||||
if ( visibleTrackCount )
|
||||
{
|
||||
int totalTrackWidth = (frameWidth - firstTrackAxisOffset - scrollBarWidth);
|
||||
int trackWidthExtra = (frameWidth - firstTrackAxisOffset - scrollBarWidth) % visibleTrackCount;
|
||||
int totalTrackWidth = ( frameWidth - firstTrackAxisOffset - scrollBarWidth );
|
||||
int trackWidthExtra = ( frameWidth - firstTrackAxisOffset - scrollBarWidth ) % visibleTrackCount;
|
||||
|
||||
int totalWidthWeights = 0;
|
||||
for (int tIdx = 0; tIdx < trackCount; ++tIdx)
|
||||
for ( int tIdx = 0; tIdx < trackCount; ++tIdx )
|
||||
{
|
||||
if (m_trackPlots[tIdx]->isVisible())
|
||||
if ( m_trackPlots[tIdx]->isVisible() )
|
||||
{
|
||||
totalWidthWeights += m_trackPlots[tIdx]->widthScaleFactor();
|
||||
}
|
||||
}
|
||||
|
||||
bool firstVisible = true;
|
||||
for (int tIdx = 0; tIdx < trackCount; ++tIdx)
|
||||
for ( int tIdx = 0; tIdx < trackCount; ++tIdx )
|
||||
{
|
||||
if (m_trackPlots[tIdx]->isVisible())
|
||||
if ( m_trackPlots[tIdx]->isVisible() )
|
||||
{
|
||||
int realTrackWidth = (totalTrackWidth * m_trackPlots[tIdx]->widthScaleFactor()) / totalWidthWeights;
|
||||
|
||||
if (firstVisible)
|
||||
int realTrackWidth = ( totalTrackWidth * m_trackPlots[tIdx]->widthScaleFactor() ) / totalWidthWeights;
|
||||
|
||||
if ( firstVisible )
|
||||
{
|
||||
realTrackWidth += firstTrackAxisOffset;
|
||||
firstVisible = false;
|
||||
}
|
||||
|
||||
if (trackWidthExtra > 0)
|
||||
if ( trackWidthExtra > 0 )
|
||||
{
|
||||
realTrackWidth += 1;
|
||||
--trackWidthExtra;
|
||||
@@ -399,100 +404,104 @@ std::map<int, int> RiuWellLogPlot::calculateTrackWidthsToMatchFrame(int frameWid
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::placeChildWidgets(int frameHeight, int frameWidth)
|
||||
void RiuWellLogPlot::placeChildWidgets( int frameHeight, int frameWidth )
|
||||
{
|
||||
CVF_ASSERT(m_legends.size() == m_trackPlots.size());
|
||||
CVF_ASSERT( m_legends.size() == m_trackPlots.size() );
|
||||
|
||||
positionTitle(frameWidth);
|
||||
positionTitle( frameWidth );
|
||||
|
||||
const int trackPadding = 2;
|
||||
|
||||
std::map<int, int> trackWidths = calculateTrackWidthsToMatchFrame(frameWidth);
|
||||
size_t visibleTrackCount = trackWidths.size();
|
||||
std::map<int, int> trackWidths = calculateTrackWidthsToMatchFrame( frameWidth );
|
||||
size_t visibleTrackCount = trackWidths.size();
|
||||
|
||||
int maxLegendHeight = 0;
|
||||
|
||||
if (m_plotDefinition && m_plotDefinition->areTrackLegendsVisible())
|
||||
if ( m_plotDefinition && m_plotDefinition->areTrackLegendsVisible() )
|
||||
{
|
||||
for ( int tIdx = 0; tIdx < m_trackPlots.size(); ++tIdx )
|
||||
{
|
||||
if ( m_trackPlots[tIdx]->isVisible() )
|
||||
{
|
||||
int legendHeight = m_legends[tIdx]->heightForWidth(trackWidths[tIdx] - 2 * trackPadding);
|
||||
int legendHeight = m_legends[tIdx]->heightForWidth( trackWidths[tIdx] - 2 * trackPadding );
|
||||
if ( legendHeight > maxLegendHeight ) maxLegendHeight = legendHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int titleHeight = 0;
|
||||
if (m_plotTitle && m_plotTitle->isVisible())
|
||||
if ( m_plotTitle && m_plotTitle->isVisible() )
|
||||
{
|
||||
titleHeight = m_plotTitle->height() + 2;
|
||||
}
|
||||
|
||||
int trackHeight = frameHeight - maxLegendHeight - titleHeight;
|
||||
int trackX = 0;
|
||||
int trackX = 0;
|
||||
|
||||
if (visibleTrackCount)
|
||||
if ( visibleTrackCount )
|
||||
{
|
||||
|
||||
int maxCanvasOffset = 0;
|
||||
for (int tIdx = 0; tIdx < m_trackPlots.size(); ++tIdx)
|
||||
for ( int tIdx = 0; tIdx < m_trackPlots.size(); ++tIdx )
|
||||
{
|
||||
if (m_trackPlots[tIdx]->isVisible())
|
||||
if ( m_trackPlots[tIdx]->isVisible() )
|
||||
{
|
||||
// Hack to align QWT plots. See below.
|
||||
QRectF canvasRect = m_trackPlots[tIdx]->plotLayout()->canvasRect();
|
||||
maxCanvasOffset = std::max(maxCanvasOffset, static_cast<int>(canvasRect.top()));
|
||||
maxCanvasOffset = std::max( maxCanvasOffset, static_cast<int>( canvasRect.top() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (int tIdx = 0; tIdx < m_trackPlots.size(); ++tIdx)
|
||||
for ( int tIdx = 0; tIdx < m_trackPlots.size(); ++tIdx )
|
||||
{
|
||||
if (m_trackPlots[tIdx]->isVisible())
|
||||
if ( m_trackPlots[tIdx]->isVisible() )
|
||||
{
|
||||
int adjustedVerticalPosition = titleHeight + maxLegendHeight + 10;
|
||||
int adjustedTrackHeight = trackHeight;
|
||||
int adjustedTrackHeight = trackHeight;
|
||||
{
|
||||
// Hack to align QWT plots which doesn't have an x-axis with the other tracks.
|
||||
// Since they are missing the axis, QWT will shift them upwards.
|
||||
// So we shift the plot downwards and resize to match the others.
|
||||
// TODO: Look into subclassing QwtPlotLayout instead.
|
||||
QRectF canvasRect = m_trackPlots[tIdx]->plotLayout()->canvasRect();
|
||||
int myCanvasOffset = static_cast<int>(canvasRect.top());
|
||||
int myMargins = m_trackPlots[tIdx]->plotLayout()->canvasMargin(QwtPlot::xTop);
|
||||
int canvasShift = std::max(0, maxCanvasOffset - myCanvasOffset);
|
||||
QRectF canvasRect = m_trackPlots[tIdx]->plotLayout()->canvasRect();
|
||||
int myCanvasOffset = static_cast<int>( canvasRect.top() );
|
||||
int myMargins = m_trackPlots[tIdx]->plotLayout()->canvasMargin( QwtPlot::xTop );
|
||||
int canvasShift = std::max( 0, maxCanvasOffset - myCanvasOffset );
|
||||
adjustedVerticalPosition += canvasShift - myMargins;
|
||||
adjustedTrackHeight -= canvasShift;
|
||||
}
|
||||
|
||||
int realTrackWidth = trackWidths[tIdx];
|
||||
m_legends[tIdx]->setGeometry(trackX + trackPadding, titleHeight, realTrackWidth - 2 * trackPadding, maxLegendHeight);
|
||||
m_trackPlots[tIdx]->setGeometry(trackX + trackPadding, adjustedVerticalPosition, realTrackWidth - 2 * trackPadding, adjustedTrackHeight);
|
||||
m_legends[tIdx]->setGeometry( trackX + trackPadding,
|
||||
titleHeight,
|
||||
realTrackWidth - 2 * trackPadding,
|
||||
maxLegendHeight );
|
||||
m_trackPlots[tIdx]->setGeometry( trackX + trackPadding,
|
||||
adjustedVerticalPosition,
|
||||
realTrackWidth - 2 * trackPadding,
|
||||
adjustedTrackHeight );
|
||||
|
||||
trackX += realTrackWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_scrollBar->isVisible())
|
||||
if ( m_scrollBar->isVisible() )
|
||||
{
|
||||
m_scrollBar->setGeometry(trackX, titleHeight + maxLegendHeight, m_scrollBar->sizeHint().width(), trackHeight);
|
||||
m_scrollBar->setGeometry( trackX, titleHeight + maxLegendHeight, m_scrollBar->sizeHint().width(), trackHeight );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::positionTitle(int frameWidth)
|
||||
void RiuWellLogPlot::positionTitle( int frameWidth )
|
||||
{
|
||||
if (m_plotDefinition && m_plotDefinition->isPlotTitleVisible())
|
||||
if ( m_plotDefinition && m_plotDefinition->isPlotTitleVisible() )
|
||||
{
|
||||
int textWidth = m_plotTitle->sizeHint().width();
|
||||
m_plotTitle->setGeometry(frameWidth/2 - textWidth/2, 0, textWidth, m_plotTitle->sizeHint().height());
|
||||
m_plotTitle->setGeometry( frameWidth / 2 - textWidth / 2, 0, textWidth, m_plotTitle->sizeHint().height() );
|
||||
m_plotTitle->show();
|
||||
}
|
||||
else
|
||||
@@ -502,25 +511,25 @@ void RiuWellLogPlot::positionTitle(int frameWidth)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::updateChildrenLayout()
|
||||
{
|
||||
int trackCount = m_trackPlots.size();
|
||||
{
|
||||
int trackCount = m_trackPlots.size();
|
||||
int numTracksAlreadyShown = 0;
|
||||
for (int tIdx = 0; tIdx < trackCount; ++tIdx)
|
||||
for ( int tIdx = 0; tIdx < trackCount; ++tIdx )
|
||||
{
|
||||
if (m_trackPlots[tIdx]->isVisible())
|
||||
if ( m_trackPlots[tIdx]->isVisible() )
|
||||
{
|
||||
int legendColumns = 1;
|
||||
if (m_plotDefinition->areTrackLegendsHorizontal())
|
||||
if ( m_plotDefinition->areTrackLegendsHorizontal() )
|
||||
{
|
||||
legendColumns = 0; // unlimited
|
||||
}
|
||||
m_legends[tIdx]->setMaxColumns(legendColumns);
|
||||
m_legends[tIdx]->setMaxColumns( legendColumns );
|
||||
m_legends[tIdx]->show();
|
||||
|
||||
m_trackPlots[tIdx]->enableDepthAxisLabelsAndTitle(numTracksAlreadyShown == 0);
|
||||
m_trackPlots[tIdx]->enableDepthAxisLabelsAndTitle( numTracksAlreadyShown == 0 );
|
||||
numTracksAlreadyShown++;
|
||||
}
|
||||
else
|
||||
@@ -529,23 +538,23 @@ void RiuWellLogPlot::updateChildrenLayout()
|
||||
}
|
||||
}
|
||||
|
||||
placeChildWidgets(this->height(), this->width());
|
||||
placeChildWidgets( this->height(), this->width() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::showEvent(QShowEvent *)
|
||||
void RiuWellLogPlot::showEvent( QShowEvent* )
|
||||
{
|
||||
updateChildrenLayout();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::changeEvent(QEvent *event)
|
||||
void RiuWellLogPlot::changeEvent( QEvent* event )
|
||||
{
|
||||
if (event->type() == QEvent::WindowStateChange)
|
||||
if ( event->type() == QEvent::WindowStateChange )
|
||||
{
|
||||
updateChildrenLayout();
|
||||
}
|
||||
@@ -558,15 +567,15 @@ void RiuWellLogPlot::changeEvent(QEvent *event)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogPlot::scheduleUpdateChildrenLayout()
|
||||
{
|
||||
if (!m_scheduleUpdateChildrenLayoutTimer)
|
||||
if ( !m_scheduleUpdateChildrenLayoutTimer )
|
||||
{
|
||||
m_scheduleUpdateChildrenLayoutTimer = new QTimer(this);
|
||||
connect(m_scheduleUpdateChildrenLayoutTimer, SIGNAL(timeout()), this, SLOT(updateChildrenLayout()));
|
||||
m_scheduleUpdateChildrenLayoutTimer = new QTimer( this );
|
||||
connect( m_scheduleUpdateChildrenLayoutTimer, SIGNAL( timeout() ), this, SLOT( updateChildrenLayout() ) );
|
||||
}
|
||||
|
||||
if (!m_scheduleUpdateChildrenLayoutTimer->isActive())
|
||||
if ( !m_scheduleUpdateChildrenLayoutTimer->isActive() )
|
||||
{
|
||||
m_scheduleUpdateChildrenLayoutTimer->setSingleShot(true);
|
||||
m_scheduleUpdateChildrenLayoutTimer->start(100);
|
||||
m_scheduleUpdateChildrenLayoutTimer->setSingleShot( true );
|
||||
m_scheduleUpdateChildrenLayoutTimer->start( 100 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
//
|
||||
// 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -47,45 +47,44 @@ class RiuWellLogPlot : public QWidget, public RiuInterfaceToViewWindow
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RiuWellLogPlot(RimWellLogPlot* plotDefinition, QWidget* parent = nullptr);
|
||||
RiuWellLogPlot( RimWellLogPlot* plotDefinition, QWidget* parent = nullptr );
|
||||
~RiuWellLogPlot() override;
|
||||
|
||||
RimWellLogPlot* ownerPlotDefinition();
|
||||
RimViewWindow* ownerViewWindow() const override;
|
||||
RimWellLogPlot* ownerPlotDefinition();
|
||||
RimViewWindow* ownerViewWindow() const override;
|
||||
|
||||
void addTrackPlot(RiuWellLogTrack* trackPlot);
|
||||
void insertTrackPlot(RiuWellLogTrack* trackPlot, size_t index);
|
||||
void removeTrackPlot(RiuWellLogTrack* trackPlot);
|
||||
void addTrackPlot( RiuWellLogTrack* trackPlot );
|
||||
void insertTrackPlot( RiuWellLogTrack* trackPlot, size_t index );
|
||||
void removeTrackPlot( RiuWellLogTrack* trackPlot );
|
||||
|
||||
void setDepthZoomAndReplot(double minDepth, double maxDepth);
|
||||
void setPlotTitle(const QString& plotTitle);
|
||||
virtual QSize preferredSize() const;
|
||||
void setDepthZoomAndReplot( double minDepth, double maxDepth );
|
||||
void setPlotTitle( const QString& plotTitle );
|
||||
virtual QSize preferredSize() const;
|
||||
|
||||
void showTitle();
|
||||
void hideTitle();
|
||||
void showTitle();
|
||||
void hideTitle();
|
||||
|
||||
public slots:
|
||||
void updateChildrenLayout();
|
||||
void updateChildrenLayout();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
void showEvent(QShowEvent *) override;
|
||||
void changeEvent(QEvent *) override;
|
||||
void contextMenuEvent(QContextMenuEvent *) override;
|
||||
QSize sizeHint() const override;
|
||||
void resizeEvent( QResizeEvent* event ) override;
|
||||
void showEvent( QShowEvent* ) override;
|
||||
void changeEvent( QEvent* ) override;
|
||||
void contextMenuEvent( QContextMenuEvent* ) override;
|
||||
QSize sizeHint() const override;
|
||||
|
||||
|
||||
void keyPressEvent(QKeyEvent* keyEvent) override;
|
||||
void keyPressEvent( QKeyEvent* keyEvent ) override;
|
||||
|
||||
private:
|
||||
void updateScrollBar(double minDepth, double maxDepth);
|
||||
std::map<int, int> calculateTrackWidthsToMatchFrame(int frameWidth) const;
|
||||
void placeChildWidgets(int frameHeight, int frameWidth);
|
||||
void positionTitle(int frameWidth);
|
||||
void updateScrollBar( double minDepth, double maxDepth );
|
||||
std::map<int, int> calculateTrackWidthsToMatchFrame( int frameWidth ) const;
|
||||
void placeChildWidgets( int frameHeight, int frameWidth );
|
||||
void positionTitle( int frameWidth );
|
||||
|
||||
private slots:
|
||||
void slotSetMinDepth(int value);
|
||||
void scheduleUpdateChildrenLayout();
|
||||
void slotSetMinDepth( int value );
|
||||
void scheduleUpdateChildrenLayout();
|
||||
|
||||
protected:
|
||||
QPointer<QLabel> m_plotTitle;
|
||||
@@ -95,4 +94,3 @@ protected:
|
||||
caf::PdmPointer<RimWellLogPlot> m_plotDefinition;
|
||||
QTimer* m_scheduleUpdateChildrenLayoutTimer;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user