#2094 Update well name color in 3d view (not sim well)

This commit is contained in:
Rebecca Cox 2017-11-07 16:42:52 +01:00
parent c19bc103c2
commit 93a83cd756
6 changed files with 47 additions and 2 deletions

View File

@ -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<cvf::DrawableText*>(m_wellLabelPart->drawable());
if (drawableText)
{
drawableText->setTextColor(color);
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -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,

View File

@ -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

View File

@ -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)
{

View File

@ -59,6 +59,9 @@
#include <QLabel>
#include <QMouseEvent>
#include <QProgressBar>
#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);
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -78,6 +78,8 @@ public:
void updateGridBoxData();
cvf::Model* gridBoxModel() const;
void updateWellPathTextColor();
void showAnimationProgress(bool enable);
void removeAllColorLegends();