Skip to content

Commit e9b85b4

Browse files
committed
#14226 Set IJK intersection defaults before scheduling redraw
The feature appended with appendIjkIntersectionAndUpdate and set the default values afterwards, which only worked because the scheduled redraw is asynchronous and the part manager is built lazily. It also repeated the updateConnectedEditors and selectAsCurrentItem calls already done by the append. Append without update, set the defaults, then update editors, select the new item and schedule the redraw once. Note that setToDefaultValues() cannot run before the append: it resolves the grid through the parent view, so the intersection must be in the project tree first.
1 parent 8ddf3e0 commit e9b85b4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

ApplicationLibCode/Commands/IntersectionBoxCommands/RicAppendIjkIntersectionFeature.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,16 @@ void RicAppendIjkIntersectionFeature::onActionTriggered( bool isChecked )
5454
RimIjkIntersection* intersection = new RimIjkIntersection();
5555
intersection->setName( "Intersection I/J/K" );
5656

57-
coll->appendIjkIntersectionAndUpdate( intersection );
58-
57+
// The default values are computed from the grid, which is resolved through the parent
58+
// view, so the intersection must be added to the collection first
59+
coll->appendIjkIntersectionNoUpdate( intersection );
5960
intersection->setToDefaultValues();
60-
intersection->updateConnectedEditors();
6161

6262
coll->updateConnectedEditors();
6363
Riu3DMainWindowTools::selectAsCurrentItem( intersection );
6464

6565
RimGridView* rimView = coll->firstAncestorOrThisOfTypeAsserted<RimGridView>();
66+
rimView->scheduleCreateDisplayModelAndRedraw();
6667
rimView->showGridCells( false );
6768
}
6869
}

0 commit comments

Comments
 (0)