#1148 Added well head scale factor to EclipseWell

This commit is contained in:
Magne Sjaastad
2017-02-01 09:52:01 +01:00
parent 929e9ad09b
commit ddd72b4866
3 changed files with 26 additions and 37 deletions
@@ -197,7 +197,7 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
} }
} }
double arrowLength = characteristicCellSize * m_rimReservoirView->wellCollection()->wellHeadScaleFactor(); double arrowLength = characteristicCellSize * m_rimReservoirView->wellCollection()->wellHeadScaleFactor() * m_rimWell->wellHeadScaleFactor();
cvf::Vec3d textPosition = arrowPosition; cvf::Vec3d textPosition = arrowPosition;
textPosition.z() += 1.2 * arrowLength; textPosition.z() += 1.2 * arrowLength;
@@ -41,21 +41,18 @@ RimEclipseWell::RimEclipseWell()
CAF_PDM_InitFieldNoDefault(&name, "WellName", "Name", "", "", ""); CAF_PDM_InitFieldNoDefault(&name, "WellName", "Name", "", "", "");
CAF_PDM_InitField(&showWell, "ShowWell", true, "Show well ", "", "", ""); CAF_PDM_InitField(&showWell, "ShowWell", true, "Show well ", "", "", "");
showWell.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&showWellLabel, "ShowWellLabel", true, "Show well label", "", "", ""); CAF_PDM_InitField(&showWellLabel, "ShowWellLabel", true, "Label", "", "", "");
CAF_PDM_InitField(&showWellHead, "ShowWellHead", true, "Show well head", "", "", ""); CAF_PDM_InitField(&showWellHead, "ShowWellHead", true, "Well head", "", "", "");
CAF_PDM_InitField(&showWellPipe, "ShowWellPipe", true, "Show well pipe", "", "", ""); CAF_PDM_InitField(&showWellPipe, "ShowWellPipe", true, "Pipe", "", "", "");
CAF_PDM_InitField(&showWellSpheres, "ShowWellSpheres", false, "Show well spheres", "", "", ""); CAF_PDM_InitField(&showWellSpheres, "ShowWellSpheres", false, "Spheres", "", "", "");
CAF_PDM_InitField(&pipeScaleFactor, "WellPipeRadiusScale", 1.0, "Well Pipe Scale Factor", "", "", ""); CAF_PDM_InitField(&wellHeadScaleFactor, "WellHeadScaleFactor", 1.0, "Well Head Scale Factor", "", "", "");
CAF_PDM_InitField(&wellPipeColor, "WellPipeColor", cvf::Color3f(0.588f, 0.588f, 0.804f), "Well pipe color", "", "", ""); CAF_PDM_InitField(&pipeScaleFactor, "WellPipeRadiusScale", 1.0, "Pipe Scale Factor", "", "", "");
CAF_PDM_InitField(&wellPipeColor, "WellPipeColor", cvf::Color3f(0.588f, 0.588f, 0.804f), "Pipe color", "", "", "");
CAF_PDM_InitField(&showWellCells, "ShowWellCells", true, "Show Well Cells", "", "", ""); CAF_PDM_InitField(&showWellCells, "ShowWellCells", true, "Well Cells", "", "", "");
CAF_PDM_InitField(&showWellCellFence, "ShowWellCellFence", false, "Show Well Cell Fence", "", "", ""); CAF_PDM_InitField(&showWellCellFence, "ShowWellCellFence", false, "Well Cell Fence", "", "", "");
name.uiCapability()->setUiHidden(true);
name.uiCapability()->setUiReadOnly(true);
m_resultWellIndex = cvf::UNDEFINED_SIZE_T; m_resultWellIndex = cvf::UNDEFINED_SIZE_T;
} }
@@ -100,7 +97,8 @@ void RimEclipseWell::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
m_reservoirView->scheduleGeometryRegen(VISIBLE_WELL_CELLS); m_reservoirView->scheduleGeometryRegen(VISIBLE_WELL_CELLS);
m_reservoirView->scheduleCreateDisplayModelAndRedraw(); m_reservoirView->scheduleCreateDisplayModelAndRedraw();
} }
else if (&pipeScaleFactor == changedField) else if ( &pipeScaleFactor == changedField
|| &wellHeadScaleFactor == changedField)
{ {
if (m_reservoirView) if (m_reservoirView)
{ {
@@ -201,34 +199,24 @@ bool RimEclipseWell::intersectsVisibleCells(size_t frameIndex) const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimEclipseWell::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) void RimEclipseWell::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{ {
caf::PdmUiGroup* pipeGroup = uiOrdering.addNewGroup("Appearance"); caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Visibility");
pipeGroup->add(&showWellLabel); appearanceGroup->add(&showWellLabel);
pipeGroup->add(&showWellHead); appearanceGroup->add(&showWellHead);
pipeGroup->add(&showWellPipe); appearanceGroup->add(&showWellPipe);
pipeGroup->add(&showWellSpheres); appearanceGroup->add(&showWellSpheres);
pipeGroup->add(&pipeScaleFactor); caf::PdmUiGroup* sizeScalingGroup = uiOrdering.addNewGroup("Size Scaling");
sizeScalingGroup->add(&pipeScaleFactor);
sizeScalingGroup->add(&wellHeadScaleFactor);
pipeGroup->add(&wellPipeColor); uiOrdering.add(&wellPipeColor);
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Well Cells"); uiOrdering.add(&showWellCells);
filterGroup->add(&showWellCells); uiOrdering.add(&showWellCellFence);
filterGroup->add(&showWellCellFence);
RimEclipseWellCollection* wellColl = nullptr; showWellCellFence.uiCapability()->setUiReadOnly(!showWellCells());
this->firstAncestorOrThisOfType(wellColl);
if (wellColl)
{
showWellLabel.uiCapability()->setUiReadOnly(!wellColl->showWellLabel());
showWellHead.uiCapability()->setUiReadOnly(!wellColl->showWellHead());
showWellPipe.uiCapability()->setUiReadOnly(!wellColl->showWellPipe());
showWellSpheres.uiCapability()->setUiReadOnly(!wellColl->showWellSpheres());
showWellCells.uiCapability()->setUiReadOnly(!wellColl->showWellCells());
bool isFenceEnabled = false; uiOrdering.setForgetRemainingFields(true);
if (wellColl->showWellCells() && wellColl->showWellCellFence()) isFenceEnabled = true;
showWellCellFence.uiCapability()->setUiReadOnly(!isFenceEnabled);
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -73,6 +73,7 @@ public:
caf::PdmField<bool> showWellPipe; caf::PdmField<bool> showWellPipe;
caf::PdmField<bool> showWellSpheres; caf::PdmField<bool> showWellSpheres;
caf::PdmField<double> wellHeadScaleFactor;
caf::PdmField<double> pipeScaleFactor; caf::PdmField<double> pipeScaleFactor;
caf::PdmField<cvf::Color3f> wellPipeColor; caf::PdmField<cvf::Color3f> wellPipeColor;