diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp index 3d308b0e98..d65a1d909e 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp @@ -56,7 +56,6 @@ #include "RimStimPlanModelTemplateCollection.h" #include "RimTextAnnotation.h" #include "RimTools.h" -#include "RimUserDefinedPolylinesAnnotation.h" #include "RimWellPath.h" #include "RimWellPathCollection.h" #include "RimWellPathGeometryDef.h" @@ -253,7 +252,6 @@ RimStimPlanModel::RimStimPlanModel() CAF_PDM_InitScriptableField( &m_barrierFaultName, "BarrierFaultName", QString( "" ), "Barrier Fault", "", "", "" ); m_barrierFaultName.uiCapability()->setUiReadOnly( true ); - CAF_PDM_InitScriptableFieldNoDefault( &m_barrierAnnotation, "BarrierAnnotation", "Barrier Annotation", "", "", "" ); CAF_PDM_InitScriptableFieldNoDefault( &m_barrierTextAnnotation, "BarrierTextAnnotation", "Barrier Text Annotation", @@ -754,13 +752,6 @@ void RimStimPlanModel::updateDistanceToBarrierAndDip() //-------------------------------------------------------------------------------------------------- void RimStimPlanModel::clearBarrierAnnotation() { - auto existingAnnotation = m_barrierAnnotation.value(); - if ( existingAnnotation ) - { - delete existingAnnotation; - m_barrierAnnotation = nullptr; - } - auto existingTextAnnotation = m_barrierTextAnnotation.value(); if ( existingTextAnnotation ) { @@ -785,31 +776,14 @@ void RimStimPlanModel::addBarrierAnnotation( const cvf::Vec3d& startPosition, RimAnnotationCollectionBase* coll = annotationCollection(); if ( !coll ) return; - { - auto newAnnotation = new RimUserDefinedPolylinesAnnotation(); + auto newAnnotation = new RimTextAnnotation(); + newAnnotation->setText( text ); + newAnnotation->setLabelPoint( endPosition ); + newAnnotation->setAnchorPoint( startPosition ); - RimPolylineTarget* startTarget = new RimPolylineTarget(); - startTarget->setAsPointXYZ( startPosition ); - newAnnotation->insertTarget( nullptr, startTarget ); - - RimPolylineTarget* endTarget = new RimPolylineTarget(); - endTarget->setAsPointXYZ( endPosition ); - newAnnotation->insertTarget( nullptr, endTarget ); - - m_barrierAnnotation = newAnnotation; - dynamic_cast( coll )->addAnnotation( newAnnotation ); - } - - { - auto newAnnotation = new RimTextAnnotation(); - newAnnotation->setText( text ); - newAnnotation->setLabelPoint( endPosition ); - newAnnotation->setAnchorPoint( endPosition ); - - m_barrierTextAnnotation = newAnnotation; - coll->addAnnotation( newAnnotation ); - } + m_barrierTextAnnotation = newAnnotation; + coll->addAnnotation( newAnnotation ); coll->scheduleRedrawOfRelevantViews(); coll->updateConnectedEditors(); } @@ -830,7 +804,6 @@ RimAnnotationCollectionBase* RimStimPlanModel::annotationCollection() void RimStimPlanModel::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { m_thicknessDirectionWellPath.uiCapability()->setUiHidden( true ); - m_barrierAnnotation.uiCapability()->setUiHidden( true ); m_barrierTextAnnotation.uiCapability()->setUiHidden( true ); m_azimuthAngle.uiCapability()->setUiHidden( m_fractureOrientation() != RimStimPlanModel::FractureOrientation::AZIMUTH ); diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.h b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.h index 20b808b028..6f0033412e 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.h +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.h @@ -253,17 +253,16 @@ protected: caf::PdmField m_azimuthAngle; caf::PdmField m_perforationLength; - caf::PdmField m_formationDip; - caf::PdmField m_autoComputeBarrier; - caf::PdmField m_hasBarrier; - caf::PdmField m_distanceToBarrier; - caf::PdmField m_barrierDip; - caf::PdmField m_wellPenetrationLayer; - caf::PdmPtrField m_barrierAnnotation; - caf::PdmPtrField m_barrierTextAnnotation; - caf::PdmField m_barrierFaultName; - caf::PdmField m_showOnlyBarrierFault; - caf::PdmField m_showAllFaults; + caf::PdmField m_formationDip; + caf::PdmField m_autoComputeBarrier; + caf::PdmField m_hasBarrier; + caf::PdmField m_distanceToBarrier; + caf::PdmField m_barrierDip; + caf::PdmField m_wellPenetrationLayer; + caf::PdmPtrField m_barrierTextAnnotation; + caf::PdmField m_barrierFaultName; + caf::PdmField m_showOnlyBarrierFault; + caf::PdmField m_showAllFaults; std::shared_ptr m_calculator; };