From e3d985d220cdd0ea44441c8b1c5cee1f7c6e7859 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 26 Oct 2018 16:23:18 +0200 Subject: [PATCH] #3558 Grid items in Project Tree : Remove obsolete field showMainGrid --- .../RivReservoirViewPartMgr.cpp | 8 ++-- .../RivReservoirViewPartMgr.h | 4 +- .../ProjectDataModel/RimEclipseView.cpp | 45 +++---------------- .../ProjectDataModel/RimEclipseView.h | 4 +- 4 files changed, 11 insertions(+), 50 deletions(-) diff --git a/ApplicationCode/ModelVisualization/RivReservoirViewPartMgr.cpp b/ApplicationCode/ModelVisualization/RivReservoirViewPartMgr.cpp index 71d9a43c4c..3d54d14c3a 100644 --- a/ApplicationCode/ModelVisualization/RivReservoirViewPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivReservoirViewPartMgr.cpp @@ -308,7 +308,7 @@ void RivReservoirViewPartMgr::computeVisibility(cvf::UByteArray* cellVisibility, computeOverriddenCellVisibility(cellVisibility, grid); break; case ACTIVE: - computeNativeVisibility(cellVisibility, grid, activeCellInfo, eclipseCase->wellCellsInGrid(gridIdx), false, false, true, m_reservoirView->showMainGrid() ); + computeNativeVisibility(cellVisibility, grid, activeCellInfo, eclipseCase->wellCellsInGrid(gridIdx), false, false, true); break; case ALL_WELL_CELLS: copyByteArray(cellVisibility, eclipseCase->wellCellsInGrid(gridIdx)); @@ -346,7 +346,7 @@ void RivReservoirViewPartMgr::computeVisibility(cvf::UByteArray* cellVisibility, } break; case INACTIVE: - computeNativeVisibility(cellVisibility, grid, activeCellInfo, eclipseCase->wellCellsInGrid(gridIdx), m_reservoirView->showInvalidCells(), true, false, m_reservoirView->showMainGrid()); + computeNativeVisibility(cellVisibility, grid, activeCellInfo, eclipseCase->wellCellsInGrid(gridIdx), m_reservoirView->showInvalidCells(), true, false); break; case RANGE_FILTERED: { @@ -587,8 +587,7 @@ void RivReservoirViewPartMgr::createPropertyFilteredWellGeometry(size_t frameInd void RivReservoirViewPartMgr::computeNativeVisibility(cvf::UByteArray* cellVisibility, const RigGridBase* grid, const RigActiveCellInfo* activeCellInfo, const cvf::UByteArray* cellIsInWellStatuses, bool invalidCellsIsVisible, bool inactiveCellsIsVisible, - bool activeCellsIsVisible, - bool mainGridIsVisible) + bool activeCellsIsVisible) { CVF_ASSERT(cellVisibility != nullptr); CVF_ASSERT(grid != nullptr); @@ -607,7 +606,6 @@ void RivReservoirViewPartMgr::computeNativeVisibility(cvf::UByteArray* cellVisib if ( !invalidCellsIsVisible && cell.isInvalid() || !inactiveCellsIsVisible && !activeCellInfo->isActive(reservoirCellIndex) || !activeCellsIsVisible && activeCellInfo->isActive(reservoirCellIndex) - //|| mainGridIsVisible && (cell.subGrid() != NULL) // this is handled on global level instead || (*cellIsInWellStatuses)[cellIndex] ) { diff --git a/ApplicationCode/ModelVisualization/RivReservoirViewPartMgr.h b/ApplicationCode/ModelVisualization/RivReservoirViewPartMgr.h index e1ecb33eec..acf36822ea 100644 --- a/ApplicationCode/ModelVisualization/RivReservoirViewPartMgr.h +++ b/ApplicationCode/ModelVisualization/RivReservoirViewPartMgr.h @@ -122,8 +122,8 @@ private: const cvf::UByteArray* cellIsInWellStatuses, bool invalidCellsIsVisible, bool inactiveCellsIsVisible, - bool activeCellsIsVisible, - bool mainGridIsVisible); + bool activeCellsIsVisible); + void computeRangeVisibility (RivCellSetEnum geometryType, cvf::UByteArray* cellVisibilities, const RigGridBase* grid, diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index 4a3b203221..1edd528160 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -145,7 +145,6 @@ RimEclipseView::RimEclipseView() m_propertyFilterCollection.uiCapability()->setUiHidden(true); // Visualization fields - CAF_PDM_InitField(&m_showMainGrid, "ShowMainGrid", true, "Show Main Grid", "", "", ""); CAF_PDM_InitField(&m_showInactiveCells, "ShowInactiveCells", false, "Show Inactive Cells", "", "", ""); CAF_PDM_InitField(&m_showInvalidCells, "ShowInvalidCells", false, "Show Invalid Cells", "", "", ""); @@ -294,10 +293,6 @@ void RimEclipseView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c scheduleCreateDisplayModelAndRedraw(); } - else if (changedField == &m_showMainGrid) - { - scheduleCreateDisplayModelAndRedraw(); - } else if (changedField == &m_rangeFilterCollection) { this->scheduleGeometryRegen(RANGE_FILTERED); @@ -387,8 +382,7 @@ void RimEclipseView::createDisplayModel() wellCollection()->scheduleIsWellPipesVisibleRecalculation(); // Create vector of grid indices to render - std::vector gridIndices; - this->indicesToVisibleGrids(&gridIndices); + std::vector gridIndices = this->indicesToVisibleGrids(); /// // Get or create the parts for "static" type geometry. The same geometry is used @@ -577,8 +571,7 @@ void RimEclipseView::updateCurrentTimeStep() cvf::ref frameParts = new cvf::ModelBasicList; frameParts->setName("GridModel"); - std::vector gridIndices; - this->indicesToVisibleGrids(&gridIndices); + std::vector gridIndices = this->indicesToVisibleGrids(); geometriesToRecolor.push_back( PROPERTY_FILTERED); geometriesToRecolor.push_back( PROPERTY_FILTERED_WELL_CELLS); @@ -1011,30 +1004,11 @@ void RimEclipseView::scheduleSimWellGeometryRegen() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimEclipseView::indicesToVisibleGrids(std::vector* gridIndices) +std::vector RimEclipseView::indicesToVisibleGrids() const { - CVF_ASSERT(gridIndices != nullptr); + CVF_ASSERT(gridCollection()); - *gridIndices = gridCollection()->indicesToVisibleGrids(); - - -/* - // Create vector of grid indices to render - std::vector grids; - if (this->m_eclipseCase && this->m_eclipseCase->eclipseCaseData() ) - { - this->m_eclipseCase->eclipseCaseData()->allGrids(&grids); - } - - size_t i; - for (i = 0; i < grids.size(); i++) - { - if (!grids[i]->isMainGrid() || this->showMainGrid() ) - { - gridIndices->push_back(i); - } - } -*/ + return gridCollection()->indicesToVisibleGrids(); } //-------------------------------------------------------------------------------------------------- @@ -1475,7 +1449,6 @@ void RimEclipseView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& Rim3dView::defineUiOrdering(uiConfigName, uiOrdering); caf::PdmUiGroup* cellGroup = uiOrdering.addNewGroup("Cell Visibility"); - cellGroup->add(&m_showMainGrid); cellGroup->add(&m_showInactiveCells); cellGroup->add(&m_showInvalidCells); } @@ -1860,14 +1833,6 @@ bool RimEclipseView::showInactiveCells() const return m_showInactiveCells; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseView::showMainGrid() const -{ - return m_showMainGrid; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.h b/ApplicationCode/ProjectDataModel/RimEclipseView.h index d8f443e328..d3710590c1 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.h @@ -89,7 +89,6 @@ public: bool showInvalidCells() const; bool showInactiveCells() const; - bool showMainGrid() const; // Access internal objects const RimPropertyFilterCollection* propertyFilterCollection() const override; @@ -155,7 +154,7 @@ protected: private: void updateDisplayModelVisibility() override; - void indicesToVisibleGrids(std::vector* gridIndices); + std::vector indicesToVisibleGrids() const; void updateScaleTransform() override; cvf::Transform* scaleTransform() override; @@ -179,7 +178,6 @@ private: private: caf::PdmField m_showInvalidCells; caf::PdmField m_showInactiveCells; - caf::PdmField m_showMainGrid; caf::PdmChildField m_cellResult; caf::PdmChildField m_cellEdgeResult;