(#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;

View File

@ -74,6 +74,8 @@ RimCrossSection::RimCrossSection()
CAF_PDM_InitFieldNoDefault(&simulationWell, "SimulationWell", "Simulation Well", "", "", "");
CAF_PDM_InitField (&m_branchIndex, "Branch", -1, "Branch", "", "", "");
CAF_PDM_InitField (&m_extentLength, "ExtentLength", 200.0, "Extent length", "", "", "");
CAF_PDM_InitField (&showInactiveCells, "ShowInactiveCells", false, "Inactive Cells", "", "", "");
uiCapability()->setUiChildrenHidden(true);
}
@ -89,7 +91,8 @@ void RimCrossSection::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
changedField == &wellPath ||
changedField == &simulationWell ||
changedField == &m_branchIndex ||
changedField == &m_extentLength)
changedField == &m_extentLength ||
changedField == &showInactiveCells)
{
m_crossSectionPartMgr = NULL;
@ -149,6 +152,8 @@ void RimCrossSection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
// User defined poly line
}
uiOrdering.add(&showInactiveCells);
updateWellExtentDefaultValue();
uiOrdering.setForgetRemainingFields(true);

View File

@ -64,6 +64,7 @@ public:
caf::PdmField< caf::AppEnum< CrossSectionEnum > > type;
caf::PdmField< caf::AppEnum< CrossSectionDirEnum > > direction;
caf::PdmField< bool > showInactiveCells;
caf::PdmPtrField<RimWellPath*> wellPath;
caf::PdmPtrField<RimEclipseWell*> simulationWell;