mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
(#532) WLP: Added line thickness
This commit is contained in:
parent
2f6bd07ff0
commit
1150b12213
@ -26,6 +26,8 @@
|
||||
#include "RiuLineSegmentQwtPlotCurve.h"
|
||||
#include "RiuWellLogTrack.h"
|
||||
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
// NB! Special macro for pure virtual class
|
||||
@ -49,6 +51,9 @@ RimWellLogCurve::RimWellLogCurve()
|
||||
|
||||
CAF_PDM_InitField(&m_curveColor, "Color", cvf::Color3f(cvf::Color3::BLACK), "Color", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_curveThickness, "Thickness", 1.0f, "Thickness", "", "", "");
|
||||
m_curveThickness.uiCapability()->setUiEditorTypeName(caf::PdmUiComboBoxEditor::uiEditorTypeName());
|
||||
|
||||
m_qwtPlotCurve = new RiuLineSegmentQwtPlotCurve;
|
||||
m_qwtPlotCurve->setXAxis(QwtPlot::xTop);
|
||||
m_qwtPlotCurve->setYAxis(QwtPlot::yLeft);
|
||||
@ -84,9 +89,10 @@ void RimWellLogCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
m_customCurveName = m_curveName;
|
||||
updatePlotTitle();
|
||||
}
|
||||
else if (&m_curveColor == changedField)
|
||||
else if (&m_curveColor == changedField
|
||||
|| &m_curveThickness == changedField)
|
||||
{
|
||||
m_qwtPlotCurve->setPen(QPen(QColor(m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte())));
|
||||
updateCurvePen();
|
||||
}
|
||||
else if (changedField == &m_autoName)
|
||||
{
|
||||
@ -150,7 +156,7 @@ void RimWellLogCurve::updatePlotConfiguration()
|
||||
this->updateCurveName();
|
||||
this->updatePlotTitle();
|
||||
|
||||
m_qwtPlotCurve->setPen(QPen(QColor(m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte())));
|
||||
updateCurvePen();
|
||||
// Todo: Rest of the curve setup controlled from this class
|
||||
}
|
||||
|
||||
@ -312,3 +318,31 @@ const RigWellLogCurveData* RimWellLogCurve::curveData() const
|
||||
{
|
||||
return m_curveData.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogCurve::updateCurvePen()
|
||||
{
|
||||
CVF_ASSERT(m_qwtPlotCurve);
|
||||
m_qwtPlotCurve->setPen(QColor(m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte()), m_curveThickness);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimWellLogCurve::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if (fieldNeedingOptions == &m_curveThickness)
|
||||
{
|
||||
for (size_t i = 0; i < 10; i++)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(QString::number(i + 1), QVariant::fromValue(i + 1)));
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
|
@ -73,12 +73,14 @@ protected:
|
||||
void updateCurveVisibility();
|
||||
void zoomAllOwnerTrackAndPlot();
|
||||
void updateOptionSensitivity();
|
||||
void updateCurvePen();
|
||||
|
||||
// Overridden PDM methods
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
virtual void initAfterRead();
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly);
|
||||
|
||||
|
||||
QPointer<RiuWellLogTrack> m_ownerQwtTrack;
|
||||
@ -91,4 +93,5 @@ protected:
|
||||
|
||||
caf::PdmField<bool> m_autoName;
|
||||
caf::PdmField<cvf::Color3f> m_curveColor;
|
||||
caf::PdmField<float> m_curveThickness;
|
||||
};
|
||||
|
@ -271,6 +271,9 @@ QList<caf::PdmOptionItemInfo> RimWellLogExtractionCurve::calculateValueOptions(c
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> optionList;
|
||||
|
||||
optionList = RimWellLogCurve::calculateValueOptions(fieldNeedingOptions, useOptionsOnly);
|
||||
if (optionList.size() > 0) return optionList;
|
||||
|
||||
if (fieldNeedingOptions == &m_wellPath)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
@ -360,6 +363,7 @@ void RimWellLogExtractionCurve::defineUiOrdering(QString uiConfigName, caf::PdmU
|
||||
|
||||
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Appearance");
|
||||
appearanceGroup->add(&m_curveColor);
|
||||
appearanceGroup->add(&m_curveThickness);
|
||||
appearanceGroup->add(&m_curveName);
|
||||
appearanceGroup->add(&m_autoName);
|
||||
if (m_autoName)
|
||||
|
@ -169,6 +169,7 @@ void RimWellLogFileCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder
|
||||
|
||||
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Appearance");
|
||||
appearanceGroup->add(&m_curveColor);
|
||||
appearanceGroup->add(&m_curveThickness);
|
||||
appearanceGroup->add(&m_curveName);
|
||||
appearanceGroup->add(&m_autoName);
|
||||
}
|
||||
@ -188,6 +189,9 @@ QList<caf::PdmOptionItemInfo> RimWellLogFileCurve::calculateValueOptions(const c
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> optionList;
|
||||
|
||||
optionList = RimWellLogCurve::calculateValueOptions(fieldNeedingOptions, useOptionsOnly);
|
||||
if (optionList.size() > 0) return optionList;
|
||||
|
||||
if (fieldNeedingOptions == &m_wellPath)
|
||||
{
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
|
Loading…
Reference in New Issue
Block a user