(#612) Append new curves on cell click, clear when no cell is hit

This commit is contained in:
Magne Sjaastad 2015-11-05 07:27:04 +01:00
parent 0011f090de
commit 7db6835075
2 changed files with 14 additions and 6 deletions

View File

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

View File

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