mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2871 Fault visibility toggle now controls fault label visibility in 2D intersection views also.
This commit is contained in:
@@ -75,6 +75,7 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "RiaPreferences.h"
|
#include "RiaPreferences.h"
|
||||||
|
#include "RimFaultInView.h"
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -602,10 +603,11 @@ void RivIntersectionPartMgr::createFaultLabelParts(const std::vector<std::pair<Q
|
|||||||
|
|
||||||
RimEclipseView* eclipseView = nullptr;
|
RimEclipseView* eclipseView = nullptr;
|
||||||
m_rimCrossSection->firstAncestorOrThisOfType(eclipseView);
|
m_rimCrossSection->firstAncestorOrThisOfType(eclipseView);
|
||||||
|
RimFaultInViewCollection* faultInViewColl = eclipseView->faultCollection();
|
||||||
|
|
||||||
if (!(eclipseView && eclipseView->faultCollection()->showFaultLabel())) return;
|
if (!(eclipseView && faultInViewColl->showFaultLabel())) return;
|
||||||
|
|
||||||
cvf::Color3f defWellLabelColor = eclipseView->faultCollection()->faultLabelColor();
|
cvf::Color3f defWellLabelColor = faultInViewColl->faultLabelColor();
|
||||||
cvf::Font* font = RiaApplication::instance()->customFont();
|
cvf::Font* font = RiaApplication::instance()->customFont();
|
||||||
|
|
||||||
std::vector<cvf::Vec3f> lineVertices;
|
std::vector<cvf::Vec3f> lineVertices;
|
||||||
@@ -622,9 +624,14 @@ void RivIntersectionPartMgr::createFaultLabelParts(const std::vector<std::pair<Q
|
|||||||
|
|
||||||
cvf::BoundingBox bb = m_crossSectionFaces->boundingBox();
|
cvf::BoundingBox bb = m_crossSectionFaces->boundingBox();
|
||||||
double labelZOffset = bb.extent().z() / 10;
|
double labelZOffset = bb.extent().z() / 10;
|
||||||
|
int visibleFaultNameCount = 0;
|
||||||
|
|
||||||
for (const auto& labelAndAnchorPair : labelAndAnchors)
|
for (const auto& labelAndAnchorPair : labelAndAnchors)
|
||||||
{
|
{
|
||||||
|
RimFaultInView* fault = faultInViewColl->findFaultByName(labelAndAnchorPair.first);
|
||||||
|
|
||||||
|
if (!(fault && fault->showFault())) continue;
|
||||||
|
|
||||||
cvf::String cvfString = cvfqt::Utils::toString(labelAndAnchorPair.first);
|
cvf::String cvfString = cvfqt::Utils::toString(labelAndAnchorPair.first);
|
||||||
cvf::Vec3f textCoord(labelAndAnchorPair.second);
|
cvf::Vec3f textCoord(labelAndAnchorPair.second);
|
||||||
|
|
||||||
@@ -633,8 +640,11 @@ void RivIntersectionPartMgr::createFaultLabelParts(const std::vector<std::pair<Q
|
|||||||
|
|
||||||
lineVertices.push_back(cvf::Vec3f(labelAndAnchorPair.second));
|
lineVertices.push_back(cvf::Vec3f(labelAndAnchorPair.second));
|
||||||
lineVertices.push_back(textCoord);
|
lineVertices.push_back(textCoord);
|
||||||
|
visibleFaultNameCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (visibleFaultNameCount == 0) return;
|
||||||
|
|
||||||
// Labels part
|
// Labels part
|
||||||
{
|
{
|
||||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "RigFault.h"
|
#include "RigFault.h"
|
||||||
|
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
|
#include "RimIntersectionCollection.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimFaultInView, "Fault");
|
CAF_PDM_SOURCE_INIT(RimFaultInView, "Fault");
|
||||||
|
|
||||||
@@ -75,6 +76,7 @@ void RimFaultInView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
|
|||||||
if (reservoirView)
|
if (reservoirView)
|
||||||
{
|
{
|
||||||
reservoirView->scheduleCreateDisplayModelAndRedraw();
|
reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||||
|
reservoirView->crossSectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user