mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1440 Remove all real caching in the well path geometry system
Had no effect anyway. Rename method to scheduleRedrawAffectedViews()
This commit is contained in:
@@ -171,8 +171,7 @@ void RicNewFishbonesSubsFeature::askUserToSetUsefulScaling(RimFishbonesCollectio
|
||||
if (autoAdjustSettings)
|
||||
{
|
||||
activeView->setScaleZAndUpdate(1.0);
|
||||
|
||||
wellPathColl->scheduleGeometryRegenAndRedrawViews();
|
||||
activeView->scheduleCreateDisplayModelAndRedraw();
|
||||
|
||||
RiuMainWindow::instance()->updateScaleValue();
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ void RicNewPerforationIntervalAtMeasuredDepthFeature::onActionTriggered(bool isC
|
||||
wellPath->firstAncestorOrThisOfTypeAsserted(wellPathCollection);
|
||||
|
||||
wellPathCollection->uiCapability()->updateConnectedEditors();
|
||||
wellPathCollection->scheduleGeometryRegenAndRedrawViews();
|
||||
wellPathCollection->scheduleRedrawAffectedViews();
|
||||
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(perforationInterval);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ void RicNewPerforationIntervalFeature::onActionTriggered(bool isChecked)
|
||||
if (!wellPathCollection) return;
|
||||
|
||||
wellPathCollection->uiCapability()->updateConnectedEditors();
|
||||
wellPathCollection->scheduleGeometryRegenAndRedrawViews();
|
||||
wellPathCollection->scheduleRedrawAffectedViews();
|
||||
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(perforationInterval);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ void RicDeleteItemExec::redo()
|
||||
|
||||
if (wellPathColl)
|
||||
{
|
||||
wellPathColl->scheduleGeometryRegenAndRedrawViews();
|
||||
wellPathColl->scheduleRedrawAffectedViews();
|
||||
wellPathColl->uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ void RicDeleteSubItemsFeature::onActionTriggered(bool isChecked)
|
||||
wellPathColl->deleteAllWellPaths();
|
||||
|
||||
wellPathColl->updateConnectedEditors();
|
||||
wellPathColl->scheduleGeometryRegenAndRedrawViews();
|
||||
wellPathColl->scheduleRedrawAffectedViews();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ void RicWellPathDeleteFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
|
||||
wellPathCollection->uiCapability()->updateConnectedEditors();
|
||||
wellPathCollection->scheduleGeometryRegenAndRedrawViews();
|
||||
wellPathCollection->scheduleRedrawAffectedViews();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -62,8 +62,6 @@ RivWellPathPartMgr::RivWellPathPartMgr(RimWellPath* wellPath)
|
||||
{
|
||||
m_rimWellPath = wellPath;
|
||||
|
||||
m_needsTransformUpdate = true;
|
||||
|
||||
// Setup a scalar mapper
|
||||
cvf::ref<cvf::ScalarMapperDiscreteLinear> scalarMapper = new cvf::ScalarMapperDiscreteLinear;
|
||||
cvf::Color3ubArray legendColors;
|
||||
@@ -98,23 +96,12 @@ RivWellPathPartMgr::~RivWellPathPartMgr()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellPathPartMgr::appendFishbonesPartsToModel(cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize)
|
||||
{
|
||||
if (!m_rimWellPath || !m_rimWellPath->fishbonesCollection()->isChecked()) return;
|
||||
if ( !m_rimWellPath || !m_rimWellPath->fishbonesCollection()->isChecked() ) return;
|
||||
|
||||
// This concept is taken from RivReservoirSimWellsPartMgr, and is required to be able to have
|
||||
// separate part managers for each view
|
||||
if (m_fishbonesPartMgrs.size() != m_rimWellPath->fishbonesCollection()->fishbonesSubs.size())
|
||||
for ( auto rimFishboneSubs : m_rimWellPath->fishbonesCollection()->fishbonesSubs() )
|
||||
{
|
||||
m_fishbonesPartMgrs.clear();
|
||||
|
||||
for (auto rimFishboneSubs : m_rimWellPath->fishbonesCollection()->fishbonesSubs())
|
||||
{
|
||||
m_fishbonesPartMgrs.push_back(new RivFishbonesSubsPartMgr(rimFishboneSubs));
|
||||
}
|
||||
}
|
||||
|
||||
for (auto rivFishbonesPartManager : m_fishbonesPartMgrs)
|
||||
{
|
||||
rivFishbonesPartManager->appendGeometryPartsToModel(model, displayCoordTransform, characteristicCellSize);
|
||||
cvf::ref<RivFishbonesSubsPartMgr> fishbSubPartMgr = new RivFishbonesSubsPartMgr(rimFishboneSubs);
|
||||
fishbSubPartMgr->appendGeometryPartsToModel(model, displayCoordTransform, characteristicCellSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,7 +329,6 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di
|
||||
m_wellLabelPart = part;
|
||||
}
|
||||
|
||||
m_needsTransformUpdate = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -365,11 +351,8 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m
|
||||
if (wellPathCollection->wellPathVisibility() != RimWellPathCollection::FORCE_ALL_ON && m_rimWellPath->showWellPath() == false )
|
||||
return;
|
||||
|
||||
if (m_needsTransformUpdate)
|
||||
{
|
||||
// The pipe geometry needs to be rebuilt on scale change to keep the pipes round
|
||||
buildWellPathParts(displayCoordTransform, characteristicCellSize, wellPathClipBoundingBox);
|
||||
}
|
||||
// The pipe geometry needs to be rebuilt on scale change to keep the pipes round
|
||||
buildWellPathParts(displayCoordTransform, characteristicCellSize, wellPathClipBoundingBox);
|
||||
|
||||
if (m_pipeBranchData.m_surfacePart.notNull())
|
||||
{
|
||||
@@ -415,16 +398,6 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList*
|
||||
appendPerforationsToModel(timeStamp, model, displayCoordTransform, characteristicCellSize);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellPathPartMgr::scheduleGeometryRegen()
|
||||
{
|
||||
m_needsTransformUpdate = true;
|
||||
|
||||
m_fishbonesPartMgrs.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -52,8 +52,6 @@ public:
|
||||
explicit RivWellPathPartMgr(RimWellPath* wellPath);
|
||||
~RivWellPathPartMgr();
|
||||
|
||||
void scheduleGeometryRegen();
|
||||
|
||||
void appendStaticGeometryPartsToModel(cvf::ModelBasicList* model,
|
||||
double characteristicCellSize,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox,
|
||||
@@ -92,8 +90,6 @@ private:
|
||||
private:
|
||||
caf::PdmPointer<RimWellPath> m_rimWellPath;
|
||||
|
||||
bool m_needsTransformUpdate;
|
||||
|
||||
struct RivPipeBranchData
|
||||
{
|
||||
cvf::ref<RivPipeGeometryGenerator> m_pipeGeomGenerator;
|
||||
@@ -110,5 +106,4 @@ private:
|
||||
cvf::ref<cvf::Effect> m_scalarMapperSurfaceEffect;
|
||||
cvf::ref<cvf::Effect> m_scalarMapperMeshEffect;
|
||||
|
||||
cvf::Collection<RivFishbonesSubsPartMgr> m_fishbonesPartMgrs;
|
||||
};
|
||||
|
||||
@@ -612,8 +612,6 @@ void RimView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QV
|
||||
RimOilField* oilFields = RiaApplication::instance()->project() ? RiaApplication::instance()->project()->activeOilField() : NULL;
|
||||
RimWellPathCollection* wellPathCollection = (oilFields) ? oilFields->wellPathCollection() : NULL;
|
||||
|
||||
wellPathsPartManager()->scheduleGeometryRegen();
|
||||
|
||||
crossSectionCollection->updateIntersectionBoxGeometry();
|
||||
|
||||
if (m_viewer)
|
||||
|
||||
@@ -248,8 +248,6 @@ RivWellPathPartMgr* RimWellPath::partMgr()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPath::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
partMgr()->scheduleGeometryRegen();
|
||||
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfTypeAsserted(proj);
|
||||
if (changedField == &showWellPath)
|
||||
|
||||
@@ -111,7 +111,7 @@ RimWellPathCollection::~RimWellPathCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
scheduleGeometryRegenAndRedrawViews();
|
||||
scheduleRedrawAffectedViews();
|
||||
}
|
||||
|
||||
|
||||
@@ -323,25 +323,13 @@ caf::PdmFieldHandle* RimWellPathCollection::objectToggleField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCollection::scheduleGeometryRegenAndRedrawViews()
|
||||
void RimWellPathCollection::scheduleRedrawAffectedViews()
|
||||
{
|
||||
this->scheduleGeometryRegen();
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfType(proj);
|
||||
if (proj) proj->createDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCollection::scheduleGeometryRegen()
|
||||
{
|
||||
for (size_t wIdx = 0; wIdx < this->wellPaths.size(); wIdx++)
|
||||
{
|
||||
this->wellPaths[wIdx]->partMgr()->scheduleGeometryRegen();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -93,8 +93,7 @@ public:
|
||||
RimWellPath* wellPathByName(const QString& wellPathName) const;
|
||||
void addWellLogs(const QStringList& filePaths);
|
||||
|
||||
void scheduleGeometryRegenAndRedrawViews();
|
||||
void scheduleGeometryRegen();
|
||||
void scheduleRedrawAffectedViews();
|
||||
|
||||
void appendStaticGeometryPartsToModel(cvf::ModelBasicList* model,
|
||||
double characteristicCellSize,
|
||||
|
||||
Reference in New Issue
Block a user