Fixed mouse interaction with well log plots and tracks

This commit is contained in:
Magne Sjaastad 2016-06-28 10:58:22 +02:00
parent 0680e830b4
commit cac86dcec9
7 changed files with 54 additions and 71 deletions

View File

@ -992,6 +992,22 @@ RimWellLogPlot* RiaApplication::activeWellLogPlot()
return m_activeWellLogPlot;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaApplication::setActiveSummaryPlot(RimSummaryPlot* sp)
{
m_activeSummaryPlot = sp;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryPlot* RiaApplication::activeSummaryPlot()
{
return m_activeSummaryPlot;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -19,6 +19,7 @@
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <QApplication>
#include <QProcess>
#include <QMutex>
@ -31,18 +32,24 @@
#include <iostream>
class RIProcess;
class RigCaseData;
class RimEclipseCase;
class Drawable;
class RiaSocketServer;
class RIProcess;
class RiaPreferences;
class RimEclipseView;
class RimView;
class RimProject;
class RimCommandObject;
class RiaProjectModifier;
class RiaSocketServer;
class RigCaseData;
class RimCommandObject;
class RimEclipseCase;
class RimEclipseView;
class RimProject;
class RimSummaryPlot;
class RimView;
class RimWellLogPlot;
class RiuMainPlotWindow;
namespace caf
@ -85,6 +92,9 @@ public:
void setActiveWellLogPlot(RimWellLogPlot*);
RimWellLogPlot* activeWellLogPlot();
void setActiveSummaryPlot(RimSummaryPlot*);
RimSummaryPlot* activeSummaryPlot();
void scheduleDisplayModelUpdateAndRedraw(RimView* resViewToUpdate);
RimProject* project();
@ -193,6 +203,7 @@ private slots:
private:
caf::PdmPointer<RimView> m_activeReservoirView;
caf::PdmPointer<RimWellLogPlot> m_activeWellLogPlot;
caf::PdmPointer<RimSummaryPlot> m_activeSummaryPlot;
caf::PdmPointer<RimProject> m_project;

View File

@ -78,6 +78,7 @@ void RicSnapshotViewToClipboardFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
void RicSnapshotViewToClipboardFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Close");
actionToSetup->setText("Snapshot To Clipboard");
actionToSetup->setIcon(QIcon(":/SnapShot.png"));
}

View File

@ -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"));
}

View File

@ -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();

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}