mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Range filter: Add grid type drop-down list to enable LGR-grid range filtering
TP#3995 p4#: 21408
This commit is contained in:
@@ -298,7 +298,7 @@ void RivReservoirViewPartMgr::computeVisibility(cvf::UByteArray* cellVisibility,
|
|||||||
if (m_geometriesNeedsRegen[ACTIVE]) createGeometry(ACTIVE);
|
if (m_geometriesNeedsRegen[ACTIVE]) createGeometry(ACTIVE);
|
||||||
|
|
||||||
nativeVisibility = m_geometries[ACTIVE].cellVisibility(gridIdx);
|
nativeVisibility = m_geometries[ACTIVE].cellVisibility(gridIdx);
|
||||||
computeRangeVisibility(cellVisibility, grid, nativeVisibility.p(), m_reservoirView->rangeFilterCollection());
|
computeRangeVisibility(geometryType, cellVisibility, grid, nativeVisibility.p(), m_reservoirView->rangeFilterCollection());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RANGE_FILTERED_INACTIVE:
|
case RANGE_FILTERED_INACTIVE:
|
||||||
@@ -307,7 +307,7 @@ void RivReservoirViewPartMgr::computeVisibility(cvf::UByteArray* cellVisibility,
|
|||||||
if (m_geometriesNeedsRegen[INACTIVE]) createGeometry(INACTIVE);
|
if (m_geometriesNeedsRegen[INACTIVE]) createGeometry(INACTIVE);
|
||||||
|
|
||||||
nativeVisibility = m_geometries[INACTIVE].cellVisibility(gridIdx);
|
nativeVisibility = m_geometries[INACTIVE].cellVisibility(gridIdx);
|
||||||
computeRangeVisibility(cellVisibility, grid, nativeVisibility.p(), m_reservoirView->rangeFilterCollection());
|
computeRangeVisibility(geometryType, cellVisibility, grid, nativeVisibility.p(), m_reservoirView->rangeFilterCollection());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RANGE_FILTERED_WELL_CELLS:
|
case RANGE_FILTERED_WELL_CELLS:
|
||||||
@@ -316,7 +316,7 @@ void RivReservoirViewPartMgr::computeVisibility(cvf::UByteArray* cellVisibility,
|
|||||||
if (m_geometriesNeedsRegen[ALL_WELL_CELLS]) createGeometry(ALL_WELL_CELLS);
|
if (m_geometriesNeedsRegen[ALL_WELL_CELLS]) createGeometry(ALL_WELL_CELLS);
|
||||||
|
|
||||||
nativeVisibility = m_geometries[ALL_WELL_CELLS].cellVisibility(gridIdx);
|
nativeVisibility = m_geometries[ALL_WELL_CELLS].cellVisibility(gridIdx);
|
||||||
computeRangeVisibility(cellVisibility, grid, nativeVisibility.p(), m_reservoirView->rangeFilterCollection());
|
computeRangeVisibility(geometryType, cellVisibility, grid, nativeVisibility.p(), m_reservoirView->rangeFilterCollection());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VISIBLE_WELL_CELLS_OUTSIDE_RANGE_FILTER:
|
case VISIBLE_WELL_CELLS_OUTSIDE_RANGE_FILTER:
|
||||||
@@ -489,7 +489,7 @@ void RivReservoirViewPartMgr::computeNativeVisibility(cvf::UByteArray* cellVisib
|
|||||||
if ( !invalidCellsIsVisible && cell.isInvalid()
|
if ( !invalidCellsIsVisible && cell.isInvalid()
|
||||||
|| !inactiveCellsIsVisible && !activeCellInfo->isActive(globalCellIndex)
|
|| !inactiveCellsIsVisible && !activeCellInfo->isActive(globalCellIndex)
|
||||||
|| !activeCellsIsVisible && activeCellInfo->isActive(globalCellIndex)
|
|| !activeCellsIsVisible && activeCellInfo->isActive(globalCellIndex)
|
||||||
|| mainGridIsVisible && (cell.subGrid() != NULL)
|
//|| mainGridIsVisible && (cell.subGrid() != NULL) // this is handled on global level instead
|
||||||
|| (*cellIsInWellStatuses)[cellIndex]
|
|| (*cellIsInWellStatuses)[cellIndex]
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -528,7 +528,7 @@ void RivReservoirViewPartMgr::copyByteArray(cvf::UByteArray* destination, const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RivReservoirViewPartMgr::computeRangeVisibility(cvf::UByteArray* cellVisibility, const RigGridBase* grid,
|
void RivReservoirViewPartMgr::computeRangeVisibility(ReservoirGeometryCacheType geometryType, cvf::UByteArray* cellVisibility, const RigGridBase* grid,
|
||||||
const cvf::UByteArray* nativeVisibility, const RimCellRangeFilterCollection* rangeFilterColl)
|
const cvf::UByteArray* nativeVisibility, const RimCellRangeFilterCollection* rangeFilterColl)
|
||||||
{
|
{
|
||||||
CVF_ASSERT(cellVisibility != NULL);
|
CVF_ASSERT(cellVisibility != NULL);
|
||||||
@@ -538,28 +538,46 @@ void RivReservoirViewPartMgr::computeRangeVisibility(cvf::UByteArray* cellVisibi
|
|||||||
CVF_ASSERT(grid != NULL);
|
CVF_ASSERT(grid != NULL);
|
||||||
CVF_ASSERT(nativeVisibility->size() == grid->cellCount());
|
CVF_ASSERT(nativeVisibility->size() == grid->cellCount());
|
||||||
|
|
||||||
|
RivReservoirPartMgr* reservoirGridPartMgr = &m_geometries[geometryType];
|
||||||
|
|
||||||
if (rangeFilterColl->hasActiveFilters())
|
if (rangeFilterColl->hasActiveFilters())
|
||||||
{
|
{
|
||||||
if (cellVisibility != nativeVisibility) (*cellVisibility) = (*nativeVisibility);
|
if (cellVisibility != nativeVisibility) (*cellVisibility) = (*nativeVisibility);
|
||||||
|
|
||||||
// Build range filter for current grid
|
// Build range filter for current grid
|
||||||
cvf::CellRangeFilter mainGridCellRangeFilter;
|
cvf::CellRangeFilter gridCellRangeFilter;
|
||||||
rangeFilterColl->compoundCellRangeFilter(&mainGridCellRangeFilter);
|
rangeFilterColl->compoundCellRangeFilter(&gridCellRangeFilter, grid);
|
||||||
|
|
||||||
|
const RigLocalGrid* lgr = NULL;
|
||||||
|
cvf::ref<cvf::UByteArray> parentGridVisibilities;
|
||||||
|
|
||||||
|
if (!grid->isMainGrid())
|
||||||
|
{
|
||||||
|
lgr = static_cast<const RigLocalGrid*>(grid);
|
||||||
|
size_t parentGridIndex = lgr->parentGrid()->gridIndex();
|
||||||
|
parentGridVisibilities = reservoirGridPartMgr->cellVisibility(parentGridIndex);
|
||||||
|
}
|
||||||
|
|
||||||
#pragma omp parallel for
|
#pragma omp parallel for
|
||||||
for (int cellIndex = 0; cellIndex < static_cast<int>(grid->cellCount()); cellIndex++)
|
for (int cellIndex = 0; cellIndex < static_cast<int>(grid->cellCount()); cellIndex++)
|
||||||
{
|
{
|
||||||
if ( (*nativeVisibility)[cellIndex] )
|
if ( (*nativeVisibility)[cellIndex] )
|
||||||
{
|
{
|
||||||
const RigCell& cell = grid->cell(cellIndex);
|
bool visibleDueToParentGrid = false;
|
||||||
size_t mainGridCellIndex = cell.mainGridCellIndex();
|
if (lgr)
|
||||||
|
{
|
||||||
|
size_t parentGridCellIndex = grid->cell(cellIndex).parentCellIndex();
|
||||||
|
visibleDueToParentGrid = parentGridVisibilities->get(parentGridCellIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Normal grid visibility
|
||||||
size_t mainGridI;
|
size_t mainGridI;
|
||||||
size_t mainGridJ;
|
size_t mainGridJ;
|
||||||
size_t mainGridK;
|
size_t mainGridK;
|
||||||
|
|
||||||
grid->mainGrid()->ijkFromCellIndex(mainGridCellIndex, &mainGridI, &mainGridJ, &mainGridK);
|
grid->ijkFromCellIndex(cellIndex, &mainGridI, &mainGridJ, &mainGridK);
|
||||||
(*cellVisibility)[cellIndex] = !mainGridCellRangeFilter.isCellRejected(mainGridI, mainGridJ, mainGridK);
|
(*cellVisibility)[cellIndex] = (visibleDueToParentGrid || gridCellRangeFilter.isCellVisible(mainGridI, mainGridJ, mainGridK))
|
||||||
|
&& !gridCellRangeFilter.isCellExcluded(mainGridI, mainGridJ, mainGridK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
static void computeNativeVisibility (cvf::UByteArray* cellVisibilities, const RigGridBase* grid, const RigActiveCellInfo* activeCellInfo, const cvf::UByteArray* cellIsInWellStatuses, bool invalidCellsIsVisible, bool inactiveCellsIsVisible, bool activeCellsIsVisible, bool mainGridIsVisible);
|
static void computeNativeVisibility (cvf::UByteArray* cellVisibilities, const RigGridBase* grid, const RigActiveCellInfo* activeCellInfo, const cvf::UByteArray* cellIsInWellStatuses, bool invalidCellsIsVisible, bool inactiveCellsIsVisible, bool activeCellsIsVisible, bool mainGridIsVisible);
|
||||||
static void computeRangeVisibility (cvf::UByteArray* cellVisibilities, const RigGridBase* grid, const cvf::UByteArray* nativeVisibility, const RimCellRangeFilterCollection* rangeFilterColl);
|
void computeRangeVisibility (ReservoirGeometryCacheType geometryType, cvf::UByteArray* cellVisibilities, const RigGridBase* grid, const cvf::UByteArray* nativeVisibility, const RimCellRangeFilterCollection* rangeFilterColl);
|
||||||
static void computePropertyVisibility(cvf::UByteArray* cellVisibilities, const RigGridBase* grid, size_t timeStepIndex, const cvf::UByteArray* rangeFilterVisibility, RimCellPropertyFilterCollection* propFilterColl);
|
static void computePropertyVisibility(cvf::UByteArray* cellVisibilities, const RigGridBase* grid, size_t timeStepIndex, const cvf::UByteArray* rangeFilterVisibility, RimCellPropertyFilterCollection* propFilterColl);
|
||||||
static void copyByteArray(cvf::UByteArray* cellVisibilities, const cvf::UByteArray* cellIsWellStatuses );
|
static void copyByteArray(cvf::UByteArray* cellVisibilities, const cvf::UByteArray* cellIsWellStatuses );
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ RimCellRangeFilter::RimCellRangeFilter()
|
|||||||
{
|
{
|
||||||
CAF_PDM_InitObject("Cell Range Filter", ":/CellFilter_Range.png", "", "");
|
CAF_PDM_InitObject("Cell Range Filter", ":/CellFilter_Range.png", "", "");
|
||||||
|
|
||||||
|
CAF_PDM_InitField(&gridIndex, "GridIndex", 0, "Grid", "", "","");
|
||||||
|
|
||||||
CAF_PDM_InitField(&startIndexI, "StartIndexI", 1, "Start index I", "", "","");
|
CAF_PDM_InitField(&startIndexI, "StartIndexI", 1, "Start index I", "", "","");
|
||||||
startIndexI.setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
startIndexI.setUiEditorTypeName(caf::PdmUiSliderEditor::uiEditorTypeName());
|
||||||
|
|
||||||
@@ -93,17 +95,17 @@ void RimCellRangeFilter::computeAndSetValidValues()
|
|||||||
{
|
{
|
||||||
CVF_ASSERT(m_parentContainer);
|
CVF_ASSERT(m_parentContainer);
|
||||||
|
|
||||||
RigMainGrid* mainGrid = m_parentContainer->mainGrid();
|
RigGridBase* grid = selectedGrid();
|
||||||
if (mainGrid && mainGrid->cellCount() > 0 )
|
if (grid && grid->cellCount() > 0 )
|
||||||
{
|
{
|
||||||
cellCountI = cvf::Math::clamp(cellCountI.v(), 1, static_cast<int>(mainGrid->cellCountI()));
|
cellCountI = cvf::Math::clamp(cellCountI.v(), 1, static_cast<int>(grid->cellCountI()));
|
||||||
startIndexI = cvf::Math::clamp(startIndexI.v(), 1, static_cast<int>(mainGrid->cellCountI()));
|
startIndexI = cvf::Math::clamp(startIndexI.v(), 1, static_cast<int>(grid->cellCountI()));
|
||||||
|
|
||||||
cellCountJ = cvf::Math::clamp(cellCountJ.v(), 1, static_cast<int>(mainGrid->cellCountJ()));
|
cellCountJ = cvf::Math::clamp(cellCountJ.v(), 1, static_cast<int>(grid->cellCountJ()));
|
||||||
startIndexJ = cvf::Math::clamp(startIndexJ.v(), 1, static_cast<int>(mainGrid->cellCountJ()));
|
startIndexJ = cvf::Math::clamp(startIndexJ.v(), 1, static_cast<int>(grid->cellCountJ()));
|
||||||
|
|
||||||
cellCountK = cvf::Math::clamp(cellCountK.v(), 1, static_cast<int>(mainGrid->cellCountK()));
|
cellCountK = cvf::Math::clamp(cellCountK.v(), 1, static_cast<int>(grid->cellCountK()));
|
||||||
startIndexK = cvf::Math::clamp(startIndexK.v(), 1, static_cast<int>(mainGrid->cellCountK()));
|
startIndexK = cvf::Math::clamp(startIndexK.v(), 1, static_cast<int>(grid->cellCountK()));
|
||||||
}
|
}
|
||||||
this->updateIconState();
|
this->updateIconState();
|
||||||
}
|
}
|
||||||
@@ -115,8 +117,10 @@ void RimCellRangeFilter::setDefaultValues()
|
|||||||
{
|
{
|
||||||
CVF_ASSERT(m_parentContainer);
|
CVF_ASSERT(m_parentContainer);
|
||||||
|
|
||||||
|
RigGridBase* grid = selectedGrid();
|
||||||
|
|
||||||
RigActiveCellInfo* actCellInfo = m_parentContainer->activeCellInfo();
|
RigActiveCellInfo* actCellInfo = m_parentContainer->activeCellInfo();
|
||||||
if (actCellInfo)
|
if (grid == m_parentContainer->mainGrid() && actCellInfo)
|
||||||
{
|
{
|
||||||
cvf::Vec3st min, max;
|
cvf::Vec3st min, max;
|
||||||
actCellInfo->IJKBoundingBox(min, max);
|
actCellInfo->IJKBoundingBox(min, max);
|
||||||
@@ -137,6 +141,15 @@ void RimCellRangeFilter::setDefaultValues()
|
|||||||
cellCountJ = static_cast<int>(max.y() - min.y() + 1);
|
cellCountJ = static_cast<int>(max.y() - min.y() + 1);
|
||||||
cellCountK = static_cast<int>(max.z() - min.z() + 1);
|
cellCountK = static_cast<int>(max.z() - min.z() + 1);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
startIndexI = 1;
|
||||||
|
startIndexJ = 1;
|
||||||
|
startIndexK = 1;
|
||||||
|
cellCountI = static_cast<int>(grid->cellCountI() );
|
||||||
|
cellCountJ = static_cast<int>(grid->cellCountJ() );
|
||||||
|
cellCountK = static_cast<int>(grid->cellCountK() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -158,11 +171,26 @@ void RimCellRangeFilter::defineEditorAttribute(const caf::PdmFieldHandle* field,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RigMainGrid* mainGrid = m_parentContainer->mainGrid();
|
RigGridBase* grid = selectedGrid();
|
||||||
CVF_ASSERT(mainGrid);
|
|
||||||
|
if (field == &startIndexI || field == &cellCountI)
|
||||||
|
{
|
||||||
|
myAttr->m_minimum = 1;
|
||||||
|
myAttr->m_maximum = static_cast<int>(grid->cellCountI());
|
||||||
|
}
|
||||||
|
else if (field == &startIndexJ || field == &cellCountJ)
|
||||||
|
{
|
||||||
|
myAttr->m_minimum = 1;
|
||||||
|
myAttr->m_maximum = static_cast<int>(grid->cellCountJ());
|
||||||
|
}
|
||||||
|
else if (field == &startIndexK || field == &cellCountK)
|
||||||
|
{
|
||||||
|
myAttr->m_minimum = 1;
|
||||||
|
myAttr->m_maximum = static_cast<int>(grid->cellCountK());
|
||||||
|
}
|
||||||
|
|
||||||
RigActiveCellInfo* actCellInfo = m_parentContainer->activeCellInfo();
|
RigActiveCellInfo* actCellInfo = m_parentContainer->activeCellInfo();
|
||||||
if (actCellInfo)
|
if (grid == m_parentContainer->mainGrid() && actCellInfo)
|
||||||
{
|
{
|
||||||
cvf::Vec3st min, max;
|
cvf::Vec3st min, max;
|
||||||
actCellInfo->IJKBoundingBox(min, max);
|
actCellInfo->IJKBoundingBox(min, max);
|
||||||
@@ -182,22 +210,71 @@ void RimCellRangeFilter::defineEditorAttribute(const caf::PdmFieldHandle* field,
|
|||||||
cellCountI.setUiName(QString(" Width (%1)").arg(max.x() - min.x() + 1));
|
cellCountI.setUiName(QString(" Width (%1)").arg(max.x() - min.x() + 1));
|
||||||
cellCountJ.setUiName(QString(" Width (%1)").arg(max.y() - min.y() + 1));
|
cellCountJ.setUiName(QString(" Width (%1)").arg(max.y() - min.y() + 1));
|
||||||
cellCountK.setUiName(QString(" Width (%1)").arg(max.z() - min.z() + 1));
|
cellCountK.setUiName(QString(" Width (%1)").arg(max.z() - min.z() + 1));
|
||||||
|
|
||||||
if (field == &startIndexI || field == &cellCountI)
|
|
||||||
{
|
|
||||||
myAttr->m_minimum = 1;
|
|
||||||
myAttr->m_maximum = static_cast<int>(mainGrid->cellCountI());
|
|
||||||
}
|
}
|
||||||
else if (field == &startIndexJ || field == &cellCountJ)
|
else
|
||||||
{
|
{
|
||||||
myAttr->m_minimum = 1;
|
startIndexI.setUiName(QString("I Start"));
|
||||||
myAttr->m_maximum = static_cast<int>(mainGrid->cellCountJ());
|
startIndexJ.setUiName(QString("J Start"));
|
||||||
}
|
startIndexK.setUiName(QString("K Start"));
|
||||||
else if (field == &startIndexK || field == &cellCountK)
|
cellCountI.setUiName(QString(" Width"));
|
||||||
{
|
cellCountJ.setUiName(QString(" Width"));
|
||||||
myAttr->m_minimum = 1;
|
cellCountK.setUiName(QString(" Width"));
|
||||||
myAttr->m_maximum = static_cast<int>(mainGrid->cellCountK());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QList<caf::PdmOptionItemInfo> RimCellRangeFilter::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
||||||
|
{
|
||||||
|
QList<caf::PdmOptionItemInfo> options;
|
||||||
|
|
||||||
|
if (useOptionsOnly) (*useOptionsOnly) = true;
|
||||||
|
|
||||||
|
if (&gridIndex == fieldNeedingOptions)
|
||||||
|
{
|
||||||
|
RigMainGrid * mainGrid = NULL;
|
||||||
|
|
||||||
|
if (parentContainer() && parentContainer()->reservoirView() && parentContainer()->reservoirView()->eclipseCase() && parentContainer()->reservoirView()->eclipseCase()->reservoirData())
|
||||||
|
mainGrid = parentContainer()->reservoirView()->eclipseCase()->reservoirData()->mainGrid();
|
||||||
|
|
||||||
|
for (size_t gIdx = 0; gIdx < mainGrid->gridCount(); ++gIdx)
|
||||||
|
{
|
||||||
|
RigGridBase* grid = mainGrid->gridByIndex(gIdx);
|
||||||
|
QString gridName;
|
||||||
|
|
||||||
|
gridName += grid->gridName().c_str();
|
||||||
|
if (gIdx == 0)
|
||||||
|
{
|
||||||
|
if (gridName.isEmpty())
|
||||||
|
gridName += "Main Grid";
|
||||||
|
else
|
||||||
|
gridName += " (Main Grid)";
|
||||||
|
}
|
||||||
|
|
||||||
|
caf::PdmOptionItemInfo item(gridName, (int)gIdx);
|
||||||
|
options.push_back(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RigGridBase* RimCellRangeFilter::selectedGrid()
|
||||||
|
{
|
||||||
|
RigMainGrid* mainGrid = m_parentContainer->mainGrid();
|
||||||
|
CVF_ASSERT(mainGrid);
|
||||||
|
|
||||||
|
RigGridBase* grid = NULL;
|
||||||
|
if (gridIndex() >= mainGrid->gridCount())
|
||||||
|
{
|
||||||
|
gridIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
grid = mainGrid->gridByIndex(gridIndex());
|
||||||
|
CVF_ASSERT(grid);
|
||||||
|
return grid;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ namespace cvf
|
|||||||
|
|
||||||
class RimCellRangeFilterCollection;
|
class RimCellRangeFilterCollection;
|
||||||
class RigMainGrid;
|
class RigMainGrid;
|
||||||
|
class RigGridBase;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@@ -48,6 +49,8 @@ public:
|
|||||||
RimCellRangeFilterCollection* parentContainer();
|
RimCellRangeFilterCollection* parentContainer();
|
||||||
void setDefaultValues();
|
void setDefaultValues();
|
||||||
|
|
||||||
|
caf::PdmField<int> gridIndex; // The index of the grid that this filter applies to
|
||||||
|
|
||||||
caf::PdmField<int> startIndexI; // Eclipse indexing, first index is 1
|
caf::PdmField<int> startIndexI; // Eclipse indexing, first index is 1
|
||||||
caf::PdmField<int> startIndexJ; // Eclipse indexing, first index is 1
|
caf::PdmField<int> startIndexJ; // Eclipse indexing, first index is 1
|
||||||
caf::PdmField<int> startIndexK; // Eclipse indexing, first index is 1
|
caf::PdmField<int> startIndexK; // Eclipse indexing, first index is 1
|
||||||
@@ -62,7 +65,11 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
|
||||||
|
|
||||||
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
RigGridBase* selectedGrid();
|
||||||
|
|
||||||
RimCellRangeFilterCollection* m_parentContainer;
|
RimCellRangeFilterCollection* m_parentContainer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ void RimCellRangeFilterCollection::setReservoirView(RimReservoirView* reservoirV
|
|||||||
/// RimCellRangeFilter is using Eclipse 1-based indexing, adjust filter values before
|
/// RimCellRangeFilter is using Eclipse 1-based indexing, adjust filter values before
|
||||||
// populating cvf::CellRangeFilter (which is 0-based)
|
// populating cvf::CellRangeFilter (which is 0-based)
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimCellRangeFilterCollection::compoundCellRangeFilter(cvf::CellRangeFilter* cellRangeFilter) const
|
void RimCellRangeFilterCollection::compoundCellRangeFilter(cvf::CellRangeFilter* cellRangeFilter, const RigGridBase* grid) const
|
||||||
{
|
{
|
||||||
CVF_ASSERT(cellRangeFilter);
|
CVF_ASSERT(cellRangeFilter);
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ void RimCellRangeFilterCollection::compoundCellRangeFilter(cvf::CellRangeFilter*
|
|||||||
{
|
{
|
||||||
RimCellRangeFilter* rangeFilter = *it;
|
RimCellRangeFilter* rangeFilter = *it;
|
||||||
|
|
||||||
if (rangeFilter && rangeFilter->active)
|
if (rangeFilter && rangeFilter->active && rangeFilter->gridIndex() == grid->gridIndex())
|
||||||
{
|
{
|
||||||
if (rangeFilter->filterMode == RimCellFilter::INCLUDE)
|
if (rangeFilter->filterMode == RimCellFilter::INCLUDE)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "RimCellRangeFilter.h"
|
#include "RimCellRangeFilter.h"
|
||||||
|
|
||||||
class RigActiveCellInfo;
|
class RigActiveCellInfo;
|
||||||
|
class RigGridBase;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@@ -40,7 +41,7 @@ public:
|
|||||||
RimCellRangeFilter* createAndAppendRangeFilter();
|
RimCellRangeFilter* createAndAppendRangeFilter();
|
||||||
void remove(RimCellRangeFilter* rangeFilter);
|
void remove(RimCellRangeFilter* rangeFilter);
|
||||||
|
|
||||||
void compoundCellRangeFilter(cvf::CellRangeFilter* cellRangeFilter) const;
|
void compoundCellRangeFilter(cvf::CellRangeFilter* cellRangeFilter, const RigGridBase* grid) const;
|
||||||
bool hasActiveFilters() const;
|
bool hasActiveFilters() const;
|
||||||
|
|
||||||
void setReservoirView(RimReservoirView* reservoirView);
|
void setReservoirView(RimReservoirView* reservoirView);
|
||||||
|
|||||||
@@ -475,26 +475,34 @@ bool RigGridCellFaceVisibilityFilter::isFaceVisible(size_t i, size_t j, size_t k
|
|||||||
|
|
||||||
if (m_showExternalFaces)
|
if (m_showExternalFaces)
|
||||||
{
|
{
|
||||||
|
size_t cellIndex = m_grid->cellIndexFromIJK(i, j, k);
|
||||||
|
if (m_grid->cell(cellIndex).subGrid())
|
||||||
|
{
|
||||||
|
// Do not show any faces in the place where a LGR is present
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
size_t ni, nj, nk;
|
size_t ni, nj, nk;
|
||||||
cvf::StructGridInterface::neighborIJKAtCellFace(i, j, k, face, &ni, &nj, &nk);
|
cvf::StructGridInterface::neighborIJKAtCellFace(i, j, k, face, &ni, &nj, &nk);
|
||||||
|
|
||||||
|
// If the cell is on the edge of the grid, Interpret as having an invisible neighbour
|
||||||
if (ni >= m_grid->cellCountI() || nj >= m_grid->cellCountJ() || nk >= m_grid->cellCountK())
|
if (ni >= m_grid->cellCountI() || nj >= m_grid->cellCountJ() || nk >= m_grid->cellCountK())
|
||||||
{
|
{
|
||||||
// Detected cell on edge of grid
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t neighborCellIndex = m_grid->cellIndexFromIJK(ni, nj, nk);
|
size_t neighborCellIndex = m_grid->cellIndexFromIJK(ni, nj, nk);
|
||||||
const RigCell& neighborCell = m_grid->cell(neighborCellIndex);
|
|
||||||
if (neighborCell.subGrid())
|
// Do show the faces in the boarder between this grid and a possible LGR. Some of the LGR cells
|
||||||
|
// might not be visible.
|
||||||
|
if (m_grid->cell(neighborCellIndex).subGrid())
|
||||||
{
|
{
|
||||||
// Do not show face with a LGR neighbor. The subgrid will be responsible for displaying the face from the opposite side
|
return true;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the neighbour cell is invisible, we need to draw the face
|
||||||
if ((cellVisibility != NULL) && !(*cellVisibility)[neighborCellIndex])
|
if ((cellVisibility != NULL) && !(*cellVisibility)[neighborCellIndex])
|
||||||
{
|
{
|
||||||
// Neighbor cell is not part of visible cells
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,11 +78,11 @@ void CellRangeFilter::addCellInclude(size_t i, size_t j, size_t k)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool CellRangeFilter::isCellRejected(size_t i, size_t j, size_t k) const
|
bool CellRangeFilter::isCellVisible(size_t i, size_t j, size_t k) const
|
||||||
{
|
{
|
||||||
if (m_includeRanges.size() == 0)
|
if (m_includeRanges.size() == 0)
|
||||||
{
|
{
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t idx;
|
size_t idx;
|
||||||
@@ -90,7 +90,7 @@ bool CellRangeFilter::isCellRejected(size_t i, size_t j, size_t k) const
|
|||||||
{
|
{
|
||||||
if (m_excludeRanges[idx].isInRange(i, j, k))
|
if (m_excludeRanges[idx].isInRange(i, j, k))
|
||||||
{
|
{
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,12 +98,29 @@ bool CellRangeFilter::isCellRejected(size_t i, size_t j, size_t k) const
|
|||||||
{
|
{
|
||||||
if (m_includeRanges[idx].isInRange(i, j, k))
|
if (m_includeRanges[idx].isInRange(i, j, k))
|
||||||
{
|
{
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool CellRangeFilter::isCellExcluded(size_t i, size_t j, size_t k) const
|
||||||
|
{
|
||||||
|
for (size_t idx = 0; idx < m_excludeRanges.size(); idx++)
|
||||||
|
{
|
||||||
|
if (m_excludeRanges[idx].isInRange(i, j, k))
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -43,7 +43,11 @@ public:
|
|||||||
|
|
||||||
void addCellExcludeRange(size_t minI, size_t minJ, size_t minK, size_t maxI, size_t maxJ, size_t maxK);
|
void addCellExcludeRange(size_t minI, size_t minJ, size_t minK, size_t maxI, size_t maxJ, size_t maxK);
|
||||||
|
|
||||||
bool isCellRejected(size_t i, size_t j, size_t k) const;
|
//bool isCellRejected(size_t i, size_t j, size_t k) const;
|
||||||
|
|
||||||
|
bool isCellVisible(size_t i, size_t j, size_t k) const;
|
||||||
|
bool isCellExcluded(size_t i, size_t j, size_t k) const;
|
||||||
|
|
||||||
|
|
||||||
enum CellStateType
|
enum CellStateType
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user