2017-11-15 13:45:56 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017- Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-11-15 13:45:56 -06:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-11-15 13:45:56 -06:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-11-15 13:45:56 -06:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RicGridStatisticsDialog.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "ExportCommands/RicSnapshotFilenameGenerator.h"
|
2017-11-29 04:45:01 -06:00
|
|
|
#include "ExportCommands/RicSnapshotViewToClipboardFeature.h"
|
|
|
|
#include "ExportCommands/RicSnapshotViewToFileFeature.h"
|
2017-11-15 13:45:56 -06:00
|
|
|
|
2020-05-09 04:23:58 -05:00
|
|
|
#include "RiaPreferences.h"
|
|
|
|
|
2017-11-15 13:45:56 -06:00
|
|
|
#include "Rim3dOverlayInfoConfig.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RimEclipseView.h"
|
2017-11-15 13:45:56 -06:00
|
|
|
|
2018-04-26 23:28:08 -05:00
|
|
|
#include "RiuPlotMainWindow.h"
|
2019-02-25 07:54:36 -06:00
|
|
|
#include "RiuQwtPlotTools.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RiuSummaryQwtPlot.h"
|
2017-11-29 01:50:48 -06:00
|
|
|
#include "RiuTools.h"
|
2017-11-15 13:45:56 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
#include <QAction>
|
2017-11-29 04:45:01 -06:00
|
|
|
#include <QDialogButtonBox>
|
2019-09-06 03:40:57 -05:00
|
|
|
#include <QLabel>
|
2017-11-29 04:45:01 -06:00
|
|
|
#include <QPushButton>
|
2019-09-06 03:40:57 -05:00
|
|
|
#include <QTextEdit>
|
2017-11-29 04:45:01 -06:00
|
|
|
#include <QToolBar>
|
2019-09-06 03:40:57 -05:00
|
|
|
#include <QVBoxLayout>
|
2017-11-15 13:45:56 -06:00
|
|
|
#include <qwt_plot.h>
|
|
|
|
#include <qwt_plot_curve.h>
|
|
|
|
#include <qwt_plot_histogram.h>
|
|
|
|
#include <qwt_plot_marker.h>
|
2019-09-06 03:40:57 -05:00
|
|
|
#include <qwt_scale_draw.h>
|
2017-11-29 01:50:48 -06:00
|
|
|
#include <qwt_series_data.h>
|
2017-11-15 13:45:56 -06:00
|
|
|
#include <qwt_symbol.h>
|
2017-11-29 01:50:48 -06:00
|
|
|
|
2017-11-15 13:45:56 -06:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-15 13:45:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RicGridStatisticsDialog::RicGridStatisticsDialog( QWidget* parent )
|
|
|
|
: QDialog( parent, RiuTools::defaultDialogFlags() )
|
2017-11-15 13:45:56 -06:00
|
|
|
{
|
2017-11-29 04:45:01 -06:00
|
|
|
m_currentRimView = nullptr;
|
|
|
|
|
2017-11-15 13:45:56 -06:00
|
|
|
// Create widgets
|
2019-09-06 03:40:57 -05:00
|
|
|
m_toolBar = new QToolBar();
|
2017-11-29 04:45:01 -06:00
|
|
|
m_mainViewWidget = new QFrame();
|
2019-09-06 03:40:57 -05:00
|
|
|
m_label = new QLabel();
|
|
|
|
m_textEdit = new QTextEdit();
|
2017-11-15 13:45:56 -06:00
|
|
|
m_historgramPlot = new QwtPlot();
|
|
|
|
m_aggregatedPlot = new QwtPlot();
|
2019-09-06 03:40:57 -05:00
|
|
|
m_buttons = new QDialogButtonBox( QDialogButtonBox::Close );
|
2017-11-15 13:45:56 -06:00
|
|
|
|
2017-11-29 04:45:01 -06:00
|
|
|
// Connect to close button signal
|
2019-09-06 03:40:57 -05:00
|
|
|
connect( m_buttons, SIGNAL( rejected() ), this, SLOT( slotDialogFinished() ) );
|
2017-11-15 13:45:56 -06:00
|
|
|
|
|
|
|
// Set widget properties
|
2019-09-06 03:40:57 -05:00
|
|
|
m_textEdit->setReadOnly( true );
|
2020-05-09 04:23:58 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
RiuQwtPlotTools::setCommonPlotBehaviour( m_historgramPlot );
|
|
|
|
RiuQwtPlotTools::setCommonPlotBehaviour( m_aggregatedPlot );
|
2017-11-15 13:45:56 -06:00
|
|
|
|
|
|
|
// Define layout
|
2017-11-29 04:45:01 -06:00
|
|
|
QVBoxLayout* dialogLayout = new QVBoxLayout();
|
2019-09-06 03:40:57 -05:00
|
|
|
dialogLayout->addWidget( m_mainViewWidget );
|
2017-11-29 04:45:01 -06:00
|
|
|
|
|
|
|
QVBoxLayout* mainViewLayout = new QVBoxLayout();
|
2019-09-06 03:40:57 -05:00
|
|
|
mainViewLayout->setMargin( 0 );
|
|
|
|
m_mainViewWidget->setLayout( mainViewLayout );
|
|
|
|
mainViewLayout->addWidget( m_label );
|
|
|
|
mainViewLayout->addWidget( m_textEdit );
|
2017-11-16 07:13:50 -06:00
|
|
|
|
|
|
|
QVBoxLayout* plotLayout = new QVBoxLayout();
|
2019-09-06 03:40:57 -05:00
|
|
|
plotLayout->setSpacing( 0 );
|
|
|
|
plotLayout->addWidget( m_historgramPlot );
|
|
|
|
plotLayout->addWidget( m_aggregatedPlot );
|
|
|
|
mainViewLayout->addLayout( plotLayout );
|
2017-11-29 04:45:01 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
dialogLayout->addWidget( m_buttons );
|
2017-11-16 07:13:50 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
setLayout( dialogLayout );
|
2017-11-29 04:45:01 -06:00
|
|
|
|
|
|
|
// Toolbar
|
2019-09-06 03:40:57 -05:00
|
|
|
dialogLayout->setMenuBar( m_toolBar );
|
2017-11-29 04:45:01 -06:00
|
|
|
createAndConnectToolbarActions();
|
2017-11-15 13:45:56 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-15 13:45:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-12 04:13:38 -06:00
|
|
|
RicGridStatisticsDialog::~RicGridStatisticsDialog()
|
|
|
|
{
|
|
|
|
}
|
2017-11-15 13:45:56 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-15 13:45:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RicGridStatisticsDialog::setLabel( const QString& labelText )
|
2017-11-15 13:45:56 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_label->setText( labelText );
|
2017-11-15 13:45:56 -06:00
|
|
|
}
|
|
|
|
|
2017-11-29 04:45:01 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-29 04:45:01 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RicGridStatisticsDialog::updateFromRimView( RimGridView* rimView )
|
2017-11-29 04:45:01 -06:00
|
|
|
{
|
|
|
|
m_currentRimView = rimView;
|
2019-09-06 03:40:57 -05:00
|
|
|
setInfoText( m_currentRimView );
|
|
|
|
setHistogramData( m_currentRimView );
|
2017-11-29 04:45:01 -06:00
|
|
|
}
|
|
|
|
|
2017-11-29 06:34:55 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-29 06:34:55 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QImage RicGridStatisticsDialog::screenShotImage()
|
|
|
|
{
|
2019-09-13 08:13:49 -05:00
|
|
|
QPixmap shot = m_mainViewWidget->grab();
|
|
|
|
|
2017-11-29 06:34:55 -06:00
|
|
|
return shot.toImage();
|
|
|
|
}
|
|
|
|
|
2017-11-15 13:45:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-15 13:45:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RicGridStatisticsDialog::setInfoText( RimGridView* view )
|
2017-11-15 13:45:56 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( view && view->overlayInfoConfig() )
|
2017-11-15 13:45:56 -06:00
|
|
|
{
|
2018-08-02 12:22:03 -05:00
|
|
|
Rim3dOverlayInfoConfig* overlayInfo = view->overlayInfoConfig();
|
|
|
|
|
2017-11-15 13:45:56 -06:00
|
|
|
QString text;
|
2017-11-28 08:07:46 -06:00
|
|
|
text = overlayInfo->timeStepText();
|
|
|
|
text += overlayInfo->caseInfoText();
|
2019-09-06 03:40:57 -05:00
|
|
|
text += overlayInfo->resultInfoText( overlayInfo->histogramData() );
|
|
|
|
m_textEdit->setText( text );
|
2017-11-17 01:30:23 -06:00
|
|
|
adjustTextEditHeightToContent();
|
2017-11-15 13:45:56 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-15 13:45:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RicGridStatisticsDialog::setHistogramData( RimGridView* view )
|
2017-11-15 13:45:56 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
deletePlotItems( m_historgramPlot );
|
|
|
|
deletePlotItems( m_aggregatedPlot );
|
2017-11-16 03:39:54 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( view && view->overlayInfoConfig() )
|
2017-11-15 13:45:56 -06:00
|
|
|
{
|
2018-08-02 12:22:03 -05:00
|
|
|
Rim3dOverlayInfoConfig* overlayInfo = view->overlayInfoConfig();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
auto hist = new QwtPlotHistogram( "Histogram" );
|
|
|
|
auto aggr = new QwtPlotCurve( "Aggregated" );
|
2017-11-15 13:45:56 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
hist->setBrush( QBrush( QColor( Qt::darkCyan ) ) );
|
|
|
|
hist->setZ( -1 );
|
|
|
|
aggr->setStyle( QwtPlotCurve::Steps );
|
|
|
|
aggr->setCurveAttribute( QwtPlotCurve::Inverted );
|
2017-11-15 13:45:56 -06:00
|
|
|
|
2020-12-09 02:54:20 -06:00
|
|
|
RigHistogramData histogramData = overlayInfo->histogramData();
|
2017-11-15 13:45:56 -06:00
|
|
|
|
2020-09-29 02:22:58 -05:00
|
|
|
if ( histogramData.isHistogramVectorValid() )
|
2017-11-15 13:45:56 -06:00
|
|
|
{
|
2017-11-16 06:22:05 -06:00
|
|
|
QVector<QwtIntervalSample> histSamples;
|
2019-09-06 03:40:57 -05:00
|
|
|
QVector<QPointF> aggrSamples;
|
2021-05-03 03:16:25 -05:00
|
|
|
double xStep = ( histogramData.max - histogramData.min ) / histogramData.histogram.size();
|
2019-09-06 03:40:57 -05:00
|
|
|
double xCurr = histogramData.min;
|
2017-11-16 06:22:05 -06:00
|
|
|
double aggrValue = 0.0;
|
2021-05-03 03:16:25 -05:00
|
|
|
for ( size_t value : histogramData.histogram )
|
2017-11-16 06:22:05 -06:00
|
|
|
{
|
|
|
|
double xNext = xCurr + xStep;
|
2019-09-06 03:40:57 -05:00
|
|
|
histSamples.push_back( QwtIntervalSample( value, xCurr, xNext ) );
|
2017-11-16 06:22:05 -06:00
|
|
|
|
|
|
|
aggrValue += value;
|
2019-09-06 03:40:57 -05:00
|
|
|
aggrSamples.push_back( QPointF( xCurr, aggrValue ) );
|
2017-11-16 06:22:05 -06:00
|
|
|
|
|
|
|
xCurr = xNext;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Axis
|
2019-09-06 03:40:57 -05:00
|
|
|
double xAxisSize = histogramData.max - histogramData.min;
|
2017-11-20 04:51:08 -06:00
|
|
|
double xAxisExtension = xAxisSize * 0.02;
|
2019-09-06 03:40:57 -05:00
|
|
|
m_historgramPlot->setAxisScale( QwtPlot::xBottom,
|
|
|
|
histogramData.min - xAxisExtension,
|
|
|
|
histogramData.max + xAxisExtension );
|
|
|
|
m_aggregatedPlot->setAxisScale( QwtPlot::xBottom,
|
|
|
|
histogramData.min - xAxisExtension,
|
|
|
|
histogramData.max + xAxisExtension );
|
2017-11-20 04:51:08 -06:00
|
|
|
|
|
|
|
// Set y axis label area width
|
2019-09-06 03:40:57 -05:00
|
|
|
m_historgramPlot->axisScaleDraw( QwtPlot::yLeft )->setMinimumExtent( 60 );
|
|
|
|
m_aggregatedPlot->axisScaleDraw( QwtPlot::yLeft )->setMinimumExtent( 60 );
|
2017-11-16 06:22:05 -06:00
|
|
|
|
|
|
|
// Samples
|
2019-09-06 03:40:57 -05:00
|
|
|
hist->setSamples( histSamples );
|
|
|
|
aggr->setSamples( aggrSamples );
|
|
|
|
hist->attach( m_historgramPlot );
|
|
|
|
aggr->attach( m_aggregatedPlot );
|
2017-11-16 06:22:05 -06:00
|
|
|
|
|
|
|
// Markers
|
2019-09-06 03:40:57 -05:00
|
|
|
setMarkers( histogramData, m_historgramPlot );
|
|
|
|
setMarkers( histogramData, m_aggregatedPlot );
|
2017-11-15 13:45:56 -06:00
|
|
|
}
|
|
|
|
}
|
2017-11-16 06:22:05 -06:00
|
|
|
|
|
|
|
// Refresh plot
|
|
|
|
m_historgramPlot->replot();
|
|
|
|
m_aggregatedPlot->replot();
|
2017-11-15 13:45:56 -06:00
|
|
|
}
|
|
|
|
|
2017-11-29 04:45:01 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-29 04:45:01 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RicGridStatisticsDialog::createAndConnectToolbarActions()
|
|
|
|
{
|
2020-02-12 04:43:15 -06:00
|
|
|
QAction* scrShotToClipboardAction =
|
|
|
|
m_toolBar->addAction( RicSnapshotViewToClipboardFeature::icon(), RicSnapshotViewToClipboardFeature::text() );
|
2019-09-06 03:40:57 -05:00
|
|
|
connect( scrShotToClipboardAction, SIGNAL( triggered() ), this, SLOT( slotScreenShotToClipboard() ) );
|
2017-11-29 04:45:01 -06:00
|
|
|
|
2020-02-12 04:43:15 -06:00
|
|
|
QAction* scrShotToFileAction =
|
|
|
|
m_toolBar->addAction( RicSnapshotViewToFileFeature::icon(), RicSnapshotViewToFileFeature::text() );
|
2019-09-06 03:40:57 -05:00
|
|
|
connect( scrShotToFileAction, SIGNAL( triggered() ), this, SLOT( slotScreenShotToFile() ) );
|
2017-11-29 04:45:01 -06:00
|
|
|
}
|
|
|
|
|
2017-11-16 03:39:54 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-16 03:39:54 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RicGridStatisticsDialog::deletePlotItems( QwtPlot* plot )
|
2017-11-16 03:39:54 -06:00
|
|
|
{
|
2019-07-25 00:38:46 -05:00
|
|
|
QwtPlotItemList itemList = plot->itemList();
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( auto item : itemList )
|
2017-11-16 03:39:54 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( dynamic_cast<QwtPlotMarker*>( item ) || dynamic_cast<QwtPlotCurve*>( item ) ||
|
|
|
|
dynamic_cast<QwtPlotHistogram*>( item ) )
|
2017-11-16 03:39:54 -06:00
|
|
|
{
|
|
|
|
item->detach();
|
|
|
|
delete item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-15 13:45:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-15 13:45:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-12-09 02:54:20 -06:00
|
|
|
void RicGridStatisticsDialog::setMarkers( const RigHistogramData& histData, QwtPlot* plot )
|
2017-11-15 13:45:56 -06:00
|
|
|
{
|
|
|
|
QwtPlotMarker* marker;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( histData.p10 != HUGE_VAL )
|
2017-11-16 07:52:06 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
marker = createVerticalPlotMarker( Qt::red, histData.p10 );
|
|
|
|
marker->attach( plot );
|
2017-11-16 07:52:06 -06:00
|
|
|
}
|
2017-11-15 13:45:56 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( histData.p90 != HUGE_VAL )
|
2017-11-16 07:52:06 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
marker = createVerticalPlotMarker( Qt::red, histData.p90 );
|
|
|
|
marker->attach( plot );
|
2017-11-16 07:52:06 -06:00
|
|
|
}
|
2017-11-15 13:45:56 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( histData.mean != HUGE_VAL )
|
2017-11-16 07:52:06 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
marker = createVerticalPlotMarker( Qt::blue, histData.mean );
|
|
|
|
marker->attach( plot );
|
2017-11-16 07:52:06 -06:00
|
|
|
}
|
2017-11-15 13:45:56 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-15 13:45:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
QwtPlotMarker* RicGridStatisticsDialog::createVerticalPlotMarker( const QColor& color, double xValue )
|
2017-11-15 13:45:56 -06:00
|
|
|
{
|
|
|
|
QwtPlotMarker* marker = new QwtPlotMarker();
|
2019-09-06 03:40:57 -05:00
|
|
|
marker->setXValue( xValue );
|
|
|
|
marker->setLineStyle( QwtPlotMarker::VLine );
|
|
|
|
marker->setLinePen( color, 2, Qt::SolidLine );
|
2017-11-15 13:45:56 -06:00
|
|
|
return marker;
|
|
|
|
}
|
|
|
|
|
2017-11-17 01:30:23 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-17 01:30:23 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RicGridStatisticsDialog::adjustTextEditHeightToContent()
|
|
|
|
{
|
|
|
|
int docHeight = m_textEdit->document()->size().height();
|
2019-09-06 03:40:57 -05:00
|
|
|
m_textEdit->setFixedHeight( docHeight + 10 );
|
2017-11-17 01:30:23 -06:00
|
|
|
}
|
|
|
|
|
2017-11-15 13:45:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-15 13:45:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RicGridStatisticsDialog::slotDialogFinished()
|
|
|
|
{
|
|
|
|
close();
|
|
|
|
}
|
2017-11-29 04:45:01 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-29 04:45:01 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-29 06:34:55 -06:00
|
|
|
void RicGridStatisticsDialog::slotScreenShotToClipboard()
|
2017-11-29 04:45:01 -06:00
|
|
|
{
|
2017-11-29 06:34:55 -06:00
|
|
|
QImage snapshotImage = screenShotImage();
|
2019-09-06 03:40:57 -05:00
|
|
|
RicSnapshotViewToClipboardFeature::copyToClipboard( snapshotImage );
|
2017-11-29 04:45:01 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-29 04:45:01 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-29 06:34:55 -06:00
|
|
|
void RicGridStatisticsDialog::slotScreenShotToFile()
|
2017-11-29 04:45:01 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
QImage snapshotImage = screenShotImage();
|
2017-11-29 04:45:01 -06:00
|
|
|
QString defaultFileBaseName;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_currentRimView )
|
2017-11-29 04:45:01 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
defaultFileBaseName = RicSnapshotFilenameGenerator::generateSnapshotFileName( m_currentRimView );
|
2017-11-29 04:45:01 -06:00
|
|
|
defaultFileBaseName += "_Statistics";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
defaultFileBaseName = "Snapshot_Statistics";
|
|
|
|
}
|
2019-12-18 05:25:19 -06:00
|
|
|
RicSnapshotViewToFileFeature::saveImageToFile( snapshotImage, defaultFileBaseName );
|
2017-11-29 04:45:01 -06:00
|
|
|
}
|