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:
@@ -31,7 +31,7 @@
|
|||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimGeoMechCase.h"
|
#include "RimGeoMechCase.h"
|
||||||
#include "RimGeoMechView.h"
|
#include "RimGeoMechView.h"
|
||||||
#include "RimProject.h"
|
#include "RimViewLink.h"
|
||||||
#include "RimViewLinker.h"
|
#include "RimViewLinker.h"
|
||||||
|
|
||||||
#include "cafPdmUiEditorHandle.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)
|
void RimCellRangeFilterCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||||
{
|
{
|
||||||
this->updateUiIconFromToggleField();
|
updateIconState();
|
||||||
|
|
||||||
updateDisplayModeNotifyManagedViews();
|
updateDisplayModeNotifyManagedViews();
|
||||||
}
|
}
|
||||||
@@ -155,16 +155,6 @@ void RimCellRangeFilterCollection::updateDisplayModeNotifyManagedViews()
|
|||||||
view->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
view->scheduleGeometryRegen(RANGE_FILTERED_INACTIVE);
|
||||||
|
|
||||||
view->scheduleCreateDisplayModelAndRedraw();
|
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();
|
rangeFilter->updateIconState();
|
||||||
}
|
}
|
||||||
|
|
||||||
this->updateUiIconFromToggleField();
|
updateIconState();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -323,3 +313,26 @@ RimView* RimCellRangeFilterCollection::baseView() const
|
|||||||
return rimView;
|
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;
|
RigActiveCellInfo* activeCellInfo() const;
|
||||||
|
|
||||||
void updateDisplayModeNotifyManagedViews();
|
void updateDisplayModeNotifyManagedViews();
|
||||||
|
void updateIconState();
|
||||||
|
|
||||||
// Overridden methods
|
// Overridden methods
|
||||||
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
|
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include "RimEclipseCellColors.h"
|
#include "RimEclipseCellColors.h"
|
||||||
#include "RimEclipseResultDefinition.h"
|
#include "RimEclipseResultDefinition.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimProject.h"
|
#include "RimViewLink.h"
|
||||||
#include "RimViewLinker.h"
|
#include "RimViewLinker.h"
|
||||||
|
|
||||||
#include "cafPdmUiEditorHandle.h"
|
#include "cafPdmUiEditorHandle.h"
|
||||||
@@ -41,8 +41,8 @@ RimEclipsePropertyFilterCollection::RimEclipsePropertyFilterCollection()
|
|||||||
CAF_PDM_InitFieldNoDefault(&propertyFilters, "PropertyFilters", "Property Filters", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&propertyFilters, "PropertyFilters", "Property Filters", "", "", "");
|
||||||
propertyFilters.uiCapability()->setUiHidden(true);
|
propertyFilters.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
CAF_PDM_InitField(&active, "Active", true, "Active", "", "", "");
|
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
|
||||||
active.uiCapability()->setUiHidden(true);
|
isActive.uiCapability()->setUiHidden(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -69,7 +69,7 @@ RimEclipseView* RimEclipsePropertyFilterCollection::reservoirView()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEclipsePropertyFilterCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
void RimEclipsePropertyFilterCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||||
{
|
{
|
||||||
this->updateUiIconFromToggleField();
|
updateIconState();
|
||||||
|
|
||||||
updateDisplayModelNotifyManagedViews();
|
updateDisplayModelNotifyManagedViews();
|
||||||
}
|
}
|
||||||
@@ -91,7 +91,7 @@ void RimEclipsePropertyFilterCollection::loadAndInitializePropertyFilters()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEclipsePropertyFilterCollection::initAfterRead()
|
void RimEclipsePropertyFilterCollection::initAfterRead()
|
||||||
{
|
{
|
||||||
this->updateUiIconFromToggleField();
|
updateIconState();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -99,7 +99,7 @@ void RimEclipsePropertyFilterCollection::initAfterRead()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimEclipsePropertyFilterCollection::hasActiveFilters() const
|
bool RimEclipsePropertyFilterCollection::hasActiveFilters() const
|
||||||
{
|
{
|
||||||
if (!active) return false;
|
if (!isActive) return false;
|
||||||
|
|
||||||
for (size_t i = 0; i < propertyFilters.size(); i++)
|
for (size_t i = 0; i < propertyFilters.size(); i++)
|
||||||
{
|
{
|
||||||
@@ -115,7 +115,7 @@ bool RimEclipsePropertyFilterCollection::hasActiveFilters() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimEclipsePropertyFilterCollection::hasActiveDynamicFilters() const
|
bool RimEclipsePropertyFilterCollection::hasActiveDynamicFilters() const
|
||||||
{
|
{
|
||||||
if (!active) return false;
|
if (!isActive) return false;
|
||||||
|
|
||||||
for (size_t i = 0; i < propertyFilters.size(); i++)
|
for (size_t i = 0; i < propertyFilters.size(); i++)
|
||||||
{
|
{
|
||||||
@@ -131,7 +131,7 @@ bool RimEclipsePropertyFilterCollection::hasActiveDynamicFilters() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
caf::PdmFieldHandle* RimEclipsePropertyFilterCollection::objectToggleField()
|
caf::PdmFieldHandle* RimEclipsePropertyFilterCollection::objectToggleField()
|
||||||
{
|
{
|
||||||
return &active;
|
return &isActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -145,15 +145,29 @@ void RimEclipsePropertyFilterCollection::updateDisplayModelNotifyManagedViews()
|
|||||||
|
|
||||||
view->scheduleGeometryRegen(PROPERTY_FILTERED);
|
view->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||||
view->scheduleCreateDisplayModelAndRedraw();
|
view->scheduleCreateDisplayModelAndRedraw();
|
||||||
|
}
|
||||||
RimProject* proj = NULL;
|
|
||||||
view->firstAnchestorOrThisOfType(proj);
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
/*
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimViewLinker* viewLinker = proj->findViewLinkerFromView(view);
|
void RimEclipsePropertyFilterCollection::updateIconState()
|
||||||
if (viewLinker)
|
{
|
||||||
{
|
bool activeIcon = true;
|
||||||
viewLinker->updatePropertyFilters();
|
|
||||||
}
|
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();
|
virtual ~RimEclipsePropertyFilterCollection();
|
||||||
|
|
||||||
// Fields:
|
// Fields:
|
||||||
caf::PdmField<bool> active;
|
caf::PdmField<bool> isActive;
|
||||||
caf::PdmChildArrayField<RimEclipsePropertyFilter*> propertyFilters;
|
caf::PdmChildArrayField<RimEclipsePropertyFilter*> propertyFilters;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
@@ -46,6 +46,7 @@ public:
|
|||||||
void loadAndInitializePropertyFilters();
|
void loadAndInitializePropertyFilters();
|
||||||
|
|
||||||
void updateDisplayModelNotifyManagedViews();
|
void updateDisplayModelNotifyManagedViews();
|
||||||
|
void updateIconState();
|
||||||
|
|
||||||
|
|
||||||
// Overridden methods
|
// 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:
|
// Overridden PDM methods:
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||||
|
void updateIconStateForFilterCollections();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void initAfterRead();
|
virtual void initAfterRead();
|
||||||
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "RimGeoMechCellColors.h"
|
#include "RimGeoMechCellColors.h"
|
||||||
#include "RimGeoMechPropertyFilter.h"
|
#include "RimGeoMechPropertyFilter.h"
|
||||||
#include "RimGeoMechView.h"
|
#include "RimGeoMechView.h"
|
||||||
#include "RimProject.h"
|
#include "RimViewLink.h"
|
||||||
#include "RimViewLinker.h"
|
#include "RimViewLinker.h"
|
||||||
|
|
||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
@@ -40,8 +40,8 @@ RimGeoMechPropertyFilterCollection::RimGeoMechPropertyFilterCollection()
|
|||||||
CAF_PDM_InitFieldNoDefault(&propertyFilters, "PropertyFilters", "Property Filters", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&propertyFilters, "PropertyFilters", "Property Filters", "", "", "");
|
||||||
propertyFilters.uiCapability()->setUiHidden(true);
|
propertyFilters.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
CAF_PDM_InitField(&active, "Active", true, "Active", "", "", "");
|
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
|
||||||
active.uiCapability()->setUiHidden(true);
|
isActive.uiCapability()->setUiHidden(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -68,7 +68,7 @@ RimGeoMechView* RimGeoMechPropertyFilterCollection::reservoirView()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimGeoMechPropertyFilterCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
void RimGeoMechPropertyFilterCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||||
{
|
{
|
||||||
this->updateUiIconFromToggleField();
|
updateIconState();
|
||||||
|
|
||||||
updateDisplayModelNotifyManagedViews();
|
updateDisplayModelNotifyManagedViews();
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ void RimGeoMechPropertyFilterCollection::initAfterRead()
|
|||||||
propertyFilter->updateIconState();
|
propertyFilter->updateIconState();
|
||||||
}
|
}
|
||||||
|
|
||||||
this->updateUiIconFromToggleField();
|
updateIconState();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -109,7 +109,7 @@ void RimGeoMechPropertyFilterCollection::initAfterRead()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimGeoMechPropertyFilterCollection::hasActiveFilters() const
|
bool RimGeoMechPropertyFilterCollection::hasActiveFilters() const
|
||||||
{
|
{
|
||||||
if (!active) return false;
|
if (!isActive) return false;
|
||||||
|
|
||||||
for (size_t i = 0; i < propertyFilters.size(); i++)
|
for (size_t i = 0; i < propertyFilters.size(); i++)
|
||||||
{
|
{
|
||||||
@@ -133,7 +133,7 @@ bool RimGeoMechPropertyFilterCollection::hasActiveDynamicFilters() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
caf::PdmFieldHandle* RimGeoMechPropertyFilterCollection::objectToggleField()
|
caf::PdmFieldHandle* RimGeoMechPropertyFilterCollection::objectToggleField()
|
||||||
{
|
{
|
||||||
return &active;
|
return &isActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -147,15 +147,29 @@ void RimGeoMechPropertyFilterCollection::updateDisplayModelNotifyManagedViews()
|
|||||||
|
|
||||||
view->scheduleGeometryRegen(PROPERTY_FILTERED);
|
view->scheduleGeometryRegen(PROPERTY_FILTERED);
|
||||||
view->scheduleCreateDisplayModelAndRedraw();
|
view->scheduleCreateDisplayModelAndRedraw();
|
||||||
|
}
|
||||||
RimProject* proj = NULL;
|
|
||||||
view->firstAnchestorOrThisOfType(proj);
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
/*
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimViewLinker* viewLinker = proj->findViewLinkerFromView(view);
|
void RimGeoMechPropertyFilterCollection::updateIconState()
|
||||||
if (viewLinker)
|
{
|
||||||
{
|
bool activeIcon = true;
|
||||||
viewLinker->updatePropertyFilters();
|
|
||||||
}
|
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();
|
RimGeoMechView* reservoirView();
|
||||||
|
|
||||||
// Fields:
|
// Fields:
|
||||||
caf::PdmField<bool> active;
|
caf::PdmField<bool> isActive;
|
||||||
caf::PdmChildArrayField<RimGeoMechPropertyFilter*> propertyFilters;
|
caf::PdmChildArrayField<RimGeoMechPropertyFilter*> propertyFilters;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
@@ -50,6 +50,7 @@ public:
|
|||||||
|
|
||||||
void loadAndInitializePropertyFilters();
|
void loadAndInitializePropertyFilters();
|
||||||
void updateDisplayModelNotifyManagedViews();
|
void updateDisplayModelNotifyManagedViews();
|
||||||
|
void updateIconState();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overridden methods
|
// Overridden methods
|
||||||
|
|||||||
@@ -554,3 +554,13 @@ void RimGeoMechView::calculateCurrentTotalCellVisibility(cvf::UByteArray* totalV
|
|||||||
m_vizLogic->calculateCurrentTotalCellVisibility(totalVisibility, m_currentTimeStep);
|
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 cvf::Transform* scaleTransform();
|
||||||
virtual void scheduleGeometryRegen(RivCellSetEnum geometryType);
|
virtual void scheduleGeometryRegen(RivCellSetEnum geometryType);
|
||||||
|
void updateIconStateForFilterCollections();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void createDisplayModel();
|
virtual void createDisplayModel();
|
||||||
|
|||||||
@@ -296,6 +296,16 @@ void RimViewLink::configureOverrides()
|
|||||||
RimEclipseView* manEclView = managedEclipseView();
|
RimEclipseView* manEclView = managedEclipseView();
|
||||||
RimGeoMechView* manGeoView = managedGeoView();
|
RimGeoMechView* manGeoView = managedGeoView();
|
||||||
|
|
||||||
|
if (manGeoView)
|
||||||
|
{
|
||||||
|
manGeoView->updateIconStateForFilterCollections();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (manEclView)
|
||||||
|
{
|
||||||
|
manEclView->updateIconStateForFilterCollections();
|
||||||
|
}
|
||||||
|
|
||||||
if (!isActive)
|
if (!isActive)
|
||||||
{
|
{
|
||||||
m_managedView->setOverrideRangeFilterCollection(NULL);
|
m_managedView->setOverrideRangeFilterCollection(NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user