mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06: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:
@@ -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