mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fixed mouse interaction with well log plots and tracks
This commit is contained in:
@@ -166,10 +166,12 @@ void RiuMainPlotWindow::createToolBars()
|
||||
{
|
||||
// Snapshots
|
||||
QToolBar* toolbar = addToolBar(tr("View Snapshots"));
|
||||
/*
|
||||
toolbar->setObjectName(toolbar->windowTitle());
|
||||
toolbar->addAction(m_snapshotToClipboard);
|
||||
toolbar->addAction(m_snapshotToFile);
|
||||
toolbar->addAction(m_snapshotAllViewsToFile);
|
||||
*/
|
||||
|
||||
toolbar->addAction(cmdFeatureMgr->action("RicSnapshotViewToClipboardFeature"));
|
||||
}
|
||||
|
||||
@@ -50,8 +50,6 @@
|
||||
#include "RimTools.h"
|
||||
#include "RimTreeViewStateSerializer.h"
|
||||
#include "RimViewWindow.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimWellPathImport.h"
|
||||
|
||||
@@ -67,7 +65,6 @@
|
||||
#include "RiuTreeViewEventFilter.h"
|
||||
#include "RiuViewer.h"
|
||||
#include "RiuWellImportWizard.h"
|
||||
#include "RiuWellLogPlot.h"
|
||||
|
||||
#include "cafAboutDialog.h"
|
||||
#include "cafAnimationToolBar.h"
|
||||
@@ -1133,20 +1130,12 @@ void RiuMainWindow::addViewer(QWidget* viewer, const RimMdiWindowGeometry& windo
|
||||
}
|
||||
else
|
||||
{
|
||||
RiuWellLogPlot* wellLogPlot = dynamic_cast<RiuWellLogPlot*>(subWin->widget());
|
||||
if (wellLogPlot)
|
||||
{
|
||||
subWindowSize = QSize(275, m_mdiArea->height());
|
||||
}
|
||||
else
|
||||
{
|
||||
subWindowSize = QSize(400, 400);
|
||||
subWindowSize = QSize(400, 400);
|
||||
|
||||
if (m_mdiArea->subWindowList().size() < 1)
|
||||
{
|
||||
// Show first 3D view maximized
|
||||
initialStateMaximized = true;
|
||||
}
|
||||
if (m_mdiArea->subWindowList().size() < 1)
|
||||
{
|
||||
// Show first 3D view maximized
|
||||
initialStateMaximized = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1312,25 +1301,6 @@ void RiuMainWindow::slotSubWindowActivated(QMdiSubWindow* subWindow)
|
||||
RimProject * proj = RiaApplication::instance()->project();
|
||||
if (!proj) return;
|
||||
|
||||
RiuWellLogPlot* wellLogPlotViewer = dynamic_cast<RiuWellLogPlot*>(subWindow->widget());
|
||||
|
||||
if (wellLogPlotViewer)
|
||||
{
|
||||
RimWellLogPlot* wellLogPlot = wellLogPlotViewer->ownerPlotDefinition();
|
||||
|
||||
if (wellLogPlot != RiaApplication::instance()->activeWellLogPlot())
|
||||
{
|
||||
RiaApplication::instance()->setActiveWellLogPlot(wellLogPlot);
|
||||
if (wellLogPlot)
|
||||
{
|
||||
projectTreeView()->selectAsCurrentItem(wellLogPlot);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
RiaApplication::instance()->setActiveWellLogPlot(NULL);
|
||||
|
||||
// Find the activated 3D view
|
||||
|
||||
RimView* activatedView = NULL;
|
||||
@@ -1567,8 +1537,6 @@ void RiuMainWindow::selectedObjectsChanged()
|
||||
|
||||
bool isActiveViewChanged = false;
|
||||
|
||||
RimWellLogPlot* selectedWellLogPlot = NULL;
|
||||
|
||||
if (selectedReservoirView)
|
||||
{
|
||||
// Set focus in MDI area to this window if it exists
|
||||
@@ -1578,29 +1546,10 @@ void RiuMainWindow::selectedObjectsChanged()
|
||||
}
|
||||
isActiveViewChanged = true;
|
||||
}
|
||||
else // Check if we are winthin a Well Log plot
|
||||
{
|
||||
selectedWellLogPlot = dynamic_cast<RimWellLogPlot*>(firstSelectedObject);
|
||||
if (!selectedWellLogPlot)
|
||||
{
|
||||
firstSelectedObject->firstAnchestorOrThisOfType(selectedWellLogPlot);
|
||||
}
|
||||
|
||||
if (selectedWellLogPlot)
|
||||
{
|
||||
if (selectedWellLogPlot->viewer())
|
||||
{
|
||||
setActiveViewer(selectedWellLogPlot->viewer());
|
||||
|
||||
}
|
||||
isActiveViewChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isActiveViewChanged)
|
||||
{
|
||||
RiaApplication::instance()->setActiveReservoirView(selectedReservoirView);
|
||||
RiaApplication::instance()->setActiveWellLogPlot(selectedWellLogPlot);
|
||||
refreshDrawStyleActions();
|
||||
refreshAnimationActions();
|
||||
slotRefreshFileActions();
|
||||
|
||||
@@ -17,7 +17,11 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RiuMainPlotWindow.h"
|
||||
|
||||
#include "qwt_date_scale_draw.h"
|
||||
#include "qwt_date_scale_engine.h"
|
||||
@@ -26,10 +30,9 @@
|
||||
#include "qwt_plot_grid.h"
|
||||
#include "qwt_plot_layout.h"
|
||||
#include "qwt_scale_engine.h"
|
||||
|
||||
#include <QEvent>
|
||||
#include <QWheelEvent>
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
|
||||
#include <float.h>
|
||||
|
||||
@@ -226,7 +229,7 @@ void RiuSummaryQwtPlot::selectClosestCurve(const QPoint& pos)
|
||||
RimSummaryCurve* selectedCurve = m_plotDefinition->findRimCurveFromQwtCurve(closestCurve);
|
||||
if(selectedCurve)
|
||||
{
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(selectedCurve);
|
||||
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem(selectedCurve);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "RimWellLogTrack.h"
|
||||
#include "RimWellLogCurve.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuMainPlotWindow.h"
|
||||
|
||||
#include "qwt_legend.h"
|
||||
#include "qwt_plot_curve.h"
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <QWheelEvent>
|
||||
|
||||
#include <float.h>
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#define RIU_SCROLLWHEEL_ZOOMFACTOR 1.1
|
||||
#define RIU_SCROLLWHEEL_PANFACTOR 0.1
|
||||
@@ -220,7 +221,7 @@ void RiuWellLogTrack::focusInEvent(QFocusEvent* event)
|
||||
{
|
||||
if (m_plotTrackDefinition)
|
||||
{
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(m_plotTrackDefinition);
|
||||
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem(m_plotTrackDefinition);
|
||||
clearFocus();
|
||||
}
|
||||
}
|
||||
@@ -254,7 +255,7 @@ void RiuWellLogTrack::selectClosestCurve(const QPoint& pos)
|
||||
RimWellLogCurve* selectedCurve = m_plotTrackDefinition->curveDefinitionFromCurve(closestCurve);
|
||||
if (selectedCurve)
|
||||
{
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(selectedCurve);
|
||||
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem(selectedCurve);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user