diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp index 40d6fc5d5f..55b1076e8d 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -460,6 +460,21 @@ size_t RivWellPathPartMgr::segmentIndexFromTriangleIndex(size_t triangleIndex) return m_pipeBranchData.m_pipeGeomGenerator->segmentIndexFromTriangleIndex(triangleIndex); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivWellPathPartMgr::updateWellNameTextColor(cvf::Color3f color) +{ + if (m_wellLabelPart.p()) + { + cvf::DrawableText* drawableText = dynamic_cast(m_wellLabelPart->drawable()); + if (drawableText) + { + drawableText->setTextColor(color); + } + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h index c69deff905..a8a9e1cc21 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h @@ -72,6 +72,8 @@ public: size_t segmentIndexFromTriangleIndex(size_t triangleIndex); + void updateWellNameTextColor(cvf::Color3f color); + private: void appendFishboneSubsPartsToModel(cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform, diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index be83250091..ff089db48f 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -462,7 +462,7 @@ void RimEclipseView::createDisplayModel() wellPathsPartManager()->appendStaticFracturePartsToModel(m_wellPathPipeVizModel.p(), this); #endif // USE_PROTOTYPE_FEATURE_FRACTURES m_wellPathPipeVizModel->updateBoundingBoxesRecursive(); - + m_viewer->updateWellPathTextColor(); m_viewer->addStaticModelOnce(m_wellPathPipeVizModel.p()); // Create Scenes from the frameModels diff --git a/ApplicationCode/ProjectDataModel/RimView.cpp b/ApplicationCode/ProjectDataModel/RimView.cpp index 26f93ac1e0..4557c62bfe 100644 --- a/ApplicationCode/ProjectDataModel/RimView.cpp +++ b/ApplicationCode/ProjectDataModel/RimView.cpp @@ -698,8 +698,8 @@ void RimView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QV if (m_viewer != nullptr) { m_viewer->mainCamera()->viewport()->setClearColor(cvf::Color4f(backgroundColor())); - m_viewer->updateGridBoxData(); } + updateGridBoxData(); } else if (changedField == &maximumFrameRate) { diff --git a/ApplicationCode/UserInterface/RiuViewer.cpp b/ApplicationCode/UserInterface/RiuViewer.cpp index 705579bfcb..63c2568e50 100644 --- a/ApplicationCode/UserInterface/RiuViewer.cpp +++ b/ApplicationCode/UserInterface/RiuViewer.cpp @@ -59,6 +59,9 @@ #include #include #include +#include "RimWellPathCollection.h" +#include "RimWellPath.h" +#include "RivWellPathPartMgr.h" using cvf::ManipulatorTrackball; @@ -765,6 +768,8 @@ void RiuViewer::updateGridBoxData() m_gridBoxGenerator->createGridBoxParts(); updateTextAndTickMarkColorForOverlayItems(); + + updateWellPathTextColor(); } } @@ -776,6 +781,27 @@ cvf::Model* RiuViewer::gridBoxModel() const return m_gridBoxGenerator->model(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuViewer::updateWellPathTextColor() +{ + RimView* rimView = ownerReservoirView(); + if (!rimView) return; + + RimWellPathCollection* wellPathCollection = rimView->wellPathsPartManager(); + + if (wellPathCollection) + { + cvf::Color3f color = computeContrastColor(); + + for (RimWellPath* path : wellPathCollection->wellPaths()) + { + path->partMgr()->updateWellNameTextColor(color); + } + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/UserInterface/RiuViewer.h b/ApplicationCode/UserInterface/RiuViewer.h index 748dbcda33..15fce502a1 100644 --- a/ApplicationCode/UserInterface/RiuViewer.h +++ b/ApplicationCode/UserInterface/RiuViewer.h @@ -78,6 +78,8 @@ public: void updateGridBoxData(); cvf::Model* gridBoxModel() const; + void updateWellPathTextColor(); + void showAnimationProgress(bool enable); void removeAllColorLegends();