#2094 Move annotation functions from updateGridBoxData to new function

This commit is contained in:
Rebecca Cox 2017-11-08 09:02:21 +01:00
parent 93a83cd756
commit de8b953360
7 changed files with 34 additions and 10 deletions

View File

@ -463,7 +463,7 @@ size_t RivWellPathPartMgr::segmentIndexFromTriangleIndex(size_t triangleIndex)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::updateWellNameTextColor(cvf::Color3f color) void RivWellPathPartMgr::updateWellLabelTextColor(cvf::Color3f color)
{ {
if (m_wellLabelPart.p()) if (m_wellLabelPart.p())
{ {

View File

@ -72,7 +72,7 @@ public:
size_t segmentIndexFromTriangleIndex(size_t triangleIndex); size_t segmentIndexFromTriangleIndex(size_t triangleIndex);
void updateWellNameTextColor(cvf::Color3f color); void updateWellLabelTextColor(cvf::Color3f color);
private: private:
void appendFishboneSubsPartsToModel(cvf::ModelBasicList* model, void appendFishboneSubsPartsToModel(cvf::ModelBasicList* model,

View File

@ -715,6 +715,7 @@ void RimEclipseCase::reloadDataAndUpdate()
CVF_ASSERT(reservoirView); CVF_ASSERT(reservoirView);
reservoirView->loadDataAndUpdate(); reservoirView->loadDataAndUpdate();
reservoirView->updateGridBoxData(); reservoirView->updateGridBoxData();
reservoirView->updateAnnotationItems();
} }
RimProject* project = RiaApplication::instance()->project(); RimProject* project = RiaApplication::instance()->project();

View File

@ -241,6 +241,7 @@ void RimView::updateViewWidgetAfterCreation()
m_viewer->mainCamera()->viewport()->setClearColor(cvf::Color4f(backgroundColor())); m_viewer->mainCamera()->viewport()->setClearColor(cvf::Color4f(backgroundColor()));
this->updateGridBoxData(); this->updateGridBoxData();
this->updateAnnotationItems();
this->createHighlightAndGridBoxDisplayModel(); this->createHighlightAndGridBoxDisplayModel();
m_viewer->update(); m_viewer->update();
@ -700,6 +701,7 @@ void RimView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QV
m_viewer->mainCamera()->viewport()->setClearColor(cvf::Color4f(backgroundColor())); m_viewer->mainCamera()->viewport()->setClearColor(cvf::Color4f(backgroundColor()));
} }
updateGridBoxData(); updateGridBoxData();
updateAnnotationItems();
} }
else if (changedField == &maximumFrameRate) else if (changedField == &maximumFrameRate)
{ {
@ -957,6 +959,17 @@ void RimView::updateGridBoxData()
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimView::updateAnnotationItems()
{
if (m_viewer)
{
m_viewer->updateAnnotationItems();
}
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -171,6 +171,7 @@ public:
public: public:
void updateGridBoxData(); void updateGridBoxData();
void updateAnnotationItems();
virtual RimCase* ownerCase() const = 0; virtual RimCase* ownerCase() const = 0;
virtual caf::PdmFieldHandle* userDescriptionField() override { return &name; } virtual caf::PdmFieldHandle* userDescriptionField() override { return &name; }

View File

@ -62,6 +62,8 @@
#include "RimWellPathCollection.h" #include "RimWellPathCollection.h"
#include "RimWellPath.h" #include "RimWellPath.h"
#include "RivWellPathPartMgr.h" #include "RivWellPathPartMgr.h"
#include "RimSimWellInViewCollection.h"
#include "RimEclipseView.h"
using cvf::ManipulatorTrackball; using cvf::ManipulatorTrackball;
@ -766,13 +768,19 @@ void RiuViewer::updateGridBoxData()
} }
m_gridBoxGenerator->createGridBoxParts(); m_gridBoxGenerator->createGridBoxParts();
updateTextAndTickMarkColorForOverlayItems();
updateWellPathTextColor();
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::updateAnnotationItems()
{
updateTextAndTickMarkColorForOverlayItems();
updateWellPathTextColor();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -789,15 +797,14 @@ void RiuViewer::updateWellPathTextColor()
RimView* rimView = ownerReservoirView(); RimView* rimView = ownerReservoirView();
if (!rimView) return; if (!rimView) return;
RimWellPathCollection* wellPathCollection = rimView->wellPathsPartManager(); cvf::Color3f color = computeContrastColor();
RimWellPathCollection* wellPathCollection = rimView->wellPathsPartManager();
if (wellPathCollection) if (wellPathCollection)
{ {
cvf::Color3f color = computeContrastColor();
for (RimWellPath* path : wellPathCollection->wellPaths()) for (RimWellPath* path : wellPathCollection->wellPaths())
{ {
path->partMgr()->updateWellNameTextColor(color); path->partMgr()->updateWellLabelTextColor(color);
} }
} }
} }

View File

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