mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
3D Well Log Curves (#2668): Implement Draw-plane width control
* Apply a factor between 0.25 and 2.5 times the characteristic cell size * Make the offset from the pipe scale with the plane width up to a maximum offset. * Organise the CurveCollection settings into two groups.
This commit is contained in:
parent
36b1dcf85f
commit
9da3f09782
@ -173,7 +173,8 @@ double Riv3dWellLogPlanePartMgr::wellPathCenterToPlotStartOffset(Rim3dWellLogCur
|
||||
|
||||
if (planePosition == Rim3dWellLogCurveCollection::ALONG_WELLPATH)
|
||||
{
|
||||
return m_wellPath->wellPathRadius(cellSize) * 2;
|
||||
double wellPathOffset = std::min(m_wellPath->wellPathRadius(cellSize), 0.1 * planeWidth());
|
||||
return m_wellPath->wellPathRadius(cellSize) + wellPathOffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -189,8 +190,8 @@ double Riv3dWellLogPlanePartMgr::planeWidth() const
|
||||
if (!m_gridView) return 0;
|
||||
|
||||
double cellSize = m_gridView->ownerCase()->characteristicCellSize();
|
||||
|
||||
return cellSize * 1.0;
|
||||
const Rim3dWellLogCurveCollection* curveCollection = m_wellPath->rim3dWellLogCurveCollection();
|
||||
return cellSize * curveCollection->planeWidthScaling();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include "RimWellPath.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafPdmUiDoubleSliderEditor.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(Rim3dWellLogCurveCollection, "Rim3dWellLogCurveCollection");
|
||||
|
||||
namespace caf
|
||||
@ -47,7 +49,8 @@ Rim3dWellLogCurveCollection::Rim3dWellLogCurveCollection()
|
||||
m_showPlot.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_planePosition, "PlanePosition", "Plane Position", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_planeWidthScaling, "PlaneWidthScaling", 1.0f, "Plane Width Scaling Factor", "", "", "");
|
||||
m_planeWidthScaling.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
||||
CAF_PDM_InitField(&m_showGrid, "Show3dWellLogGrid", true, "Show Grid", "", "", "");
|
||||
CAF_PDM_InitField(&m_showBackground, "Show3dWellLogBackground", false, "Show Background", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_3dWellLogCurves, "ArrayOf3dWellLogCurves", "", "", "", "");
|
||||
@ -100,7 +103,7 @@ bool Rim3dWellLogCurveCollection::isShowingPlot() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool Rim3dWellLogCurveCollection::isShowingGrid() const
|
||||
{
|
||||
@ -124,6 +127,14 @@ Rim3dWellLogCurveCollection::PlanePosition Rim3dWellLogCurveCollection::planePos
|
||||
return m_planePosition();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
float Rim3dWellLogCurveCollection::planeWidthScaling() const
|
||||
{
|
||||
return m_planeWidthScaling;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -181,11 +192,23 @@ caf::PdmFieldHandle* Rim3dWellLogCurveCollection::objectToggleField()
|
||||
void Rim3dWellLogCurveCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
caf::PdmUiGroup* settingsGroup = uiOrdering.addNewGroup("Draw Plane Settings");
|
||||
|
||||
settingsGroup->add(&m_planePosition);
|
||||
|
||||
settingsGroup->add(&m_planeWidthScaling);
|
||||
|
||||
caf::PdmUiGroup* appearanceSettingsGroup = uiOrdering.addNewGroup("Draw Plane Appearance");
|
||||
appearanceSettingsGroup->add(&m_showGrid);
|
||||
appearanceSettingsGroup->add(&m_showBackground);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Rim3dWellLogCurveCollection::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
|
||||
{
|
||||
caf::PdmUiDoubleSliderEditorAttribute* widthAttribute = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>(attribute);
|
||||
if (widthAttribute)
|
||||
{
|
||||
widthAttribute->m_minimum = 0.25;
|
||||
widthAttribute->m_maximum = 2.5;
|
||||
}
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ public:
|
||||
bool isShowingBackground() const;
|
||||
|
||||
PlanePosition planePosition() const;
|
||||
float planeWidthScaling() const;
|
||||
|
||||
std::vector<Rim3dWellLogCurve*> vectorOf3dWellLogCurves() const;
|
||||
void redrawAffectedViewsAndEditors();
|
||||
@ -61,11 +62,11 @@ private:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual caf::PdmFieldHandle* objectToggleField() override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
||||
private:
|
||||
caf::PdmField<bool> m_showPlot;
|
||||
|
||||
caf::PdmField<caf::AppEnum<PlanePosition>> m_planePosition;
|
||||
caf::PdmField<float> m_planeWidthScaling;
|
||||
|
||||
caf::PdmField<bool> m_showGrid;
|
||||
caf::PdmField<bool> m_showBackground;
|
||||
|
Loading…
Reference in New Issue
Block a user