diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicAppendIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicAppendIntersectionFeature.cpp index f45723f67f..c8ea315507 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicAppendIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicAppendIntersectionFeature.cpp @@ -100,7 +100,7 @@ void RicAppendIntersectionFeatureCmd::redo() RimIntersection* intersection = new RimIntersection(); intersection->name = QString("Intersection"); - m_intersectionCollection->appendIntersection(intersection); + m_intersectionCollection->appendIntersectionAndUpdate(intersection); RimGridView* view = nullptr; m_intersectionCollection->firstAncestorOrThisOfTypeAsserted(view); diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp index ac575c9812..c8979ff15f 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp @@ -122,7 +122,7 @@ void RicNewAzimuthDipIntersectionFeatureCmd::redo() intersection->setLengthDown(cvf::Math::floor(bBox.extent()[2] / 2)); } - m_intersectionCollection->appendIntersection(intersection); + m_intersectionCollection->appendIntersectionAndUpdate(intersection); RiuSelectionManager::instance()->deleteAllItems(); RiuMainWindow::instance()->selectAsCurrentItem(intersection); diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp index 63fa17ff6e..70e67f3054 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp @@ -112,7 +112,7 @@ void RicNewPolylineIntersectionFeatureCmd::redo() intersection->type = RimIntersection::CS_POLYLINE; intersection->inputPolyLineFromViewerEnabled = true; - m_intersectionCollection->appendIntersection(intersection); + m_intersectionCollection->appendIntersectionAndUpdate(intersection); RiuSelectionManager::instance()->deleteAllItems(); diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp index 95caabd24f..4a9003ff38 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp @@ -107,7 +107,7 @@ void RicNewSimWellIntersectionCmd::redo() intersection->type = RimIntersection::CS_SIMULATION_WELL; intersection->simulationWell = m_simWell; - m_intersectionCollection->appendIntersection(intersection); + m_intersectionCollection->appendIntersectionAndUpdate(intersection); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp b/ApplicationCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp index 10395e3d04..8952631522 100644 --- a/ApplicationCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp +++ b/ApplicationCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp @@ -116,7 +116,7 @@ void RicNewWellPathIntersectionFeatureCmd::redo() intersection->type = RimIntersection::CS_WELL_PATH; intersection->wellPath = m_wellPath; - m_intersectionCollection->appendIntersection(intersection); + m_intersectionCollection->appendIntersectionAndUpdate(intersection); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/IntersectionBoxCommands/RicAppendIntersectionBoxFeature.cpp b/ApplicationCode/Commands/IntersectionBoxCommands/RicAppendIntersectionBoxFeature.cpp index f6cd3d4b9c..ff4034a52f 100644 --- a/ApplicationCode/Commands/IntersectionBoxCommands/RicAppendIntersectionBoxFeature.cpp +++ b/ApplicationCode/Commands/IntersectionBoxCommands/RicAppendIntersectionBoxFeature.cpp @@ -56,7 +56,7 @@ void RicAppendIntersectionBoxFeature::onActionTriggered(bool isChecked) RimIntersectionBox* intersectionBox = new RimIntersectionBox(); intersectionBox->name = QString("Intersection Box"); - coll->appendIntersectionBox(intersectionBox); + coll->appendIntersectionBoxAndUpdate(intersectionBox); intersectionBox->setToDefaultSizeBox(); diff --git a/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxAtPosFeature.cpp b/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxAtPosFeature.cpp index 3bc9360eb2..4684e56830 100644 --- a/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxAtPosFeature.cpp +++ b/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxAtPosFeature.cpp @@ -59,7 +59,7 @@ void RicIntersectionBoxAtPosFeature::onActionTriggered(bool isChecked) RimIntersectionBox* intersectionBox = new RimIntersectionBox(); intersectionBox->name = QString("Intersection box"); - coll->appendIntersectionBox(intersectionBox); + coll->appendIntersectionBoxAndUpdate(intersectionBox); cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords(); intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_NONE, domainCoord); diff --git a/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxXSliceFeature.cpp b/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxXSliceFeature.cpp index f16c17d9ce..2f5499e6c8 100644 --- a/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxXSliceFeature.cpp +++ b/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxXSliceFeature.cpp @@ -59,7 +59,7 @@ void RicIntersectionBoxXSliceFeature::onActionTriggered(bool isChecked) RimIntersectionBox* intersectionBox = new RimIntersectionBox(); intersectionBox->name = QString("X-slice (Intersection box)"); - coll->appendIntersectionBox(intersectionBox); + coll->appendIntersectionBoxAndUpdate(intersectionBox); cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords(); intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_X, domainCoord); diff --git a/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxYSliceFeature.cpp b/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxYSliceFeature.cpp index 3476c42529..f5d187b2be 100644 --- a/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxYSliceFeature.cpp +++ b/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxYSliceFeature.cpp @@ -59,7 +59,7 @@ void RicIntersectionBoxYSliceFeature::onActionTriggered(bool isChecked) RimIntersectionBox* intersectionBox = new RimIntersectionBox(); intersectionBox->name = QString("Y-slice (Intersection box)"); - coll->appendIntersectionBox(intersectionBox); + coll->appendIntersectionBoxAndUpdate(intersectionBox); cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords(); intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_Y, domainCoord); diff --git a/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxZSliceFeature.cpp b/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxZSliceFeature.cpp index 0af08f733f..bd70ae6b60 100644 --- a/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxZSliceFeature.cpp +++ b/ApplicationCode/Commands/IntersectionBoxCommands/RicIntersectionBoxZSliceFeature.cpp @@ -59,7 +59,7 @@ void RicIntersectionBoxZSliceFeature::onActionTriggered(bool isChecked) RimIntersectionBox* intersectionBox = new RimIntersectionBox(); intersectionBox->name = QString("Z-slice (Intersection box)"); - coll->appendIntersectionBox(intersectionBox); + coll->appendIntersectionBoxAndUpdate(intersectionBox); cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords(); intersectionBox->setToDefaultSizeSlice(RimIntersectionBox::PLANE_STATE_Z, domainCoord); diff --git a/ApplicationCode/ProjectDataModel/RimIntersectionCollection.cpp b/ApplicationCode/ProjectDataModel/RimIntersectionCollection.cpp index 3a70143d66..98078b7a9a 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersectionCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimIntersectionCollection.cpp @@ -151,7 +151,7 @@ void RimIntersectionCollection::appendPartsToModel(cvf::ModelBasicList* model, c //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimIntersectionCollection::appendIntersection(RimIntersection* intersection) +void RimIntersectionCollection::appendIntersectionAndUpdate(RimIntersection* intersection) { m_intersections.push_back(intersection); @@ -181,9 +181,19 @@ void RimIntersectionCollection::syncronize2dIntersectionViews() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimIntersectionCollection::appendIntersectionBox(RimIntersectionBox* intersectionBox) +void RimIntersectionCollection::appendIntersectionBoxAndUpdate(RimIntersectionBox* intersectionBox) { m_intersectionBoxes.push_back(intersectionBox); + + updateConnectedEditors(); + RiuMainWindow::instance()->selectAsCurrentItem(intersectionBox); + + Rim3dView* rimView = NULL; + firstAncestorOrThisOfType(rimView); + if (rimView) + { + rimView->scheduleCreateDisplayModelAndRedraw(); + } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimIntersectionCollection.h b/ApplicationCode/ProjectDataModel/RimIntersectionCollection.h index afd4d58cce..2f964dfe21 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersectionCollection.h +++ b/ApplicationCode/ProjectDataModel/RimIntersectionCollection.h @@ -48,9 +48,9 @@ public: caf::PdmField isActive; - void appendIntersection(RimIntersection* intersection); - - void appendIntersectionBox(RimIntersectionBox* intersectionBox); + void appendIntersectionAndUpdate(RimIntersection* intersection); + + void appendIntersectionBoxAndUpdate(RimIntersectionBox* intersectionBox); bool hasActiveIntersectionForSimulationWell(const RimSimWellInView* simWell) const;