mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2167 statistics dialog. Include statistics snapshot under 'Snapshot all views to file'
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "RimViewWindow.h"
|
||||
#include "RimView.h"
|
||||
#include "RimCase.h"
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
|
||||
#include "RicSnapshotViewToFileFeature.h"
|
||||
#include "RicSnapshotFilenameGenerator.h"
|
||||
@@ -120,6 +121,11 @@ void RicSnapshotAllViewsToFileFeature::exportSnapshotOfAllViewsIntoFolder(QStrin
|
||||
QString absoluteFileName = caf::Utils::constructFullFileName(absSnapshotPath, fileName, ".png");
|
||||
|
||||
RicSnapshotViewToFileFeature::saveSnapshotAs(absoluteFileName, riv);
|
||||
|
||||
// Statistics dialog
|
||||
QImage img = riv->overlayInfoConfig()->statisticsDialogScreenShotImage();
|
||||
absoluteFileName = caf::Utils::constructFullFileName(absSnapshotPath, fileName + "_Statistics", ".png");
|
||||
RicSnapshotViewToFileFeature::saveSnapshotAs(absoluteFileName, img);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
#include <QImage>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
@@ -116,13 +116,22 @@ void RicGridStatisticsDialog::setLabel(const QString& labelText)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicGridStatisticsDialog::setCurrentRimView(RimView* rimView)
|
||||
void RicGridStatisticsDialog::updateFromRimView(RimView* rimView)
|
||||
{
|
||||
m_currentRimView = rimView;
|
||||
setInfoText(m_currentRimView);
|
||||
setHistogramData(m_currentRimView);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RicGridStatisticsDialog::screenShotImage()
|
||||
{
|
||||
QPixmap shot = QPixmap::grabWidget(m_mainViewWidget, m_mainViewWidget->rect());
|
||||
return shot.toImage();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -212,10 +221,10 @@ void RicGridStatisticsDialog::setHistogramData(RimView* view)
|
||||
void RicGridStatisticsDialog::createAndConnectToolbarActions()
|
||||
{
|
||||
QAction* scrShotToClipboardAction = m_toolBar->addAction(RicSnapshotViewToClipboardFeature::icon(), RicSnapshotViewToClipboardFeature::text());
|
||||
connect(scrShotToClipboardAction, SIGNAL(triggered()), this, SLOT(screenShotToClipboard()));
|
||||
connect(scrShotToClipboardAction, SIGNAL(triggered()), this, SLOT(slotScreenShotToClipboard()));
|
||||
|
||||
QAction* scrShotToFileAction = m_toolBar->addAction(RicSnapshotViewToFileFeature::icon(), RicSnapshotViewToFileFeature::text());
|
||||
connect(scrShotToFileAction, SIGNAL(triggered()), this, SLOT(screenShotToFile()));
|
||||
connect(scrShotToFileAction, SIGNAL(triggered()), this, SLOT(slotScreenShotToFile()));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -296,18 +305,18 @@ void RicGridStatisticsDialog::slotDialogFinished()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicGridStatisticsDialog::screenShotToClipboard()
|
||||
void RicGridStatisticsDialog::slotScreenShotToClipboard()
|
||||
{
|
||||
QPixmap shot = QPixmap::grabWidget(m_mainViewWidget, m_mainViewWidget->rect());
|
||||
RicSnapshotViewToClipboardFeature::copyToClipboard(shot.toImage());
|
||||
QImage snapshotImage = screenShotImage();
|
||||
RicSnapshotViewToClipboardFeature::copyToClipboard(snapshotImage);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicGridStatisticsDialog::screenShotToFile()
|
||||
void RicGridStatisticsDialog::slotScreenShotToFile()
|
||||
{
|
||||
QPixmap shot = QPixmap::grabWidget(m_mainViewWidget, m_mainViewWidget->rect());
|
||||
QImage snapshotImage = screenShotImage();
|
||||
QString defaultFileBaseName;
|
||||
if (m_currentRimView)
|
||||
{
|
||||
@@ -318,5 +327,5 @@ void RicGridStatisticsDialog::screenShotToFile()
|
||||
{
|
||||
defaultFileBaseName = "Snapshot_Statistics";
|
||||
}
|
||||
RicSnapshotViewToFileFeature::saveToFile(shot.toImage(), defaultFileBaseName);
|
||||
RicSnapshotViewToFileFeature::saveToFile(snapshotImage, defaultFileBaseName);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,8 @@ public:
|
||||
~RicGridStatisticsDialog();
|
||||
|
||||
void setLabel(const QString& labelText);
|
||||
void setCurrentRimView(RimView* rimView);
|
||||
void updateFromRimView(RimView* rimView);
|
||||
QImage screenShotImage();
|
||||
|
||||
private:
|
||||
void setInfoText(RimView* eclipseView);
|
||||
@@ -61,8 +62,8 @@ private:
|
||||
|
||||
private slots:
|
||||
void slotDialogFinished();
|
||||
void screenShotToClipboard();
|
||||
void screenShotToFile();
|
||||
void slotScreenShotToClipboard();
|
||||
void slotScreenShotToFile();
|
||||
|
||||
private:
|
||||
QToolBar* m_toolBar;
|
||||
|
||||
Reference in New Issue
Block a user