mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 15:10:22 -05:00
Give RimGridView a RimContourMapInViewCollection and let RimEclipseView and RimGeoMechView build their 3d model from it. A dedicated contour map view (RimEclipseContourMapView/RimStatisticsContourMapView) shows its own contour map and returns no collection of its own, so it is unaffected. Adjust RimSurfaceInViewCollection so surfaces and contour maps coexist in the same 3d view without z-fighting.
82 lines
3.2 KiB
C++
82 lines
3.2 KiB
C++
#include "RimEclipseContourMapViewCollection.h"
|
|
|
|
#include "ContourMap/RimContourMapInViewCollection.h"
|
|
#include "Rim3dView.h"
|
|
#include "RimEclipseCase.h"
|
|
#include "RimEclipseContourMapView.h"
|
|
#include "RimProject.h"
|
|
|
|
CAF_PDM_SOURCE_INIT( RimEclipseContourMapViewCollection, "Eclipse2dViewCollection" );
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
RimEclipseContourMapViewCollection::RimEclipseContourMapViewCollection()
|
|
{
|
|
CAF_PDM_InitObject( "Contour Maps", ":/2DMaps16x16.png" );
|
|
|
|
CAF_PDM_InitFieldNoDefault( &m_items, "EclipseViews", "Contour Maps", ":/CrossSection16x16.png" );
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
RimEclipseContourMapViewCollection::~RimEclipseContourMapViewCollection()
|
|
{
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
std::vector<RimEclipseContourMapView*> RimEclipseContourMapViewCollection::views()
|
|
{
|
|
return items();
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimEclipseContourMapViewCollection::addView( RimEclipseContourMapView* contourMap )
|
|
{
|
|
addItem( contourMap );
|
|
|
|
RimContourMapInViewCollection::updateViewTreeItemsInAllViews();
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimEclipseContourMapViewCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
|
std::vector<caf::PdmObjectHandle*>& referringObjects )
|
|
{
|
|
auto eclipseCase = firstAncestorOrThisOfType<RimEclipseCase>();
|
|
if ( eclipseCase ) eclipseCase->updateConnectedEditors();
|
|
|
|
RimContourMapInViewCollection::updateViewTreeItemsInAllViews();
|
|
|
|
// A deleted contour map may have been visible in a 3d view
|
|
if ( RimProject* project = RimProject::current() )
|
|
{
|
|
for ( Rim3dView* view : project->allViews() )
|
|
{
|
|
if ( view ) view->scheduleCreateDisplayModelAndRedraw();
|
|
}
|
|
}
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimEclipseContourMapViewCollection::clearWithoutDelete()
|
|
{
|
|
m_items.clearWithoutDelete();
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimEclipseContourMapViewCollection::removeChild( RimEclipseContourMapView* contourMap )
|
|
{
|
|
m_items.removeChild( contourMap );
|
|
}
|