Remove old polygon annotations. (#11404)

* Remove old polygon annotations from GUI. 
* Upgrade old annotation objects to new polygon objects on load.
This commit is contained in:
jonjenssen
2024-05-01 10:50:19 +02:00
committed by GitHub
parent 4617bcc673
commit 2e4ca390c7
24 changed files with 119 additions and 1084 deletions

View File

@@ -24,10 +24,6 @@
#include "RimAnnotationInViewCollection.h"
#include "RimProject.h"
#include "RimPolylinesFromFileAnnotationInView.h"
#include "RimUserDefinedPolylinesAnnotationInView.h"
#include "RivPolylinePartMgr.h"
#include "RivReachCircleAnnotationPartMgr.h"
#include "RivTextAnnotationPartMgr.h"
@@ -65,10 +61,6 @@ void RivAnnotationsPartMgr::appendGeometryPartsToModel( cvf::ModelBasicList*
{
partMgr->appendDynamicGeometryPartsToModel( model, displayCoordTransform, boundingBox );
}
for ( auto& partMgr : m_polylineAnnotationPartMgrs )
{
partMgr->appendDynamicGeometryPartsToModel( model, displayCoordTransform, boundingBox );
}
}
//--------------------------------------------------------------------------------------------------
@@ -81,11 +73,9 @@ void RivAnnotationsPartMgr::createAnnotationPartManagers()
if ( colls.empty() ) return;
auto coll = colls.front();
auto localTextAnnotations = coll->textAnnotations();
auto textAnnotations = coll->globalTextAnnotations();
auto reachCircleAnnotations = coll->globalReachCircleAnnotations();
auto userDefinedPolylineAnnotations = coll->globalUserDefinedPolylineAnnotations();
auto polylineFromFileAnnotations = coll->globalPolylineFromFileAnnotations();
auto localTextAnnotations = coll->textAnnotations();
auto textAnnotations = coll->globalTextAnnotations();
auto reachCircleAnnotations = coll->globalReachCircleAnnotations();
clearGeometryCache();
@@ -110,19 +100,6 @@ void RivAnnotationsPartMgr::createAnnotationPartManagers()
m_reachCircleAnnotationPartMgrs.push_back( apm );
}
}
if ( m_polylineAnnotationPartMgrs.size() != userDefinedPolylineAnnotations.size() + polylineFromFileAnnotations.size() )
{
for ( auto annotation : userDefinedPolylineAnnotations )
{
auto* apm = new RivPolylinePartMgr( m_rimView, annotation, coll );
m_polylineAnnotationPartMgrs.push_back( apm );
}
for ( auto annotation : polylineFromFileAnnotations )
{
auto* apm = new RivPolylinePartMgr( m_rimView, annotation, coll );
m_polylineAnnotationPartMgrs.push_back( apm );
}
}
}
//--------------------------------------------------------------------------------------------------
@@ -132,5 +109,4 @@ void RivAnnotationsPartMgr::clearGeometryCache()
{
m_textAnnotationPartMgrs.clear();
m_reachCircleAnnotationPartMgrs.clear();
m_polylineAnnotationPartMgrs.clear();
}

View File

@@ -39,7 +39,6 @@ class DisplayCoordTransform;
class Rim3dView;
class RivTextAnnotationPartMgr;
class RivReachCircleAnnotationPartMgr;
class RivPolylinePartMgr;
class RivAnnotationsPartMgr : public cvf::Object
{
@@ -60,5 +59,4 @@ private:
caf::PdmPointer<Rim3dView> m_rimView;
cvf::Collection<RivTextAnnotationPartMgr> m_textAnnotationPartMgrs;
cvf::Collection<RivReachCircleAnnotationPartMgr> m_reachCircleAnnotationPartMgrs;
cvf::Collection<RivPolylinePartMgr> m_polylineAnnotationPartMgrs;
};