From fc9686faae3bf38700d4522ffc4589978f875d2d Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Wed, 31 Oct 2018 10:36:04 +0100 Subject: [PATCH] #3586 Several minor improvements to 2d maps * disable z-scale * hide some cell and grid appearance groups * disable grid lines on faults --- .../ProjectDataModel/Rim2dEclipseView.cpp | 17 ++++++++-- .../ProjectDataModel/Rim2dEclipseView.h | 1 + ApplicationCode/ProjectDataModel/Rim3dView.h | 5 ++- .../RimSimWellInViewCollection.cpp | 32 +++++++++++++------ .../UserInterface/RiuMainWindow.cpp | 6 ++-- 5 files changed, 47 insertions(+), 14 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Rim2dEclipseView.cpp b/ApplicationCode/ProjectDataModel/Rim2dEclipseView.cpp index 86dab2d4e2..ad0dacd031 100644 --- a/ApplicationCode/ProjectDataModel/Rim2dEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/Rim2dEclipseView.cpp @@ -54,8 +54,7 @@ Rim2dEclipseView::Rim2dEclipseView() m_overlayInfoConfig->setIsActive(false); m_gridCollection->setActive(false); // This is also not added to the tree view, so cannot be enabled. wellCollection()->isActive = false; - faultCollection()->showFaultCollection = false; - + faultCollection()->showFaultCollection = false; m_grid2dProjectionPartMgr = new Riv2dGridProjectionPartMgr(grid2dProjection()); @@ -77,6 +76,8 @@ void Rim2dEclipseView::initAfterRead() { m_gridCollection->setActive(false); // This is also not added to the tree view, so cannot be enabled. disablePerspectiveProjectionField(); + meshMode.setValue(NO_MESH); + surfaceMode.setValue(FAULTS); } //-------------------------------------------------------------------------------------------------- @@ -92,6 +93,18 @@ void Rim2dEclipseView::createDisplayModel() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void Rim2dEclipseView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) +{ + caf::PdmUiGroup* viewGroup = uiOrdering.addNewGroup("Viewer"); + viewGroup->add(this->userDescriptionField()); + viewGroup->add(this->backgroundColorField()); + viewGroup->add(this->showGridBoxField()); + uiOrdering.skipRemainingFields(true); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Rim2dEclipseView.h b/ApplicationCode/ProjectDataModel/Rim2dEclipseView.h index bba4d3302e..889963611e 100644 --- a/ApplicationCode/ProjectDataModel/Rim2dEclipseView.h +++ b/ApplicationCode/ProjectDataModel/Rim2dEclipseView.h @@ -32,6 +32,7 @@ public: protected: void initAfterRead() override; void createDisplayModel() override; + void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override; void updateCurrentTimeStep() override; void updateLegends() override; diff --git a/ApplicationCode/ProjectDataModel/Rim3dView.h b/ApplicationCode/ProjectDataModel/Rim3dView.h index 6acb91f33a..b7ef96e31b 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dView.h +++ b/ApplicationCode/ProjectDataModel/Rim3dView.h @@ -202,9 +202,12 @@ protected: private: // Overridden PdmObject methods: - caf::PdmFieldHandle* userDescriptionField() override { return &m_name; } void setupBeforeSave() override; protected: + caf::PdmFieldHandle* userDescriptionField() override { return &m_name; } + caf::PdmFieldHandle* backgroundColorField() { return &m_backgroundColor; } + caf::PdmFieldHandle* showGridBoxField() { return &m_showGridBox; } + void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; virtual void updateViewWidgetAfterCreation() override; diff --git a/ApplicationCode/ProjectDataModel/RimSimWellInViewCollection.cpp b/ApplicationCode/ProjectDataModel/RimSimWellInViewCollection.cpp index 269c8c59ac..fe5cb684fa 100644 --- a/ApplicationCode/ProjectDataModel/RimSimWellInViewCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimSimWellInViewCollection.cpp @@ -27,6 +27,7 @@ #include "RigEclipseCaseData.h" #include "RigSimWellData.h" +#include "Rim2dEclipseView.h" #include "RimEclipseCase.h" #include "RimEclipseResultCase.h" #include "RimEclipseView.h" @@ -530,18 +531,26 @@ void RimSimWellInViewCollection::defineUiOrdering(QString uiConfigName, caf::Pdm { updateStateForVisibilityCheckboxes(); + bool isContourMap = dynamic_cast(m_reservoirView) != nullptr; + caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Visibility"); - appearanceGroup->add(&showWellsIntersectingVisibleCells); + if (!isContourMap) + { + appearanceGroup->add(&showWellsIntersectingVisibleCells); + } appearanceGroup->add(&m_showWellLabel); appearanceGroup->add(&m_showWellHead); appearanceGroup->add(&m_showWellPipe); appearanceGroup->add(&m_showWellSpheres); appearanceGroup->add(&m_showWellCommunicationLines); - caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Well Cells and Fence"); - filterGroup->add(&m_showWellCells); - filterGroup->add(&m_showWellCellFence); - filterGroup->add(&wellCellFenceType); + if (!isContourMap) + { + caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Well Cells and Fence"); + filterGroup->add(&m_showWellCells); + filterGroup->add(&m_showWellCellFence); + filterGroup->add(&wellCellFenceType); + } caf::PdmUiGroup* sizeScalingGroup = uiOrdering.addNewGroup("Size Scaling"); sizeScalingGroup->add(&wellHeadScaleFactor); @@ -560,10 +569,13 @@ void RimSimWellInViewCollection::defineUiOrdering(QString uiConfigName, caf::Pdm wellPipeGroup->add(&wellPipeCoordType); wellPipeGroup->add(&isAutoDetectingBranches); - caf::PdmUiGroup* advancedGroup = uiOrdering.addNewGroup("Advanced"); - advancedGroup->setCollapsedByDefault(true); - advancedGroup->add(&wellCellTransparencyLevel); - advancedGroup->add(&wellHeadPosition); + if (!isContourMap) + { + caf::PdmUiGroup* advancedGroup = uiOrdering.addNewGroup("Advanced"); + advancedGroup->setCollapsedByDefault(true); + advancedGroup->add(&wellCellTransparencyLevel); + advancedGroup->add(&wellHeadPosition); + } RimEclipseResultCase* ownerCase = nullptr; firstAncestorOrThisOfType(ownerCase); @@ -574,6 +586,8 @@ void RimSimWellInViewCollection::defineUiOrdering(QString uiConfigName, caf::Pdm m_showWellCellFence.uiCapability()->setUiReadOnly(!showWellCells()); wellCellFenceType.uiCapability()->setUiReadOnly(!showWellCells()); + + uiOrdering.skipRemainingFields(true); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/UserInterface/RiuMainWindow.cpp b/ApplicationCode/UserInterface/RiuMainWindow.cpp index 63cb26df8e..72d76a5f40 100644 --- a/ApplicationCode/UserInterface/RiuMainWindow.cpp +++ b/ApplicationCode/UserInterface/RiuMainWindow.cpp @@ -1807,11 +1807,13 @@ void RiuMainWindow::slotScaleChanged(int scaleValue) //-------------------------------------------------------------------------------------------------- void RiuMainWindow::updateScaleValue() { - if (RiaApplication::instance()->activeReservoirView()) + Rim3dView* view = RiaApplication::instance()->activeReservoirView(); + bool isRegularReservoirView = view && dynamic_cast(view) == nullptr; + if (isRegularReservoirView) { m_scaleFactor->setEnabled(true); - int scaleValue = static_cast(RiaApplication::instance()->activeReservoirView()->scaleZ()); // Round down is probably ok. + int scaleValue = static_cast(view->scaleZ()); // Round down is probably ok. m_scaleFactor->blockSignals(true); m_scaleFactor->setValue(scaleValue); m_scaleFactor->blockSignals(false);