Adjustments for release

* Add notification of parent object when multiple objects are updated

* Make sure unchecked curves are removed from track

* Use object names instead of "Sub Items" when possible

* Set default simulation well visualization to top of reservoir

* Show plot window after plot is created

* Allow setting plot rendering flags

* Add more plots for update when clicking in 3D view

* Seismic Difference: Fix typo for poly line data extraction

* Version RC_5
This commit is contained in:
Magne Sjaastad
2023-06-16 09:27:35 +02:00
committed by GitHub
parent 36811e7f94
commit 06b5c9afbf
25 changed files with 184 additions and 32 deletions

View File

@@ -148,6 +148,18 @@ void RicToggleItemsFeatureImpl::setObjectToggleStateForSelection( SelectionToggl
field->setValue( value );
}
}
// If multiple fields are updated, we call onChildrenUpdated() on the owner of the first field
// Example: Trigger replot of curves when multiple curves are toggled
if ( fieldsToUpdate.size() > 1 )
{
auto [ownerOfChildArrayField, childArrayFieldHandle] = RicToggleItemsFeatureImpl::findOwnerAndChildArrayField( fieldsToUpdate.front() );
if ( ownerOfChildArrayField && childArrayFieldHandle )
{
std::vector<caf::PdmObjectHandle*> objs;
ownerOfChildArrayField->onChildrenUpdated( childArrayFieldHandle, objs );
}
}
}
//--------------------------------------------------------------------------------------------------
@@ -178,7 +190,7 @@ QString RicToggleItemsFeatureImpl::findCollectionName( SelectionToggleType state
auto arrayField = dynamic_cast<caf::PdmChildArrayFieldHandle*>( childObj->parentField() );
if ( arrayField && arrayField->ownerObject() )
{
return arrayField->ownerObject()->uiCapability()->uiName();
return arrayField->uiCapability()->uiName();
}
}
}
@@ -310,3 +322,43 @@ std::vector<caf::PdmField<bool>*> RicToggleItemsFeatureImpl::findToggleFieldsFro
return fields;
}
//--------------------------------------------------------------------------------------------------
/// Based on code in CmdUiCommandSystemImpl::fieldChangedCommand()
/// Could be merged and put into a tool class
//--------------------------------------------------------------------------------------------------
std::pair<caf::PdmObjectHandle*, caf::PdmChildArrayFieldHandle*>
RicToggleItemsFeatureImpl::findOwnerAndChildArrayField( caf::PdmFieldHandle* fieldHandle )
{
if ( !fieldHandle ) return {};
caf::PdmChildArrayFieldHandle* childArrayFieldHandle = nullptr;
caf::PdmObjectHandle* ownerOfChildArrayField = nullptr;
// Find the first childArrayField by traversing parent field and objects. Usually, the childArrayField is
// the parent, but in some cases when we change fields in a sub-object of the object we need to traverse
// more levels
ownerOfChildArrayField = fieldHandle->ownerObject();
while ( ownerOfChildArrayField )
{
if ( ownerOfChildArrayField->parentField() )
{
childArrayFieldHandle = dynamic_cast<caf::PdmChildArrayFieldHandle*>( ownerOfChildArrayField->parentField() );
ownerOfChildArrayField = ownerOfChildArrayField->parentField()->ownerObject();
if ( childArrayFieldHandle && ownerOfChildArrayField ) break;
}
else
{
ownerOfChildArrayField = nullptr;
}
}
if ( ownerOfChildArrayField && childArrayFieldHandle )
{
return { ownerOfChildArrayField, childArrayFieldHandle };
}
return {};
}