mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#396) Setting default curve color on creation
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
//==================================================================================================
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellLogExtractionCurve, "WellLogEclipseCurve");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -68,7 +69,6 @@ RimWellLogExtractionCurve::RimWellLogExtractionCurve()
|
||||
m_geomResultDefinition = new RimGeoMechResultDefinition;
|
||||
|
||||
CAF_PDM_InitField(&m_timeStep, "CurveTimeStep", 0,"Time Step", "", "", "");
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -140,6 +140,7 @@ void RimWellLogExtractionCurve::updatePlotData()
|
||||
if (isNeedingUpdate)
|
||||
{
|
||||
m_plotCurve->setSamples(values.data(), depthValues.data(), (int)depthValues.size());
|
||||
m_plotCurve->setPen(QPen(QColor(m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte())));
|
||||
|
||||
RimWellLogPlot* wellLogPlot;
|
||||
firstAnchestorOrThisOfType(wellLogPlot);
|
||||
|
||||
@@ -36,6 +36,8 @@ RimWellLogPlotCurve::RimWellLogPlotCurve()
|
||||
m_showCurve.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_userName, "CurveDescription", "Name", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_curveColor, "Color", cvf::Color3f(cvf::Color3::BLACK), "Color", "", "", "");
|
||||
|
||||
m_plotCurve = new QwtPlotCurve;
|
||||
m_plotCurve->setXAxis(QwtPlot::xTop);
|
||||
m_plotCurve->setYAxis(QwtPlot::yLeft);
|
||||
@@ -108,6 +110,7 @@ void RimWellLogPlotCurve::updatePlotData()
|
||||
depthValues.push_back(1000);
|
||||
|
||||
m_plotCurve->setSamples(values.data(), depthValues.data(), (int) depthValues.size());
|
||||
m_plotCurve->setPen(QPen(QColor(m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte())));
|
||||
|
||||
RimWellLogPlot* wellLogPlot;
|
||||
firstAnchestorOrThisOfType(wellLogPlot);
|
||||
@@ -156,3 +159,11 @@ bool RimWellLogPlotCurve::depthRange(double* minimumDepth, double* maximumDepth)
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlotCurve::setColor(const cvf::Color3f& color)
|
||||
{
|
||||
m_curveColor = color;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -28,7 +29,6 @@ class RiuWellLogTracePlot;
|
||||
class QwtPlotCurve;
|
||||
class QString;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
@@ -42,7 +42,9 @@ public:
|
||||
void setDescription(QString description) {m_userName = description;}
|
||||
|
||||
void setPlot(RiuWellLogTracePlot* plot);
|
||||
void setColor(const cvf::Color3f& color);
|
||||
bool depthRange(double* minimumDepth, double* maximumDepth);
|
||||
|
||||
virtual void updatePlotData();
|
||||
|
||||
protected:
|
||||
@@ -53,9 +55,9 @@ protected:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
|
||||
|
||||
caf::PdmField<bool> m_showCurve;
|
||||
caf::PdmField<QString> m_userName;
|
||||
// caf::PdmField<QColor> m_curveColor;
|
||||
caf::PdmField<bool> m_showCurve;
|
||||
caf::PdmField<QString> m_userName;
|
||||
caf::PdmField<cvf::Color3f> m_curveColor;
|
||||
// caf::PdmField<Linestyle> m_lineStyle;
|
||||
// caf::PdmField<int> m_lineWidth;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user