mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 08:25:03 -05:00
#11393 Contour map: Make sure polygon cell filter works as expected
Add the polygonInViewCollection to display the polygon in tree view. This makes the polygon filter work, and interaction in contour map is also supported. Polygon cell filters are not working due to different organization of the project tree for Eclipse view and contour map view. Manually assign pointers to polygon objects.
This commit is contained in:
1 parent
ff12d48ff2
commit
d1e871eb69
2 files changed
+29
-1
No files matched your search
@@ -22,6 +22,7 @@
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFemPartCollection.h"
|
||||
|
||||
#include "Polygons/RimPolygonInView.h"
|
||||
#include "Rim3dView.h"
|
||||
#include "RimCellEdgeColors.h"
|
||||
#include "RimEclipseCase.h"
|
||||
@@ -35,6 +36,7 @@
|
||||
#include "RimGeoMechContourMapView.h"
|
||||
#include "RimGeoMechContourMapViewCollection.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimPolygonFilter.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
|
||||
#include "RimCellFilterCollection.h"
|
||||
@@ -268,6 +270,30 @@ RimEclipseContourMapView* RicNewContourMapViewFeature::createEclipseContourMapFr
|
||||
|
||||
contourMap->initAfterReadRecursively();
|
||||
|
||||
// Polygon cell filters are not working due to different organization of the project tree for Eclipse view and contour map view
|
||||
// Manually assign pointers to polygon objects
|
||||
//
|
||||
// TODO: Find a more robust solution, perhaps introduce a root token making it possible to have a reference string pointing to objects
|
||||
// relative root "$root$ PolygonCollection 0 Polygon 2"
|
||||
// Make sure this concept works for geomech contour maps
|
||||
|
||||
auto sourceFilters = sourceView->cellFilterCollection()->filters();
|
||||
auto destinationFilters = contourMap->cellFilterCollection()->filters();
|
||||
if ( sourceFilters.size() == destinationFilters.size() )
|
||||
{
|
||||
for ( size_t i = 0; i < sourceFilters.size(); ++i )
|
||||
{
|
||||
auto sourcePolygonFilter = dynamic_cast<RimPolygonFilter*>( sourceFilters[i] );
|
||||
auto destinationPolygonFilter = dynamic_cast<RimPolygonFilter*>( destinationFilters[i] );
|
||||
|
||||
if ( sourcePolygonFilter && sourcePolygonFilter->polygonInView() && destinationPolygonFilter )
|
||||
{
|
||||
destinationPolygonFilter->setPolygon( sourcePolygonFilter->polygonInView()->polygon() );
|
||||
destinationPolygonFilter->configurePolygonEditor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return contourMap;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "RiuViewer.h"
|
||||
#include "RivContourMapProjectionPartMgr.h"
|
||||
|
||||
#include "Polygons/RimPolygonInViewCollection.h"
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
#include "RimAnnotationInViewCollection.h"
|
||||
#include "RimCase.h"
|
||||
@@ -231,9 +232,10 @@ void RimEclipseContourMapView::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiT
|
||||
cellResult()->uiCapability()->setUiReadOnly( m_contourMapProjection->isColumnResult() );
|
||||
uiTreeOrdering.add( wellCollection() );
|
||||
uiTreeOrdering.add( faultCollection() );
|
||||
uiTreeOrdering.add( annotationCollection() );
|
||||
uiTreeOrdering.add( m_cellFilterCollection() );
|
||||
uiTreeOrdering.add( nativePropertyFilterCollection() );
|
||||
uiTreeOrdering.add( m_polygonInViewCollection );
|
||||
uiTreeOrdering.add( annotationCollection() );
|
||||
|
||||
uiTreeOrdering.skipRemainingChildren();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user