mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#401) WIP: Refactoring Linked views update system.
Preparing for linking of visible Cells.
This commit is contained in:
parent
665d233c38
commit
f81cf98580
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
enum RivCellSetEnum
|
enum RivCellSetEnum
|
||||||
{
|
{
|
||||||
|
OVERRIDDEN_CELL_VISIBILITY, ////< Use the total visibility from a different case directly
|
||||||
ALL_CELLS,
|
ALL_CELLS,
|
||||||
ACTIVE, ///< All Active cells without ALL_WELL_CELLS
|
ACTIVE, ///< All Active cells without ALL_WELL_CELLS
|
||||||
ALL_WELL_CELLS, ///< All cells ever having a connection to a well (Might be inactive cells as well. Wellhead cells typically)
|
ALL_WELL_CELLS, ///< All cells ever having a connection to a well (Might be inactive cells as well. Wellhead cells typically)
|
||||||
|
@ -155,7 +155,7 @@ void RimCellRangeFilterCollection::updateDisplayModeNotifyManagedViews()
|
|||||||
view->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
view->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
||||||
|
|
||||||
view->scheduleCreateDisplayModelAndRedraw();
|
view->scheduleCreateDisplayModelAndRedraw();
|
||||||
|
/*
|
||||||
RimProject* proj = NULL;
|
RimProject* proj = NULL;
|
||||||
view->firstAnchestorOrThisOfType(proj);
|
view->firstAnchestorOrThisOfType(proj);
|
||||||
|
|
||||||
@ -164,6 +164,7 @@ void RimCellRangeFilterCollection::updateDisplayModeNotifyManagedViews()
|
|||||||
{
|
{
|
||||||
viewLinker->updateRangeFilters();
|
viewLinker->updateRangeFilters();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -149,9 +149,11 @@ void RimEclipsePropertyFilterCollection::updateDisplayModelNotifyManagedViews()
|
|||||||
RimProject* proj = NULL;
|
RimProject* proj = NULL;
|
||||||
view->firstAnchestorOrThisOfType(proj);
|
view->firstAnchestorOrThisOfType(proj);
|
||||||
|
|
||||||
|
/*
|
||||||
RimViewLinker* viewLinker = proj->findViewLinkerFromView(view);
|
RimViewLinker* viewLinker = proj->findViewLinkerFromView(view);
|
||||||
if (viewLinker)
|
if (viewLinker)
|
||||||
{
|
{
|
||||||
viewLinker->updatePropertyFilters();
|
viewLinker->updatePropertyFilters();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include "RimViewLinker.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -835,7 +836,13 @@ RigActiveCellInfo* RimEclipseView::currentActiveCellInfo()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEclipseView::scheduleGeometryRegen(RivCellSetEnum geometryType)
|
void RimEclipseView::scheduleGeometryRegen(RivCellSetEnum geometryType)
|
||||||
{
|
{
|
||||||
m_reservoirGridPartManager->scheduleGeometryRegen(static_cast<RivCellSetEnum>(geometryType));
|
m_reservoirGridPartManager->scheduleGeometryRegen(geometryType);
|
||||||
|
|
||||||
|
RimViewLinker* viewLinker = viewLinkerWithDepViews();
|
||||||
|
if (viewLinker)
|
||||||
|
{
|
||||||
|
viewLinker->scheduleGeometryRegenForDepViews(geometryType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -1536,4 +1543,7 @@ const RimEclipsePropertyFilterCollection* RimEclipseView::propertyFilterCollecti
|
|||||||
void RimEclipseView::setOverridePropertyFilterCollection(RimEclipsePropertyFilterCollection* pfc)
|
void RimEclipseView::setOverridePropertyFilterCollection(RimEclipsePropertyFilterCollection* pfc)
|
||||||
{
|
{
|
||||||
m_overridePropertyFilterCollection = pfc;
|
m_overridePropertyFilterCollection = pfc;
|
||||||
|
|
||||||
|
this->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||||
|
this->scheduleCreateDisplayModelAndRedraw();
|
||||||
}
|
}
|
||||||
|
@ -151,9 +151,11 @@ void RimGeoMechPropertyFilterCollection::updateDisplayModelNotifyManagedViews()
|
|||||||
RimProject* proj = NULL;
|
RimProject* proj = NULL;
|
||||||
view->firstAnchestorOrThisOfType(proj);
|
view->firstAnchestorOrThisOfType(proj);
|
||||||
|
|
||||||
|
/*
|
||||||
RimViewLinker* viewLinker = proj->findViewLinkerFromView(view);
|
RimViewLinker* viewLinker = proj->findViewLinkerFromView(view);
|
||||||
if (viewLinker)
|
if (viewLinker)
|
||||||
{
|
{
|
||||||
viewLinker->updatePropertyFilters();
|
viewLinker->updatePropertyFilters();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
#include "cvfqtUtils.h"
|
#include "cvfqtUtils.h"
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include "RimViewLinker.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -514,6 +515,12 @@ RimCase* RimGeoMechView::ownerCase()
|
|||||||
void RimGeoMechView::scheduleGeometryRegen(RivCellSetEnum geometryType)
|
void RimGeoMechView::scheduleGeometryRegen(RivCellSetEnum geometryType)
|
||||||
{
|
{
|
||||||
m_vizLogic->scheduleGeometryRegen(geometryType);
|
m_vizLogic->scheduleGeometryRegen(geometryType);
|
||||||
|
|
||||||
|
RimViewLinker* viewLinker = viewLinkerWithDepViews();
|
||||||
|
if (viewLinker)
|
||||||
|
{
|
||||||
|
viewLinker->scheduleGeometryRegenForDepViews(geometryType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -522,6 +529,9 @@ void RimGeoMechView::scheduleGeometryRegen(RivCellSetEnum geometryType)
|
|||||||
void RimGeoMechView::setOverridePropertyFilterCollection(RimGeoMechPropertyFilterCollection* pfc)
|
void RimGeoMechView::setOverridePropertyFilterCollection(RimGeoMechPropertyFilterCollection* pfc)
|
||||||
{
|
{
|
||||||
m_overridePropertyFilterCollection = pfc;
|
m_overridePropertyFilterCollection = pfc;
|
||||||
|
|
||||||
|
this->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||||
|
this->scheduleCreateDisplayModelAndRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -191,6 +191,11 @@ void RimView::updateViewerWidget()
|
|||||||
void RimView::scheduleCreateDisplayModelAndRedraw()
|
void RimView::scheduleCreateDisplayModelAndRedraw()
|
||||||
{
|
{
|
||||||
RiaApplication::instance()->scheduleDisplayModelUpdateAndRedraw(this);
|
RiaApplication::instance()->scheduleDisplayModelUpdateAndRedraw(this);
|
||||||
|
RimViewLinker* viewLinker = viewLinkerWithDepViews();
|
||||||
|
if (viewLinker)
|
||||||
|
{
|
||||||
|
viewLinker->scheduleCreateDisplayModelAndRedrawForDependentViews();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -563,6 +568,10 @@ const RimCellRangeFilterCollection* RimView::rangeFilterCollection() const
|
|||||||
void RimView::setOverrideRangeFilterCollection(RimCellRangeFilterCollection* rfc)
|
void RimView::setOverrideRangeFilterCollection(RimCellRangeFilterCollection* rfc)
|
||||||
{
|
{
|
||||||
m_overrideRangeFilterCollection = rfc;
|
m_overrideRangeFilterCollection = rfc;
|
||||||
|
this->scheduleGeometryRegen(RANGE_FILTERED);
|
||||||
|
this->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
||||||
|
|
||||||
|
this->scheduleCreateDisplayModelAndRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -709,7 +718,7 @@ bool RimView::isBoundingBoxesOverlappingOrClose(const cvf::BoundingBox& sourceBB
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimViewLinker* RimView::dependentViews()
|
RimViewLinker* RimView::viewLinkerWithDepViews()
|
||||||
{
|
{
|
||||||
RimViewLinker* viewLinker = NULL;
|
RimViewLinker* viewLinker = NULL;
|
||||||
std::vector<caf::PdmObjectHandle*> reffingObjs;
|
std::vector<caf::PdmObjectHandle*> reffingObjs;
|
||||||
|
@ -129,7 +129,7 @@ public:
|
|||||||
virtual caf::PdmFieldHandle* userDescriptionField() { return &name; }
|
virtual caf::PdmFieldHandle* userDescriptionField() { return &name; }
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
RimViewLinker* dependentViews();
|
RimViewLinker* viewLinkerWithDepViews();
|
||||||
void setDefaultView();
|
void setDefaultView();
|
||||||
|
|
||||||
void addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
|
void addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
|
||||||
|
@ -217,6 +217,7 @@ void RimViewLink::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
|
|||||||
else if (&syncVisibleCells == changedField)
|
else if (&syncVisibleCells == changedField)
|
||||||
{
|
{
|
||||||
updateOptionSensitivity();
|
updateOptionSensitivity();
|
||||||
|
configureOverridesUpdateDisplayModel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,7 +259,7 @@ void RimViewLink::configureOverridesUpdateDisplayModel()
|
|||||||
configureOverrides();
|
configureOverrides();
|
||||||
|
|
||||||
// This update scheduling actually schedules update in the master view (not the managed view). Is that intentional ? JJS
|
// This update scheduling actually schedules update in the master view (not the managed view). Is that intentional ? JJS
|
||||||
|
/*
|
||||||
if (m_managedView)
|
if (m_managedView)
|
||||||
{
|
{
|
||||||
m_managedView->rangeFilterCollection()->updateDisplayModeNotifyManagedViews();
|
m_managedView->rangeFilterCollection()->updateDisplayModeNotifyManagedViews();
|
||||||
@ -275,7 +276,7 @@ void RimViewLink::configureOverridesUpdateDisplayModel()
|
|||||||
{
|
{
|
||||||
geoView->propertyFilterCollection()->updateDisplayModelNotifyManagedViews();
|
geoView->propertyFilterCollection()->updateDisplayModelNotifyManagedViews();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
// Todo : Notify the managed view of the possible change of visualCellsOverride
|
// Todo : Notify the managed view of the possible change of visualCellsOverride
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,12 +44,13 @@ public:
|
|||||||
RimView* managedView();
|
RimView* managedView();
|
||||||
void setManagedView(RimView* view);
|
void setManagedView(RimView* view);
|
||||||
|
|
||||||
|
// Linked (both ways) properties
|
||||||
caf::PdmField<bool> syncCamera;
|
caf::PdmField<bool> syncCamera;
|
||||||
caf::PdmField<bool> syncTimeStep;
|
caf::PdmField<bool> syncTimeStep;
|
||||||
|
|
||||||
|
// Overridden properties
|
||||||
caf::PdmField<bool> syncCellResult;
|
caf::PdmField<bool> syncCellResult;
|
||||||
|
|
||||||
caf::PdmField<bool> syncVisibleCells;
|
caf::PdmField<bool> syncVisibleCells;
|
||||||
|
|
||||||
caf::PdmField<bool> syncRangeFilters;
|
caf::PdmField<bool> syncRangeFilters;
|
||||||
caf::PdmField<bool> syncPropertyFilters;
|
caf::PdmField<bool> syncPropertyFilters;
|
||||||
|
|
||||||
|
@ -172,6 +172,11 @@ void RimViewLinker::updateRangeFilters()
|
|||||||
{
|
{
|
||||||
if (!isActive()) return;
|
if (!isActive()) return;
|
||||||
|
|
||||||
|
this->scheduleGeometryRegenForDepViews(RANGE_FILTERED);
|
||||||
|
this->scheduleGeometryRegenForDepViews(RANGE_FILTERED_INACTIVE);
|
||||||
|
this->scheduleCreateDisplayModelAndRedrawForDependentViews();
|
||||||
|
|
||||||
|
#if 0
|
||||||
for (size_t i = 0; i < viewLinks.size(); i++)
|
for (size_t i = 0; i < viewLinks.size(); i++)
|
||||||
{
|
{
|
||||||
RimViewLink* managedViewConfig = viewLinks[i];
|
RimViewLink* managedViewConfig = viewLinks[i];
|
||||||
@ -200,6 +205,7 @@ void RimViewLinker::updateRangeFilters()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -208,7 +214,11 @@ void RimViewLinker::updateRangeFilters()
|
|||||||
void RimViewLinker::updatePropertyFilters()
|
void RimViewLinker::updatePropertyFilters()
|
||||||
{
|
{
|
||||||
if (!isActive()) return;
|
if (!isActive()) return;
|
||||||
|
this->scheduleGeometryRegenForDepViews(RANGE_FILTERED);
|
||||||
|
this->scheduleGeometryRegenForDepViews(RANGE_FILTERED_INACTIVE);
|
||||||
|
this->scheduleCreateDisplayModelAndRedrawForDependentViews();
|
||||||
|
|
||||||
|
#if 0
|
||||||
for (size_t i = 0; i < viewLinks.size(); i++)
|
for (size_t i = 0; i < viewLinks.size(); i++)
|
||||||
{
|
{
|
||||||
RimViewLink* managedViewConfig = viewLinks[i];
|
RimViewLink* managedViewConfig = viewLinks[i];
|
||||||
@ -235,6 +245,7 @@ void RimViewLinker::updatePropertyFilters()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -459,3 +470,47 @@ void RimViewLinker::setNameAndIcon()
|
|||||||
m_originalIcon = icon;
|
m_originalIcon = icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimViewLinker::scheduleGeometryRegenForDepViews(RivCellSetEnum geometryType)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < viewLinks.size(); i++)
|
||||||
|
{
|
||||||
|
if ( viewLinks[i]->syncVisibleCells()
|
||||||
|
|| viewLinks[i]->syncPropertyFilters()
|
||||||
|
|| viewLinks[i]->syncRangeFilters()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (viewLinks[i]->managedView())
|
||||||
|
{
|
||||||
|
if (viewLinks[i]->syncVisibleCells()) {
|
||||||
|
viewLinks[i]->managedView()->scheduleGeometryRegen(OVERRIDDEN_CELL_VISIBILITY);
|
||||||
|
}else{
|
||||||
|
viewLinks[i]->managedView()->scheduleGeometryRegen(geometryType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimViewLinker::scheduleCreateDisplayModelAndRedrawForDependentViews()
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < viewLinks.size(); i++)
|
||||||
|
{
|
||||||
|
if (viewLinks[i]->syncVisibleCells()
|
||||||
|
|| viewLinks[i]->syncPropertyFilters()
|
||||||
|
|| viewLinks[i]->syncRangeFilters()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (viewLinks[i]->managedView())
|
||||||
|
{
|
||||||
|
viewLinks[i]->managedView()->scheduleCreateDisplayModelAndRedraw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "cafPdmField.h"
|
#include "cafPdmField.h"
|
||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
#include "cafPdmPtrField.h"
|
#include "cafPdmPtrField.h"
|
||||||
|
#include "RivCellSetEnum.h"
|
||||||
|
|
||||||
class RimViewLink;
|
class RimViewLink;
|
||||||
class RiuViewer;
|
class RiuViewer;
|
||||||
@ -50,15 +51,18 @@ public:
|
|||||||
void applyAllOperations();
|
void applyAllOperations();
|
||||||
|
|
||||||
void updateTimeStep(RimView* sourceView, int timeStep);
|
void updateTimeStep(RimView* sourceView, int timeStep);
|
||||||
void updateCellResult();
|
void updateScaleZ(RimView* source, double scaleZ);
|
||||||
|
void allViewsForCameraSync(RimView* source, std::vector<RimView*>& views);
|
||||||
|
|
||||||
|
void updateCellResult();
|
||||||
void updateRangeFilters();
|
void updateRangeFilters();
|
||||||
void updatePropertyFilters();
|
void updatePropertyFilters();
|
||||||
|
|
||||||
|
void scheduleGeometryRegenForDepViews(RivCellSetEnum geometryType);
|
||||||
|
void scheduleCreateDisplayModelAndRedrawForDependentViews();
|
||||||
|
|
||||||
void configureOverrides();
|
void configureOverrides();
|
||||||
|
|
||||||
void updateScaleZ(RimView* source, double scaleZ);
|
|
||||||
void allViewsForCameraSync(RimView* source, std::vector<RimView*>& views);
|
|
||||||
void allViews(std::vector<RimView*>& views);
|
void allViews(std::vector<RimView*>& views);
|
||||||
|
|
||||||
void updateUiIcon();
|
void updateUiIcon();
|
||||||
|
Loading…
Reference in New Issue
Block a user