mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Propagate updated object to onChildrenUpdated()
This commit is contained in:
parent
0f4d2a61f6
commit
a446f874cb
@ -126,9 +126,12 @@ void RimSummaryCurveCollection::onChildrenUpdated( caf::PdmChildArrayFieldHandle
|
|||||||
{
|
{
|
||||||
if ( childArray == &m_curves )
|
if ( childArray == &m_curves )
|
||||||
{
|
{
|
||||||
for ( RimSummaryCurve* curve : m_curves )
|
for ( auto obj : updatedObjects )
|
||||||
{
|
{
|
||||||
curve->updateCurveAppearance();
|
if ( auto curve = dynamic_cast<RimSummaryCurve*>( obj ) )
|
||||||
|
{
|
||||||
|
curve->updateCurveAppearance();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto parentPlot = firstAncestorOrThisOfTypeAsserted<RimSummaryPlot>();
|
auto parentPlot = firstAncestorOrThisOfTypeAsserted<RimSummaryPlot>();
|
||||||
|
@ -82,6 +82,8 @@ void CmdFieldChangeExec::redo()
|
|||||||
{
|
{
|
||||||
m_commandData->m_undoFieldValueSerialized.resize( m_commandData->m_pathToFields.size() );
|
m_commandData->m_undoFieldValueSerialized.resize( m_commandData->m_pathToFields.size() );
|
||||||
|
|
||||||
|
std::vector<caf::PdmObjectHandle*> objs;
|
||||||
|
|
||||||
for ( size_t i = 0; i < m_commandData->m_pathToFields.size(); i++ )
|
for ( size_t i = 0; i < m_commandData->m_pathToFields.size(); i++ )
|
||||||
{
|
{
|
||||||
auto fieldTextPath = m_commandData->m_pathToFields[i];
|
auto fieldTextPath = m_commandData->m_pathToFields[i];
|
||||||
@ -89,17 +91,22 @@ void CmdFieldChangeExec::redo()
|
|||||||
PdmFieldHandle* field = PdmReferenceHelper::fieldFromReference( m_commandData->m_rootObject, fieldTextPath );
|
PdmFieldHandle* field = PdmReferenceHelper::fieldFromReference( m_commandData->m_rootObject, fieldTextPath );
|
||||||
if ( !field ) continue;
|
if ( !field ) continue;
|
||||||
|
|
||||||
bool objectFlag = false;
|
bool objectNotificationFlag = false;
|
||||||
PdmObjectHandle* obj = field->ownerObject();
|
|
||||||
auto uiObjectHandle = uiObj( obj );
|
|
||||||
if ( uiObjectHandle )
|
|
||||||
{
|
|
||||||
objectFlag = uiObjectHandle->notifyAllFieldsInMultiFieldChangedEvents();
|
|
||||||
|
|
||||||
// Make sure that uiOrdering has been called on all objects, as some object do some state initialization.
|
if ( auto obj = field->ownerObject() )
|
||||||
// This is relevant for data source stepping objects. This operation could be made into a virtual function.
|
{
|
||||||
caf::PdmUiOrdering ordering;
|
objs.push_back( obj );
|
||||||
uiObjectHandle->uiOrdering( "", ordering );
|
|
||||||
|
if ( auto uiObjectHandle = uiObj( obj ) )
|
||||||
|
{
|
||||||
|
objectNotificationFlag = uiObjectHandle->notifyAllFieldsInMultiFieldChangedEvents();
|
||||||
|
|
||||||
|
// Make sure that uiOrdering has been called on all objects, as some object do some state
|
||||||
|
// initialization. This is relevant for data source stepping objects. This operation could be made into
|
||||||
|
// a virtual function.
|
||||||
|
caf::PdmUiOrdering ordering;
|
||||||
|
uiObjectHandle->uiOrdering( "", ordering );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||||
@ -113,7 +120,7 @@ void CmdFieldChangeExec::redo()
|
|||||||
|
|
||||||
bool isLastField = ( i == m_commandData->m_pathToFields.size() - 1 );
|
bool isLastField = ( i == m_commandData->m_pathToFields.size() - 1 );
|
||||||
bool sendFieldChangedNotification = isLastField;
|
bool sendFieldChangedNotification = isLastField;
|
||||||
if ( objectFlag ) sendFieldChangedNotification = true;
|
if ( objectNotificationFlag ) sendFieldChangedNotification = true;
|
||||||
if ( uiFieldHandle->notifyAllFieldsInMultiFieldChangedEvents() ) sendFieldChangedNotification = true;
|
if ( uiFieldHandle->notifyAllFieldsInMultiFieldChangedEvents() ) sendFieldChangedNotification = true;
|
||||||
|
|
||||||
if ( m_commandData->m_undoFieldValueSerialized[i].isEmpty() )
|
if ( m_commandData->m_undoFieldValueSerialized[i].isEmpty() )
|
||||||
@ -159,7 +166,6 @@ void CmdFieldChangeExec::redo()
|
|||||||
|
|
||||||
if ( m_commandData->m_ownerOfChildArrayField && m_commandData->m_childArrayFieldHandle )
|
if ( m_commandData->m_ownerOfChildArrayField && m_commandData->m_childArrayFieldHandle )
|
||||||
{
|
{
|
||||||
std::vector<caf::PdmObjectHandle*> objs;
|
|
||||||
m_commandData->m_ownerOfChildArrayField->onChildrenUpdated( m_commandData->m_childArrayFieldHandle, objs );
|
m_commandData->m_ownerOfChildArrayField->onChildrenUpdated( m_commandData->m_childArrayFieldHandle, objs );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user