mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#945 Use visible grid parts to force watertight faults
This commit is contained in:
parent
50c5ff8da4
commit
7d52242285
@ -1044,25 +1044,25 @@ void RivReservoirViewPartMgr::appendFaultsDynamicGeometryPartsToModel(cvf::Model
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RivCellSetEnum RivReservoirViewPartMgr::geometryTypeForFaultLabels(const std::vector<RivCellSetEnum>& geometryTypes, bool showFaultsOutsideFilters) const
|
RivCellSetEnum RivReservoirViewPartMgr::geometryTypeForFaultLabels(const std::set<RivCellSetEnum>& geometryTypes, bool showFaultsOutsideFilters) const
|
||||||
{
|
{
|
||||||
bool hasInactive = false;
|
bool hasInactive = false;
|
||||||
for (size_t i = 0; i < geometryTypes.size(); i++)
|
for (RivCellSetEnum cellSetType : geometryTypes)
|
||||||
{
|
{
|
||||||
if (!showFaultsOutsideFilters)
|
if (!showFaultsOutsideFilters)
|
||||||
{
|
{
|
||||||
if (geometryTypes[i] == PROPERTY_FILTERED)
|
if (cellSetType == PROPERTY_FILTERED)
|
||||||
{
|
{
|
||||||
return PROPERTY_FILTERED;
|
return PROPERTY_FILTERED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (geometryTypes[i] == RANGE_FILTERED)
|
if (cellSetType == RANGE_FILTERED)
|
||||||
{
|
{
|
||||||
return RANGE_FILTERED;
|
return RANGE_FILTERED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (geometryTypes[i] == INACTIVE)
|
if (cellSetType == INACTIVE)
|
||||||
{
|
{
|
||||||
hasInactive = true;
|
hasInactive = true;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ public:
|
|||||||
RimCellEdgeColors* cellEdgeResultColors);
|
RimCellEdgeColors* cellEdgeResultColors);
|
||||||
|
|
||||||
// Fault labels
|
// Fault labels
|
||||||
RivCellSetEnum geometryTypeForFaultLabels(const std::vector<RivCellSetEnum>& geometryTypes, bool showFaultsOutsideFilters) const;
|
RivCellSetEnum geometryTypeForFaultLabels(const std::set<RivCellSetEnum>& geometryTypes, bool showFaultsOutsideFilters) const;
|
||||||
void appendFaultLabelsStaticGeometryPartsToModel(cvf::ModelBasicList* model, RivCellSetEnum geometryType);
|
void appendFaultLabelsStaticGeometryPartsToModel(cvf::ModelBasicList* model, RivCellSetEnum geometryType);
|
||||||
void appendFaultLabelsDynamicGeometryPartsToModel(cvf::ModelBasicList* model, RivCellSetEnum geometryType, size_t frameIndex);
|
void appendFaultLabelsDynamicGeometryPartsToModel(cvf::ModelBasicList* model, RivCellSetEnum geometryType, size_t frameIndex);
|
||||||
|
|
||||||
|
@ -407,10 +407,12 @@ void RimEclipseView::createDisplayModel()
|
|||||||
|
|
||||||
if (faultCollection()->showFaultsOutsideFilters() || !this->eclipsePropertyFilterCollection()->hasActiveFilters() )
|
if (faultCollection()->showFaultsOutsideFilters() || !this->eclipsePropertyFilterCollection()->hasActiveFilters() )
|
||||||
{
|
{
|
||||||
forceWatertightGeometryOn();
|
for (RivCellSetEnum cellSetType : m_visibleGridParts)
|
||||||
|
{
|
||||||
std::vector<RivCellSetEnum> faultGeometryTypesToAppend = visibleFaultGeometryTypes();
|
m_reservoirGridPartManager->forceWatertightGeometryOnForType(cellSetType);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::set<RivCellSetEnum> faultGeometryTypesToAppend = allVisibleFaultGeometryTypes();
|
||||||
RivCellSetEnum faultLabelType = m_reservoirGridPartManager->geometryTypeForFaultLabels(faultGeometryTypesToAppend, faultCollection()->showFaultsOutsideFilters());
|
RivCellSetEnum faultLabelType = m_reservoirGridPartManager->geometryTypeForFaultLabels(faultGeometryTypesToAppend, faultCollection()->showFaultsOutsideFilters());
|
||||||
|
|
||||||
for (size_t frameIdx = 0; frameIdx < frameModels.size(); ++frameIdx)
|
for (size_t frameIdx = 0; frameIdx < frameModels.size(); ++frameIdx)
|
||||||
@ -530,35 +532,25 @@ void RimEclipseView::updateCurrentTimeStep()
|
|||||||
geometriesToRecolor.push_back( PROPERTY_FILTERED_WELL_CELLS);
|
geometriesToRecolor.push_back( PROPERTY_FILTERED_WELL_CELLS);
|
||||||
m_reservoirGridPartManager->appendDynamicGeometryPartsToModel(frameParts.p(), PROPERTY_FILTERED_WELL_CELLS, m_currentTimeStep, gridIndices);
|
m_reservoirGridPartManager->appendDynamicGeometryPartsToModel(frameParts.p(), PROPERTY_FILTERED_WELL_CELLS, m_currentTimeStep, gridIndices);
|
||||||
|
|
||||||
forceWatertightGeometryOn();
|
m_visibleGridParts = geometriesToRecolor;
|
||||||
|
|
||||||
if (faultCollection()->showFaultsOutsideFilters())
|
std::set<RivCellSetEnum> faultGeometryTypesToAppend = allVisibleFaultGeometryTypes();
|
||||||
|
for (RivCellSetEnum geometryType : faultGeometryTypesToAppend)
|
||||||
{
|
{
|
||||||
std::vector<RivCellSetEnum> faultGeometryTypesToAppend = visibleFaultGeometryTypes();
|
if (geometryType == PROPERTY_FILTERED || geometryType == PROPERTY_FILTERED_WELL_CELLS)
|
||||||
|
|
||||||
for (RivCellSetEnum geometryType : faultGeometryTypesToAppend)
|
|
||||||
{
|
{
|
||||||
if (geometryType == PROPERTY_FILTERED || geometryType == PROPERTY_FILTERED_WELL_CELLS)
|
m_reservoirGridPartManager->appendFaultsDynamicGeometryPartsToModel(frameParts.p(), geometryType, m_currentTimeStep);
|
||||||
{
|
m_reservoirGridPartManager->appendFaultLabelsDynamicGeometryPartsToModel(frameParts.p(), geometryType, m_currentTimeStep);
|
||||||
m_reservoirGridPartManager->appendFaultsDynamicGeometryPartsToModel(frameParts.p(), geometryType, m_currentTimeStep);
|
}
|
||||||
m_reservoirGridPartManager->appendFaultLabelsDynamicGeometryPartsToModel(frameParts.p(), geometryType, m_currentTimeStep);
|
else
|
||||||
}
|
{
|
||||||
else
|
m_reservoirGridPartManager->appendFaultsStaticGeometryPartsToModel(frameParts.p(), geometryType);
|
||||||
{
|
|
||||||
m_reservoirGridPartManager->appendFaultsStaticGeometryPartsToModel(frameParts.p(), geometryType);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RivCellSetEnum faultLabelType = m_reservoirGridPartManager->geometryTypeForFaultLabels(faultGeometryTypesToAppend, faultCollection()->showFaultsOutsideFilters());
|
|
||||||
m_reservoirGridPartManager->appendFaultLabelsStaticGeometryPartsToModel(frameParts.p(), faultLabelType);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
m_reservoirGridPartManager->appendFaultsDynamicGeometryPartsToModel(frameParts.p(), PROPERTY_FILTERED, m_currentTimeStep);
|
|
||||||
m_reservoirGridPartManager->appendFaultLabelsDynamicGeometryPartsToModel(frameParts.p(), PROPERTY_FILTERED, m_currentTimeStep);
|
|
||||||
|
|
||||||
m_reservoirGridPartManager->appendFaultsDynamicGeometryPartsToModel(frameParts.p(), PROPERTY_FILTERED_WELL_CELLS, m_currentTimeStep);
|
RivCellSetEnum faultLabelType = m_reservoirGridPartManager->geometryTypeForFaultLabels(faultGeometryTypesToAppend, faultCollection()->showFaultsOutsideFilters());
|
||||||
}
|
m_reservoirGridPartManager->appendFaultLabelsStaticGeometryPartsToModel(frameParts.p(), faultLabelType);
|
||||||
|
|
||||||
|
|
||||||
// Set the transparency on all the Wellcell parts before setting the result color
|
// Set the transparency on all the Wellcell parts before setting the result color
|
||||||
float opacity = static_cast< float> (1 - cvf::Math::clamp(this->wellCollection()->wellCellTransparencyLevel(), 0.0, 1.0));
|
float opacity = static_cast< float> (1 - cvf::Math::clamp(this->wellCollection()->wellCellTransparencyLevel(), 0.0, 1.0));
|
||||||
@ -600,8 +592,6 @@ void RimEclipseView::updateCurrentTimeStep()
|
|||||||
frameParts->updateBoundingBoxesRecursive();
|
frameParts->updateBoundingBoxesRecursive();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_visibleGridParts = geometriesToRecolor;
|
|
||||||
}
|
}
|
||||||
else if (this->rangeFilterCollection()->hasActiveFilters() && this->wellCollection()->hasVisibleWellCells())
|
else if (this->rangeFilterCollection()->hasActiveFilters() && this->wellCollection()->hasVisibleWellCells())
|
||||||
{
|
{
|
||||||
@ -1370,121 +1360,23 @@ void RimEclipseView::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEclipseView::forceWatertightGeometryOn()
|
std::set<RivCellSetEnum> RimEclipseView::allVisibleFaultGeometryTypes() const
|
||||||
{
|
{
|
||||||
if (this->viewController() && this->viewController()->isVisibleCellsOveridden())
|
std::set<RivCellSetEnum> faultGeoTypes;
|
||||||
|
faultGeoTypes.insert(m_visibleGridParts.begin(), m_visibleGridParts.end());
|
||||||
|
|
||||||
|
if (faultCollection()->showFaultsOutsideFilters())
|
||||||
{
|
{
|
||||||
m_reservoirGridPartManager->forceWatertightGeometryOnForType(OVERRIDDEN_CELL_VISIBILITY);
|
faultGeoTypes.insert(ACTIVE);
|
||||||
return;
|
faultGeoTypes.insert(ALL_WELL_CELLS);
|
||||||
}
|
|
||||||
|
|
||||||
// Force visibility of faults based on application state
|
if (showInactiveCells())
|
||||||
// As fault geometry is visible in grid visualization mode, fault geometry must be forced visible
|
|
||||||
// even if the fault item is disabled in project tree view
|
|
||||||
|
|
||||||
if (!faultCollection->showFaultCollection)
|
|
||||||
{
|
|
||||||
m_reservoirGridPartManager->forceWatertightGeometryOnForType(ALL_WELL_CELLS);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_reservoirGridPartManager->forceWatertightGeometryOnForType(RANGE_FILTERED);
|
|
||||||
m_reservoirGridPartManager->forceWatertightGeometryOnForType(VISIBLE_WELL_FENCE_CELLS);
|
|
||||||
m_reservoirGridPartManager->forceWatertightGeometryOnForType(VISIBLE_WELL_FENCE_CELLS_OUTSIDE_RANGE_FILTER);
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
std::vector<RivCellSetEnum> RimEclipseView::visibleFaultGeometryTypes() const
|
|
||||||
{
|
|
||||||
std::vector<RivCellSetEnum> faultParts;
|
|
||||||
if (this->viewController() && this->viewController()->isVisibleCellsOveridden())
|
|
||||||
{
|
|
||||||
if (this->faultCollection()->showFaultsOutsideFilters())
|
|
||||||
{
|
{
|
||||||
faultParts.push_back(ACTIVE);
|
faultGeoTypes.insert(INACTIVE);
|
||||||
faultParts.push_back(ALL_WELL_CELLS);
|
|
||||||
|
|
||||||
if (this->showInactiveCells())
|
|
||||||
{
|
|
||||||
faultParts.push_back(INACTIVE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
faultParts.push_back(OVERRIDDEN_CELL_VISIBILITY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (this->eclipsePropertyFilterCollection()->hasActiveFilters() && !faultCollection()->showFaultsOutsideFilters())
|
|
||||||
{
|
|
||||||
faultParts.push_back(PROPERTY_FILTERED);
|
|
||||||
faultParts.push_back(PROPERTY_FILTERED_WELL_CELLS);
|
|
||||||
|
|
||||||
if (this->showInactiveCells())
|
|
||||||
{
|
|
||||||
faultParts.push_back(INACTIVE);
|
|
||||||
faultParts.push_back(RANGE_FILTERED_INACTIVE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (this->faultCollection()->showFaultsOutsideFilters())
|
|
||||||
{
|
|
||||||
faultParts.push_back(ACTIVE);
|
|
||||||
faultParts.push_back(ALL_WELL_CELLS);
|
|
||||||
/// Why are these added ? JJS -->
|
|
||||||
faultParts.push_back(RANGE_FILTERED);
|
|
||||||
faultParts.push_back(RANGE_FILTERED_WELL_CELLS);
|
|
||||||
faultParts.push_back(VISIBLE_WELL_CELLS_OUTSIDE_RANGE_FILTER);
|
|
||||||
faultParts.push_back(VISIBLE_WELL_FENCE_CELLS_OUTSIDE_RANGE_FILTER);
|
|
||||||
/// <-- JJS
|
|
||||||
|
|
||||||
if (this->showInactiveCells())
|
|
||||||
{
|
|
||||||
faultParts.push_back(INACTIVE);
|
|
||||||
/// Why is this added ? JJS -->
|
|
||||||
faultParts.push_back(RANGE_FILTERED_INACTIVE);
|
|
||||||
/// <-- JJS
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (this->rangeFilterCollection()->hasActiveFilters() && this->wellCollection()->hasVisibleWellCells())
|
|
||||||
{
|
|
||||||
faultParts.push_back(RANGE_FILTERED);
|
|
||||||
faultParts.push_back(RANGE_FILTERED_WELL_CELLS);
|
|
||||||
faultParts.push_back(VISIBLE_WELL_CELLS_OUTSIDE_RANGE_FILTER);
|
|
||||||
faultParts.push_back(VISIBLE_WELL_FENCE_CELLS_OUTSIDE_RANGE_FILTER);
|
|
||||||
|
|
||||||
if (this->showInactiveCells())
|
|
||||||
{
|
|
||||||
faultParts.push_back(RANGE_FILTERED_INACTIVE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (!this->rangeFilterCollection()->hasActiveFilters() && this->wellCollection()->hasVisibleWellCells())
|
|
||||||
{
|
|
||||||
faultParts.push_back(VISIBLE_WELL_CELLS);
|
|
||||||
faultParts.push_back(VISIBLE_WELL_FENCE_CELLS);
|
|
||||||
}
|
|
||||||
else if (this->rangeFilterCollection()->hasActiveFilters() && !this->wellCollection()->hasVisibleWellCells())
|
|
||||||
{
|
|
||||||
faultParts.push_back(RANGE_FILTERED);
|
|
||||||
faultParts.push_back(RANGE_FILTERED_WELL_CELLS);
|
|
||||||
|
|
||||||
if (this->showInactiveCells())
|
|
||||||
{
|
|
||||||
faultParts.push_back(RANGE_FILTERED_INACTIVE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
faultParts.push_back(ACTIVE);
|
|
||||||
faultParts.push_back(ALL_WELL_CELLS);
|
|
||||||
|
|
||||||
if (this->showInactiveCells())
|
|
||||||
{
|
|
||||||
faultParts.push_back(INACTIVE);
|
|
||||||
faultParts.push_back(RANGE_FILTERED_INACTIVE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return faultParts;
|
return faultGeoTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -1492,20 +1384,19 @@ std::vector<RivCellSetEnum> RimEclipseView::visibleFaultGeometryTypes() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEclipseView::updateFaultColors()
|
void RimEclipseView::updateFaultColors()
|
||||||
{
|
{
|
||||||
// Update all fault geometry
|
std::set<RivCellSetEnum> faultGeometriesToRecolor = allVisibleFaultGeometryTypes();
|
||||||
std::vector<RivCellSetEnum> faultGeometriesToRecolor = visibleFaultGeometryTypes();
|
|
||||||
|
|
||||||
RimEclipseCellColors* faultResultColors = currentFaultResultColors();
|
RimEclipseCellColors* faultResultColors = currentFaultResultColors();
|
||||||
|
|
||||||
for (size_t i = 0; i < faultGeometriesToRecolor.size(); ++i)
|
for (RivCellSetEnum cellSetType : faultGeometriesToRecolor)
|
||||||
{
|
{
|
||||||
if (this->hasUserRequestedAnimation() && this->cellEdgeResult()->hasResult())
|
if (this->hasUserRequestedAnimation() && this->cellEdgeResult()->hasResult())
|
||||||
{
|
{
|
||||||
m_reservoirGridPartManager->updateFaultCellEdgeResultColor(faultGeometriesToRecolor[i], m_currentTimeStep, faultResultColors, this->cellEdgeResult());
|
m_reservoirGridPartManager->updateFaultCellEdgeResultColor(cellSetType, m_currentTimeStep, faultResultColors, this->cellEdgeResult());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_reservoirGridPartManager->updateFaultColors(faultGeometriesToRecolor[i], m_currentTimeStep, faultResultColors);
|
m_reservoirGridPartManager->updateFaultColors(cellSetType, m_currentTimeStep, faultResultColors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,8 +162,7 @@ private:
|
|||||||
virtual void resetLegendsInViewer();
|
virtual void resetLegendsInViewer();
|
||||||
virtual void updateViewerWidgetWindowTitle();
|
virtual void updateViewerWidgetWindowTitle();
|
||||||
|
|
||||||
std::vector<RivCellSetEnum> visibleFaultGeometryTypes() const;
|
std::set<RivCellSetEnum> allVisibleFaultGeometryTypes() const;
|
||||||
void forceWatertightGeometryOn();
|
|
||||||
void updateFaultColors();
|
void updateFaultColors();
|
||||||
|
|
||||||
void syncronizeWellsWithResults();
|
void syncronizeWellsWithResults();
|
||||||
|
Loading…
Reference in New Issue
Block a user