Remove duplicated code

* Use annotation tools from part manager
* Set version to 2023.06.01-dev.06
This commit is contained in:
Magne Sjaastad
2023-09-13 09:43:03 +02:00
committed by GitHub
parent f4c61c9edb
commit c22b8b2e1f
7 changed files with 65 additions and 95 deletions

View File

@@ -290,20 +290,13 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t frameIndex, const caf::Displ
// well disk labels are preferred since they have more info.
if ( well->showWellLabel() && !well->name().isEmpty() && !well->showWellDisks() )
{
cvf::Font* font = RiaGuiApplication::instance()->defaultWellLabelFont();
cvf::ref<cvf::DrawableText> drawableText = new cvf::DrawableText;
drawableText->setFont( font );
drawableText->setCheckPosVisible( false );
drawableText->setDrawBorder( false );
drawableText->setDrawBackground( false );
drawableText->setVerticalAlignment( cvf::TextDrawer::CENTER );
drawableText->setTextColor( simWellInViewCollection()->wellLabelColor() );
cvf::Font* font = RiaGuiApplication::instance()->defaultWellLabelFont();
cvf::String cvfString = cvfqt::Utils::toString( m_rimWell->name() );
cvf::Vec3f textCoord( textPosition );
drawableText->addText( cvfString, textCoord );
auto drawableText = RivAnnotationTools::createDrawableTextNoBackground( font,
simWellInViewCollection()->wellLabelColor(),
m_rimWell->name().toStdString(),
cvf::Vec3f( textPosition ) );
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName( "RivWellHeadPartMgr: text " + cvfString );
@@ -314,7 +307,7 @@ void RivWellHeadPartMgr::buildWellHeadParts( size_t frameIndex, const caf::Displ
part->setEffect( eff.p() );
part->setPriority( RivPartPriority::PartType::Text );
part->setSourceInfo( new RivTextLabelSourceInfo( m_rimWell, cvfString, textCoord ) );
part->setSourceInfo( new RivTextLabelSourceInfo( m_rimWell, cvfString, cvf::Vec3f( textPosition ) ) );
m_wellHeadLabelPart = part;
}