mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#679) Inactive cells can be toggled from the intersection
This commit is contained in:
@@ -1201,11 +1201,17 @@ const RimCrossSection* RivCrossSectionGeometryGenerator::crossSection() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
#include "RigActiveCellInfo.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivEclipseCrossSectionGrid::RivEclipseCrossSectionGrid(const RigMainGrid * mainGrid) : m_mainGrid(mainGrid)
|
||||
RivEclipseCrossSectionGrid::RivEclipseCrossSectionGrid(const RigMainGrid * mainGrid,
|
||||
const RigActiveCellInfo* activeCellInfo,
|
||||
bool showInactiveCells)
|
||||
: m_mainGrid(mainGrid),
|
||||
m_activeCellInfo(activeCellInfo),
|
||||
m_showInactiveCells(showInactiveCells)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1240,8 +1246,10 @@ void RivEclipseCrossSectionGrid::findIntersectingCells(const cvf::BoundingBox& i
|
||||
bool RivEclipseCrossSectionGrid::useCell(size_t cellIndex) const
|
||||
{
|
||||
const RigCell& cell = m_mainGrid->globalCellArray()[cellIndex];
|
||||
|
||||
return !(cell.isInvalid() || (cell.subGrid() != NULL));
|
||||
if (m_showInactiveCells)
|
||||
return !(cell.isInvalid() || (cell.subGrid() != NULL));
|
||||
else
|
||||
return m_activeCellInfo->isActive(cellIndex) && (cell.subGrid() == NULL);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <vector>
|
||||
|
||||
class RigMainGrid;
|
||||
class RigActiveCellInfo;
|
||||
class RigResultAccessor;
|
||||
class RimCrossSection;
|
||||
|
||||
@@ -56,7 +57,7 @@ public:
|
||||
class RivEclipseCrossSectionGrid : public RivCrossSectionHexGridIntf
|
||||
{
|
||||
public:
|
||||
RivEclipseCrossSectionGrid(const RigMainGrid * mainGrid);
|
||||
RivEclipseCrossSectionGrid(const RigMainGrid * mainGrid, const RigActiveCellInfo* activeCellInfo, bool showInactiveCells);
|
||||
|
||||
virtual cvf::Vec3d displayOffset() const;
|
||||
virtual cvf::BoundingBox boundingBox() const;
|
||||
@@ -66,7 +67,9 @@ public:
|
||||
virtual void cellCornerIndices(size_t cellIndex, size_t cornerIndices[8]) const;
|
||||
|
||||
private:
|
||||
cvf::cref<RigMainGrid> m_mainGrid;
|
||||
cvf::cref<RigMainGrid> m_mainGrid;
|
||||
cvf::cref<RigActiveCellInfo> m_activeCellInfo;
|
||||
bool m_showInactiveCells;
|
||||
};
|
||||
|
||||
class RigFemPart;
|
||||
|
||||
@@ -435,7 +435,7 @@ cvf::ref<RivCrossSectionHexGridIntf> RivCrossSectionPartMgr::createHexGridInterf
|
||||
{
|
||||
RigMainGrid* grid = NULL;
|
||||
grid = eclipseView->eclipseCase()->reservoirData()->mainGrid();
|
||||
return new RivEclipseCrossSectionGrid(grid);
|
||||
return new RivEclipseCrossSectionGrid(grid, eclipseView->currentActiveCellInfo(), m_rimCrossSection->showInactiveCells());
|
||||
}
|
||||
|
||||
RimGeoMechView* geoView;
|
||||
|
||||
Reference in New Issue
Block a user