mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 23:46:00 -06:00
(#612) Append new curves on cell click, clear when no cell is hit
This commit is contained in:
parent
0011f090de
commit
7db6835075
@ -19,7 +19,10 @@
|
||||
|
||||
#include "RiuTimeHistoryQwtPlot.h"
|
||||
|
||||
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
#include "cvfColor3.h"
|
||||
|
||||
#include "qwt_legend.h"
|
||||
#include "qwt_plot_curve.h"
|
||||
@ -64,6 +67,9 @@ void RiuTimeHistoryQwtPlot::addCurve(const QString& curveName, const std::vector
|
||||
plotCurve->setSamples(points);
|
||||
plotCurve->setTitle(curveName);
|
||||
|
||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable();
|
||||
plotCurve->setPen(QPen(QColor(curveColor.rByte(), curveColor.gByte(), curveColor.bByte())));
|
||||
|
||||
plotCurve->attach(this);
|
||||
m_plotCurves.push_back(plotCurve);
|
||||
|
||||
|
@ -472,6 +472,9 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||
|
||||
// Compose a info text regarding the hit
|
||||
|
||||
QString pickInfo = "No hits";
|
||||
@ -512,17 +515,17 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY)
|
||||
pickInfo = textBuilder.topologyText(", ");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delete all curves if no cell is hit
|
||||
mainWnd->timeHistoryPlot()->deleteAllCurves();
|
||||
}
|
||||
|
||||
if (wellPath)
|
||||
{
|
||||
pickInfo = QString("Well path hit: %1").arg(wellPath->name());
|
||||
}
|
||||
|
||||
// Display the text
|
||||
|
||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||
if (!mainWnd) return;
|
||||
|
||||
mainWnd->statusBar()->showMessage(pickInfo);
|
||||
mainWnd->setResultInfo(resultInfo);
|
||||
}
|
||||
@ -551,7 +554,6 @@ void RiuViewerCommands::addTimeHistoryCurve(RimEclipseView* eclipseView, size_t
|
||||
|
||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||
|
||||
mainWnd->timeHistoryPlot()->deleteAllCurves();
|
||||
mainWnd->timeHistoryPlot()->addCurve(curveName, timeStepDates, yValues);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user