mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#483) Gray out overridden range and property collections
This commit is contained in:
parent
4ee8929d91
commit
71e74599ff
@ -31,7 +31,7 @@
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimViewLink.h"
|
||||
#include "RimViewLinker.h"
|
||||
|
||||
#include "cafPdmUiEditorHandle.h"
|
||||
@ -138,7 +138,7 @@ RigActiveCellInfo* RimCellRangeFilterCollection::activeCellInfo() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCellRangeFilterCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
this->updateUiIconFromToggleField();
|
||||
updateIconState();
|
||||
|
||||
updateDisplayModeNotifyManagedViews();
|
||||
}
|
||||
@ -155,16 +155,6 @@ void RimCellRangeFilterCollection::updateDisplayModeNotifyManagedViews()
|
||||
view->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
||||
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
/*
|
||||
RimProject* proj = NULL;
|
||||
view->firstAnchestorOrThisOfType(proj);
|
||||
|
||||
RimViewLinker* viewLinker = proj->findViewLinkerFromView(view);
|
||||
if (viewLinker)
|
||||
{
|
||||
viewLinker->updateRangeFilters();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -186,7 +176,7 @@ void RimCellRangeFilterCollection::initAfterRead()
|
||||
rangeFilter->updateIconState();
|
||||
}
|
||||
|
||||
this->updateUiIconFromToggleField();
|
||||
updateIconState();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -323,3 +313,26 @@ RimView* RimCellRangeFilterCollection::baseView() const
|
||||
return rimView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCellRangeFilterCollection::updateIconState()
|
||||
{
|
||||
bool activeIcon = true;
|
||||
|
||||
RimViewLink* viewLink = RimViewLinker::viewLinkForView(baseView());
|
||||
if (viewLink && viewLink->syncRangeFilters())
|
||||
{
|
||||
activeIcon = false;
|
||||
}
|
||||
|
||||
if (!isActive)
|
||||
{
|
||||
activeIcon = false;
|
||||
}
|
||||
|
||||
updateUiIconFromState(activeIcon);
|
||||
|
||||
uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ public:
|
||||
RigActiveCellInfo* activeCellInfo() const;
|
||||
|
||||
void updateDisplayModeNotifyManagedViews();
|
||||
void updateIconState();
|
||||
|
||||
// Overridden methods
|
||||
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimViewLink.h"
|
||||
#include "RimViewLinker.h"
|
||||
|
||||
#include "cafPdmUiEditorHandle.h"
|
||||
@ -41,8 +41,8 @@ RimEclipsePropertyFilterCollection::RimEclipsePropertyFilterCollection()
|
||||
CAF_PDM_InitFieldNoDefault(&propertyFilters, "PropertyFilters", "Property Filters", "", "", "");
|
||||
propertyFilters.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&active, "Active", true, "Active", "", "", "");
|
||||
active.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
|
||||
isActive.uiCapability()->setUiHidden(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -69,7 +69,7 @@ RimEclipseView* RimEclipsePropertyFilterCollection::reservoirView()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilterCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
this->updateUiIconFromToggleField();
|
||||
updateIconState();
|
||||
|
||||
updateDisplayModelNotifyManagedViews();
|
||||
}
|
||||
@ -91,7 +91,7 @@ void RimEclipsePropertyFilterCollection::loadAndInitializePropertyFilters()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilterCollection::initAfterRead()
|
||||
{
|
||||
this->updateUiIconFromToggleField();
|
||||
updateIconState();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -99,7 +99,7 @@ void RimEclipsePropertyFilterCollection::initAfterRead()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipsePropertyFilterCollection::hasActiveFilters() const
|
||||
{
|
||||
if (!active) return false;
|
||||
if (!isActive) return false;
|
||||
|
||||
for (size_t i = 0; i < propertyFilters.size(); i++)
|
||||
{
|
||||
@ -115,7 +115,7 @@ bool RimEclipsePropertyFilterCollection::hasActiveFilters() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipsePropertyFilterCollection::hasActiveDynamicFilters() const
|
||||
{
|
||||
if (!active) return false;
|
||||
if (!isActive) return false;
|
||||
|
||||
for (size_t i = 0; i < propertyFilters.size(); i++)
|
||||
{
|
||||
@ -131,7 +131,7 @@ bool RimEclipsePropertyFilterCollection::hasActiveDynamicFilters() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimEclipsePropertyFilterCollection::objectToggleField()
|
||||
{
|
||||
return &active;
|
||||
return &isActive;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -145,15 +145,29 @@ void RimEclipsePropertyFilterCollection::updateDisplayModelNotifyManagedViews()
|
||||
|
||||
view->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
|
||||
RimProject* proj = NULL;
|
||||
view->firstAnchestorOrThisOfType(proj);
|
||||
|
||||
/*
|
||||
RimViewLinker* viewLinker = proj->findViewLinkerFromView(view);
|
||||
if (viewLinker)
|
||||
{
|
||||
viewLinker->updatePropertyFilters();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilterCollection::updateIconState()
|
||||
{
|
||||
bool activeIcon = true;
|
||||
|
||||
RimEclipseView* view = NULL;
|
||||
this->firstAnchestorOrThisOfType(view);
|
||||
RimViewLink* viewLink = RimViewLinker::viewLinkForView(view);
|
||||
if (viewLink && viewLink->syncPropertyFilters())
|
||||
{
|
||||
activeIcon = false;
|
||||
}
|
||||
|
||||
if (!isActive)
|
||||
{
|
||||
activeIcon = false;
|
||||
}
|
||||
|
||||
updateUiIconFromState(activeIcon);
|
||||
|
||||
uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
virtual ~RimEclipsePropertyFilterCollection();
|
||||
|
||||
// Fields:
|
||||
caf::PdmField<bool> active;
|
||||
caf::PdmField<bool> isActive;
|
||||
caf::PdmChildArrayField<RimEclipsePropertyFilter*> propertyFilters;
|
||||
|
||||
// Methods
|
||||
@ -46,6 +46,7 @@ public:
|
||||
void loadAndInitializePropertyFilters();
|
||||
|
||||
void updateDisplayModelNotifyManagedViews();
|
||||
void updateIconState();
|
||||
|
||||
|
||||
// Overridden methods
|
||||
|
@ -1604,3 +1604,13 @@ void RimEclipseView::calculateCurrentTotalCellVisibility(cvf::UByteArray* totalV
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseView::updateIconStateForFilterCollections()
|
||||
{
|
||||
// NB - notice that it is the filter collection managed by this view that the icon update applies to
|
||||
m_rangeFilterCollection()->updateIconState();
|
||||
m_propertyFilterCollection()->updateIconState();
|
||||
}
|
||||
|
@ -129,6 +129,8 @@ public:
|
||||
|
||||
// Overridden PDM methods:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
void updateIconStateForFilterCollections();
|
||||
|
||||
protected:
|
||||
virtual void initAfterRead();
|
||||
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "RimGeoMechCellColors.h"
|
||||
#include "RimGeoMechPropertyFilter.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimViewLink.h"
|
||||
#include "RimViewLinker.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
@ -40,8 +40,8 @@ RimGeoMechPropertyFilterCollection::RimGeoMechPropertyFilterCollection()
|
||||
CAF_PDM_InitFieldNoDefault(&propertyFilters, "PropertyFilters", "Property Filters", "", "", "");
|
||||
propertyFilters.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&active, "Active", true, "Active", "", "", "");
|
||||
active.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
|
||||
isActive.uiCapability()->setUiHidden(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -68,7 +68,7 @@ RimGeoMechView* RimGeoMechPropertyFilterCollection::reservoirView()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechPropertyFilterCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
this->updateUiIconFromToggleField();
|
||||
updateIconState();
|
||||
|
||||
updateDisplayModelNotifyManagedViews();
|
||||
}
|
||||
@ -101,7 +101,7 @@ void RimGeoMechPropertyFilterCollection::initAfterRead()
|
||||
propertyFilter->updateIconState();
|
||||
}
|
||||
|
||||
this->updateUiIconFromToggleField();
|
||||
updateIconState();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -109,7 +109,7 @@ void RimGeoMechPropertyFilterCollection::initAfterRead()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGeoMechPropertyFilterCollection::hasActiveFilters() const
|
||||
{
|
||||
if (!active) return false;
|
||||
if (!isActive) return false;
|
||||
|
||||
for (size_t i = 0; i < propertyFilters.size(); i++)
|
||||
{
|
||||
@ -133,7 +133,7 @@ bool RimGeoMechPropertyFilterCollection::hasActiveDynamicFilters() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimGeoMechPropertyFilterCollection::objectToggleField()
|
||||
{
|
||||
return &active;
|
||||
return &isActive;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -147,15 +147,29 @@ void RimGeoMechPropertyFilterCollection::updateDisplayModelNotifyManagedViews()
|
||||
|
||||
view->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||
view->scheduleCreateDisplayModelAndRedraw();
|
||||
|
||||
RimProject* proj = NULL;
|
||||
view->firstAnchestorOrThisOfType(proj);
|
||||
|
||||
/*
|
||||
RimViewLinker* viewLinker = proj->findViewLinkerFromView(view);
|
||||
if (viewLinker)
|
||||
{
|
||||
viewLinker->updatePropertyFilters();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechPropertyFilterCollection::updateIconState()
|
||||
{
|
||||
bool activeIcon = true;
|
||||
|
||||
RimGeoMechView* view = NULL;
|
||||
this->firstAnchestorOrThisOfType(view);
|
||||
RimViewLink* viewLink = RimViewLinker::viewLinkForView(view);
|
||||
if (viewLink && viewLink->syncPropertyFilters())
|
||||
{
|
||||
activeIcon = false;
|
||||
}
|
||||
|
||||
if (!isActive)
|
||||
{
|
||||
activeIcon = false;
|
||||
}
|
||||
|
||||
updateUiIconFromState(activeIcon);
|
||||
|
||||
uiCapability()->updateConnectedEditors();
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
RimGeoMechView* reservoirView();
|
||||
|
||||
// Fields:
|
||||
caf::PdmField<bool> active;
|
||||
caf::PdmField<bool> isActive;
|
||||
caf::PdmChildArrayField<RimGeoMechPropertyFilter*> propertyFilters;
|
||||
|
||||
// Methods
|
||||
@ -50,6 +50,7 @@ public:
|
||||
|
||||
void loadAndInitializePropertyFilters();
|
||||
void updateDisplayModelNotifyManagedViews();
|
||||
void updateIconState();
|
||||
|
||||
protected:
|
||||
// Overridden methods
|
||||
|
@ -554,3 +554,13 @@ void RimGeoMechView::calculateCurrentTotalCellVisibility(cvf::UByteArray* totalV
|
||||
m_vizLogic->calculateCurrentTotalCellVisibility(totalVisibility, m_currentTimeStep);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechView::updateIconStateForFilterCollections()
|
||||
{
|
||||
// NB - notice that it is the filter collection managed by this view that the icon update applies to
|
||||
m_rangeFilterCollection()->updateIconState();
|
||||
m_propertyFilterCollection()->updateIconState();
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,7 @@ public:
|
||||
|
||||
virtual cvf::Transform* scaleTransform();
|
||||
virtual void scheduleGeometryRegen(RivCellSetEnum geometryType);
|
||||
void updateIconStateForFilterCollections();
|
||||
|
||||
private:
|
||||
virtual void createDisplayModel();
|
||||
|
@ -296,6 +296,16 @@ void RimViewLink::configureOverrides()
|
||||
RimEclipseView* manEclView = managedEclipseView();
|
||||
RimGeoMechView* manGeoView = managedGeoView();
|
||||
|
||||
if (manGeoView)
|
||||
{
|
||||
manGeoView->updateIconStateForFilterCollections();
|
||||
}
|
||||
|
||||
if (manEclView)
|
||||
{
|
||||
manEclView->updateIconStateForFilterCollections();
|
||||
}
|
||||
|
||||
if (!isActive)
|
||||
{
|
||||
m_managedView->setOverrideRangeFilterCollection(NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user