(#679) Inactive cells can be toggled from the intersection

This commit is contained in:
Jacob Støren
2015-11-27 13:35:17 +01:00
parent 9f0c9d13b9
commit 0bda8e9a2f
5 changed files with 24 additions and 7 deletions

View File

@@ -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);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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;

View File

@@ -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;