mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
As creation of a font is time consuming, create one application font instance
p4#: 21338
This commit is contained in:
@@ -33,8 +33,6 @@ RivReservoirPipesPartMgr::RivReservoirPipesPartMgr(RimReservoirView* reservoirVi
|
||||
m_reservoirView = reservoirView;
|
||||
|
||||
m_scaleTransform = new cvf::Transform();
|
||||
|
||||
m_font = new cvf::FixedAtlasFont(cvf::FixedAtlasFont::STANDARD);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -105,7 +103,7 @@ void RivReservoirPipesPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasic
|
||||
m_wellPipesPartMgrs.push_back(wppmgr);
|
||||
wppmgr->setScaleTransform(m_scaleTransform.p());
|
||||
|
||||
RivWellHeadPartMgr* wellHeadMgr = new RivWellHeadPartMgr(m_reservoirView, m_reservoirView->wellCollection()->wells[i], m_font.p());
|
||||
RivWellHeadPartMgr* wellHeadMgr = new RivWellHeadPartMgr(m_reservoirView, m_reservoirView->wellCollection()->wells[i]);
|
||||
m_wellHeadPartMgrs.push_back(wellHeadMgr);
|
||||
wellHeadMgr->setScaleTransform(m_scaleTransform.p());
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ public:
|
||||
private:
|
||||
caf::PdmPointer<RimReservoirView> m_reservoirView;
|
||||
cvf::ref<cvf::Transform> m_scaleTransform;
|
||||
cvf::ref<cvf::Font> m_font;
|
||||
|
||||
cvf::Collection< RivWellPipesPartMgr > m_wellPipesPartMgrs;
|
||||
cvf::Collection< RivWellHeadPartMgr > m_wellHeadPartMgrs;
|
||||
|
||||
@@ -41,17 +41,16 @@
|
||||
|
||||
#include "RivPipeGeometryGenerator.h"
|
||||
#include "RivWellPipesPartMgr.h"
|
||||
#include "RiaApplication.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivWellHeadPartMgr::RivWellHeadPartMgr(RimReservoirView* reservoirView, RimWell* well, cvf::Font* font)
|
||||
RivWellHeadPartMgr::RivWellHeadPartMgr(RimReservoirView* reservoirView, RimWell* well)
|
||||
{
|
||||
m_rimReservoirView = reservoirView;
|
||||
m_rimWell = well;
|
||||
|
||||
m_font = font;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -232,10 +231,10 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
|
||||
|
||||
if (m_rimReservoirView->wellCollection()->showWellLabel() && well->showWellLabel())
|
||||
{
|
||||
CVF_ASSERT(m_font.p());
|
||||
cvf::Font* standardFont = RiaApplication::instance()->standardFont();
|
||||
|
||||
cvf::ref<cvf::DrawableText> drawableText = new cvf::DrawableText;
|
||||
drawableText->setFont(m_font.p());
|
||||
drawableText->setFont(standardFont);
|
||||
drawableText->setCheckPosVisible(false);
|
||||
drawableText->setDrawBorder(false);
|
||||
drawableText->setDrawBackground(false);
|
||||
|
||||
@@ -38,7 +38,7 @@ class RimReservoirView;
|
||||
class RivWellHeadPartMgr : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RivWellHeadPartMgr(RimReservoirView* reservoirView, RimWell* well, cvf::Font* font);
|
||||
RivWellHeadPartMgr(RimReservoirView* reservoirView, RimWell* well);
|
||||
~RivWellHeadPartMgr();
|
||||
|
||||
void setScaleTransform(cvf::Transform * scaleTransform) { m_scaleTransform = scaleTransform;}
|
||||
@@ -56,6 +56,4 @@ private:
|
||||
|
||||
cvf::ref<cvf::Transform> m_scaleTransform;
|
||||
cvf::Collection< cvf::Part > m_wellHeadParts;
|
||||
|
||||
cvf::ref<cvf::Font> m_font;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user