From c4d4d03ceef9149f45f67f407f973b08245ef77f Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 25 Jan 2017 07:45:17 +0100 Subject: [PATCH] #1078 Added well head control to RimEclipseWell plus rename and reorder --- .../RivSimWellPipesPartMgr.cpp | 2 +- .../ModelVisualization/RivWellHeadPartMgr.cpp | 3 +- .../ProjectDataModel/RimEclipseWell.cpp | 30 +++++++++++-------- .../ProjectDataModel/RimEclipseWell.h | 13 ++++---- .../RimEclipseWellCollection.cpp | 6 ++-- .../RimEclipseWellCollection.h | 2 +- 6 files changed, 33 insertions(+), 23 deletions(-) diff --git a/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp b/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp index 901bb953f5..9a3efe028c 100644 --- a/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp @@ -85,7 +85,7 @@ void RivSimWellPipesPartMgr::buildWellPipeParts() m_rimWell->calculateWellPipeStaticCenterLine(m_pipeBranchesCLCoords, pipeBranchesCellIds); double characteristicCellSize = m_rimReservoirView->mainGrid()->characteristicIJCellSize(); - double pipeRadius = m_rimReservoirView->wellCollection()->pipeRadiusScaleFactor() *m_rimWell->pipeRadiusScaleFactor() * characteristicCellSize; + double pipeRadius = m_rimReservoirView->wellCollection()->pipeScaleFactor() * m_rimWell->pipeScaleFactor() * characteristicCellSize; for (size_t brIdx = 0; brIdx < pipeBranchesCellIds.size(); ++brIdx) diff --git a/ApplicationCode/ModelVisualization/RivWellHeadPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellHeadPartMgr.cpp index 44d2114677..0e27ceb53d 100644 --- a/ApplicationCode/ModelVisualization/RivWellHeadPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellHeadPartMgr.cpp @@ -160,7 +160,7 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex) pipeGeomGenerator->setPipeColor(well->wellPipeColor()); pipeGeomGenerator->setCrossSectionVertexCount(m_rimReservoirView->wellCollection()->pipeCrossSectionVertexCount()); - double pipeRadius = m_rimReservoirView->wellCollection()->pipeRadiusScaleFactor() * m_rimWell->pipeRadiusScaleFactor() * characteristicCellSize; + double pipeRadius = m_rimReservoirView->wellCollection()->pipeScaleFactor() * m_rimWell->pipeScaleFactor() * characteristicCellSize; pipeGeomGenerator->setRadius(pipeRadius); cvf::ref pipeSurface = pipeGeomGenerator->createPipeSurface(); @@ -349,6 +349,7 @@ void RivWellHeadPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* } if (wellCollection->showWellHead() && + m_rimWell->showWellHead() && m_wellHeadArrowPart.notNull()) { model->addPart(m_wellHeadArrowPart.p()); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseWell.cpp b/ApplicationCode/ProjectDataModel/RimEclipseWell.cpp index 454cf674a2..b692f30a4b 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseWell.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseWell.cpp @@ -38,19 +38,21 @@ RimEclipseWell::RimEclipseWell() { CAF_PDM_InitObject("Well", ":/Well.png", "", ""); - CAF_PDM_InitFieldNoDefault(&name, "WellName", "Name", "", "", ""); - CAF_PDM_InitField(&showWell, "ShowWell", true, "Show well ", "", "", ""); + CAF_PDM_InitFieldNoDefault(&name, "WellName", "Name", "", "", ""); + + 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, "Show well label", "", "", ""); + CAF_PDM_InitField(&showWellHead, "ShowWellHead", true, "Show well head", "", "", ""); + CAF_PDM_InitField(&showWellPipes, "ShowWellPipe", true, "Show well pipe", "", "", ""); + CAF_PDM_InitField(&showWellSpheres, "ShowWellSpheres", true, "Show well spheres", "", "", ""); - CAF_PDM_InitField(&showWellPipes, "ShowWellPipe", true, "Show well pipe", "", "", ""); - CAF_PDM_InitField(&showWellSpheres, "ShowWellSpheres", true, "Show well spheres", "", "", ""); - CAF_PDM_InitField(&pipeRadiusScaleFactor, "WellPipeRadiusScale",1.0, "Pipe radius scale", "", "", ""); - CAF_PDM_InitField(&wellPipeColor, "WellPipeColor", cvf::Color3f(0.588f, 0.588f, 0.804f), "Well pipe color", "", "", ""); + CAF_PDM_InitField(&pipeScaleFactor, "WellPipeRadiusScale", 1.0, "Well Pipe Scale Factor", "", "", ""); + CAF_PDM_InitField(&wellPipeColor, "WellPipeColor", cvf::Color3f(0.588f, 0.588f, 0.804f), "Well pipe color", "", "", ""); - CAF_PDM_InitField(&showWellCells, "ShowWellCells", true, "Add cells to range filter", "", "", ""); - CAF_PDM_InitField(&showWellCellFence, "ShowWellCellFence", false, "Use well fence", "", "", ""); + CAF_PDM_InitField(&showWellCells, "ShowWellCells", true, "Add cells to range filter", "", "", ""); + CAF_PDM_InitField(&showWellCellFence, "ShowWellCellFence", false, "Use well fence", "", "", ""); name.uiCapability()->setUiHidden(true); name.uiCapability()->setUiReadOnly(true); @@ -83,6 +85,7 @@ void RimEclipseWell::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c if (!m_reservoirView) return; if (&showWellLabel == changedField || + &showWellHead == changedField || &showWellPipes == changedField || &showWellSpheres == changedField || &wellPipeColor == changedField) @@ -97,7 +100,7 @@ void RimEclipseWell::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c m_reservoirView->scheduleGeometryRegen(VISIBLE_WELL_CELLS); m_reservoirView->scheduleCreateDisplayModelAndRedraw(); } - else if (&pipeRadiusScaleFactor == changedField) + else if (&pipeScaleFactor == changedField) { if (m_reservoirView) { @@ -199,11 +202,14 @@ bool RimEclipseWell::visibleCellsInstersectsWell(size_t frameIndex) void RimEclipseWell::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) { caf::PdmUiGroup* pipeGroup = uiOrdering.addNewGroup("Appearance"); + pipeGroup->add(&showWellLabel); + pipeGroup->add(&showWellHead); pipeGroup->add(&showWellPipes); pipeGroup->add(&showWellSpheres); - pipeGroup->add(&showWellLabel); + + pipeGroup->add(&pipeScaleFactor); + pipeGroup->add(&wellPipeColor); - pipeGroup->add(&pipeRadiusScaleFactor); caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Range filter"); filterGroup->add(&showWellCells); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseWell.h b/ApplicationCode/ProjectDataModel/RimEclipseWell.h index d8a90e269d..61fee4eae6 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseWell.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseWell.h @@ -67,15 +67,18 @@ public: caf::PdmField showWell; caf::PdmField name; + caf::PdmField showWellLabel; + caf::PdmField showWellHead; + caf::PdmField showWellPipes; + caf::PdmField showWellSpheres; + + caf::PdmField pipeScaleFactor; + + caf::PdmField wellPipeColor; caf::PdmField showWellCells; caf::PdmField showWellCellFence; - - caf::PdmField showWellPipes; - caf::PdmField showWellSpheres; - caf::PdmField wellPipeColor; - caf::PdmField pipeRadiusScaleFactor; protected: virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.cpp b/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.cpp index 5258d88ba3..871ac5c96f 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.cpp @@ -107,7 +107,7 @@ RimEclipseWellCollection::RimEclipseWellCollection() CAF_PDM_InitField(&wellPipeVisibility, "GlobalWellPipeVisibility", WellVisibilityEnum(PIPES_OPEN_IN_VISIBLE_CELLS), "Global well pipe visibility", "", "", ""); - CAF_PDM_InitField(&pipeRadiusScaleFactor, "WellPipeRadiusScale", 0.1, "Pipe radius scale", "", "", ""); + CAF_PDM_InitField(&pipeScaleFactor, "WellPipeRadiusScale", 0.1, "Pipe radius scale", "", "", ""); CAF_PDM_InitField(&pipeCrossSectionVertexCount, "WellPipeVertexCount", 12, "Pipe vertex count", "", "", ""); pipeCrossSectionVertexCount.uiCapability()->setUiHidden(true); CAF_PDM_InitField(&wellPipeCoordType, "WellPipeCoordType", WellPipeCoordEnum(WELLPIPE_INTERPOLATED), "Well Pipe Coords", "", "", ""); @@ -264,7 +264,7 @@ void RimEclipseWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* chang } } else if ( &pipeCrossSectionVertexCount == changedField - || &pipeRadiusScaleFactor == changedField + || &pipeScaleFactor == changedField || &wellHeadScaleFactor == changedField || &showWellHead == changedField || &isAutoDetectingBranches == changedField @@ -307,7 +307,7 @@ void RimEclipseWellCollection::defineUiOrdering(QString uiConfigName, caf::PdmUi caf::PdmUiGroup* wellPipe = uiOrdering.addNewGroup("Well pipe"); wellPipe->add(&wellPipeVisibility); - wellPipe->add(&pipeRadiusScaleFactor); + wellPipe->add(&pipeScaleFactor); wellPipe->add(&wellPipeCoordType); caf::PdmUiGroup* cellCenterSpheres = uiOrdering.addNewGroup("Well cell center spheres"); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.h b/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.h index 348dc7ce85..ef32b89af2 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseWellCollection.h @@ -99,7 +99,7 @@ public: caf::PdmField wellCellTransparencyLevel; caf::PdmField wellPipeVisibility; - caf::PdmField pipeRadiusScaleFactor; + caf::PdmField pipeScaleFactor; caf::PdmField pipeCrossSectionVertexCount; caf::PdmField wellPipeCoordType;