mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
MswRollUp: Final commit: Reapplying changes and bugfixes from trunk in conflicting files.
The changes are from changelist numbers: 22190, 22189, 22154, 22151, 22141, 22124, 22010 Now It is supposed to compile again. p4#: 22231
This commit is contained in:
@@ -435,6 +435,9 @@ void RimReservoirView::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
}
|
||||
else if ( changedField == &showInactiveCells )
|
||||
{
|
||||
m_reservoirGridPartManager->scheduleGeometryRegen(RivReservoirViewPartMgr::INACTIVE);
|
||||
m_reservoirGridPartManager->scheduleGeometryRegen(RivReservoirViewPartMgr::RANGE_FILTERED_INACTIVE);
|
||||
|
||||
createDisplayModelAndRedraw();
|
||||
}
|
||||
else if ( changedField == &showMainGrid )
|
||||
@@ -675,6 +678,22 @@ void RimReservoirView::updateCurrentTimeStep()
|
||||
float opacity = static_cast< float> (1 - cvf::Math::clamp(this->wellCollection()->wellCellTransparencyLevel(), 0.0, 1.0));
|
||||
m_reservoirGridPartManager->updateCellColor(RivReservoirViewPartMgr::PROPERTY_FILTERED_WELL_CELLS, m_currentTimeStep, cvf::Color4f(cvf::Color3f(cvf::Color3::WHITE), opacity));
|
||||
|
||||
|
||||
if (this->showInactiveCells())
|
||||
{
|
||||
std::vector<size_t> gridIndices;
|
||||
this->indicesToVisibleGrids(&gridIndices);
|
||||
|
||||
if (this->rangeFilterCollection()->hasActiveFilters() || this->wellCollection()->hasVisibleWellCells())
|
||||
{
|
||||
m_reservoirGridPartManager->appendStaticGeometryPartsToModel(frameParts.p(), RivReservoirViewPartMgr::RANGE_FILTERED_INACTIVE, gridIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_reservoirGridPartManager->appendStaticGeometryPartsToModel(frameParts.p(), RivReservoirViewPartMgr::INACTIVE, gridIndices);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_viewer)
|
||||
{
|
||||
cvf::Scene* frameScene = m_viewer->frame(m_currentTimeStep);
|
||||
|
||||
@@ -148,12 +148,18 @@ bool RimWell::calculateWellPipeVisibility(size_t frameIndex)
|
||||
if (m_reservoirView == NULL) return false;
|
||||
if (this->wellResults() == NULL) return false;
|
||||
|
||||
if ( this->wellResults()->firstResultTimeStep() == cvf::UNDEFINED_SIZE_T
|
||||
|| frameIndex < this->wellResults()->firstResultTimeStep()
|
||||
|| frameIndex >= this->wellResults()->m_wellCellsTimeSteps.size())
|
||||
if (frameIndex >= this->wellResults()->m_resultTimeStepIndexToWellTimeStepIndex.size())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_reservoirView->wellCollection()->active())
|
||||
size_t wellTimeStepIndex = this->wellResults()->m_resultTimeStepIndexToWellTimeStepIndex[frameIndex];
|
||||
if (wellTimeStepIndex == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_reservoirView->wellCollection()->isActive())
|
||||
return false;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimWellCollection::PIPES_FORCE_ALL_ON)
|
||||
|
||||
@@ -66,6 +66,16 @@ namespace caf
|
||||
}
|
||||
}
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void RimWellCollection::WellHeadPositionEnum::setUp()
|
||||
{
|
||||
addItem(RimWellCollection::WELLHEAD_POS_ACTIVE_CELLS_BB, "WELLHEAD_POS_ACTIVE_CELLS_BB", "Top of active cells BB");
|
||||
addItem(RimWellCollection::WELLHEAD_POS_TOP_COLUMN, "WELLHEAD_POS_TOP_COLUMN", "Top of active cells IJ-column");
|
||||
setDefault(RimWellCollection::WELLHEAD_POS_TOP_COLUMN);
|
||||
}
|
||||
}
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellCollection, "Wells");
|
||||
|
||||
@@ -76,12 +86,13 @@ RimWellCollection::RimWellCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("Wells", ":/WellCollection.png", "", "");
|
||||
|
||||
CAF_PDM_InitField(&active, "Active", true, "Active", "", "", "");
|
||||
active.setUiHidden(true);
|
||||
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
|
||||
isActive.setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&showWellHead, "ShowWellHead", true, "Show well heads", "", "", "");
|
||||
CAF_PDM_InitField(&showWellLabel, "ShowWellLabel", true, "Show well labels", "", "", "");
|
||||
CAF_PDM_InitField(&wellHeadScaleFactor, "WellHeadScale", 1.0, "Well head scale", "", "", "");
|
||||
CAF_PDM_InitField(&wellHeadPosition, "WellHeadPosition", WellHeadPositionEnum(WELLHEAD_POS_TOP_COLUMN), "Well head position", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&wellPipeVisibility, "GlobalWellPipeVisibility", WellVisibilityEnum(PIPES_OPEN_IN_VISIBLE_CELLS), "Global well pipe visibility", "", "", "");
|
||||
|
||||
@@ -130,6 +141,7 @@ RimWell* RimWellCollection::findWell(QString name)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellCollection::hasVisibleWellCells()
|
||||
{
|
||||
if (!this->isActive()) return false;
|
||||
if (this->wellCellsToRangeFilterMode() == RANGE_ADD_NONE) return false;
|
||||
if (this->wells().size() == 0 ) return false;
|
||||
|
||||
@@ -164,7 +176,7 @@ bool RimWellCollection::hasVisibleWellCells()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellCollection::hasVisibleWellPipes()
|
||||
{
|
||||
if (!this->active()) return false;
|
||||
if (!this->isActive()) return false;
|
||||
if (this->wellPipeVisibility() == PIPES_FORCE_ALL_OFF) return false;
|
||||
if (this->wells().size() == 0 ) return false;
|
||||
if (this->wellPipeVisibility() == PIPES_FORCE_ALL_ON) return true;
|
||||
@@ -178,12 +190,13 @@ bool RimWellCollection::hasVisibleWellPipes()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
if (&showWellLabel == changedField || &active == changedField)
|
||||
if (&showWellLabel == changedField || &isActive == changedField)
|
||||
{
|
||||
this->updateUiIconFromState(active);
|
||||
this->updateUiIconFromState(isActive);
|
||||
|
||||
if (m_reservoirView)
|
||||
{
|
||||
m_reservoirView->scheduleGeometryRegen(RivReservoirViewPartMgr::VISIBLE_WELL_CELLS);
|
||||
m_reservoirView->createDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
@@ -229,7 +242,8 @@ void RimWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField
|
||||
|| &pipeRadiusScaleFactor == changedField
|
||||
|| &wellHeadScaleFactor == changedField
|
||||
|| &showWellHead == changedField
|
||||
|| &isAutoDetectingBranches == changedField)
|
||||
|| &isAutoDetectingBranches == changedField
|
||||
|| &wellHeadPosition == changedField)
|
||||
{
|
||||
if (m_reservoirView)
|
||||
{
|
||||
@@ -276,7 +290,7 @@ void RimWellCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimWellCollection::objectToggleField()
|
||||
{
|
||||
return &active;
|
||||
return &isActive;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user