From 1cf2c03f7823dff4ba069f29f9371832244afdcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A5l=20Hagen?= Date: Thu, 2 Jul 2015 16:11:34 +0200 Subject: [PATCH] (#115) Stopped creating text drawables for empty strings Note: Adding empty strings to cvf::TextDrawer will cause asserts. --- ApplicationCode/ModelVisualization/RivFaultPartMgr.cpp | 1 + ApplicationCode/ModelVisualization/RivWellHeadPartMgr.cpp | 2 +- ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ModelVisualization/RivFaultPartMgr.cpp b/ApplicationCode/ModelVisualization/RivFaultPartMgr.cpp index 4de875e6af..8bd54cfbf4 100644 --- a/ApplicationCode/ModelVisualization/RivFaultPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivFaultPartMgr.cpp @@ -427,6 +427,7 @@ void RivFaultPartMgr::createLabelWithAnchorLine(const cvf::Part* part) m_faultLabelLinePart = NULL; if (!part) return; + if (m_rimFault->name().isEmpty()) return; cvf::BoundingBox bb = part->boundingBox(); diff --git a/ApplicationCode/ModelVisualization/RivWellHeadPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellHeadPartMgr.cpp index ab4f4598a3..65f4b8d6c7 100644 --- a/ApplicationCode/ModelVisualization/RivWellHeadPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellHeadPartMgr.cpp @@ -282,7 +282,7 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex) m_wellHeadParts.push_back(part.p()); } - if (m_rimReservoirView->wellCollection()->showWellLabel() && well->showWellLabel()) + if (m_rimReservoirView->wellCollection()->showWellLabel() && well->showWellLabel() && !well->name().isEmpty()) { cvf::Font* standardFont = RiaApplication::instance()->standardFont(); diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp index 1cb9ac4351..1093a46780 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -185,7 +185,7 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl textPosition.z() += 1.2 * characteristicCellSize; m_wellLabelPart = NULL; - if (m_wellPathCollection->showWellPathLabel() && m_rimWellPath->showWellPathLabel()) + if (m_wellPathCollection->showWellPathLabel() && m_rimWellPath->showWellPathLabel() && !m_rimWellPath->name().isEmpty()) { cvf::Font* standardFont = RiaApplication::instance()->standardFont();