2019-01-16 10:51:43 +01:00
|
|
|
#include "RimEclipseContourMapViewCollection.h"
|
2018-10-23 16:32:40 +02:00
|
|
|
|
2026-09-01 15:13:57 +02:00
|
|
|
#include "ContourMap/RimContourMapInViewCollection.h"
|
|
|
|
|
#include "Rim3dView.h"
|
2022-10-31 10:41:50 +01:00
|
|
|
#include "RimEclipseCase.h"
|
2019-09-06 10:40:57 +02:00
|
|
|
#include "RimEclipseContourMapView.h"
|
2026-09-01 15:13:57 +02:00
|
|
|
#include "RimProject.h"
|
2018-10-23 16:32:40 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
CAF_PDM_SOURCE_INIT( RimEclipseContourMapViewCollection, "Eclipse2dViewCollection" );
|
2018-10-23 16:32:40 +02:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2018-10-23 16:32:40 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-01-16 10:51:43 +01:00
|
|
|
RimEclipseContourMapViewCollection::RimEclipseContourMapViewCollection()
|
2018-10-23 16:32:40 +02:00
|
|
|
{
|
2022-01-07 08:31:52 +01:00
|
|
|
CAF_PDM_InitObject( "Contour Maps", ":/2DMaps16x16.png" );
|
2018-10-23 16:32:40 +02:00
|
|
|
|
2026-05-08 15:25:15 +02:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_items, "EclipseViews", "Contour Maps", ":/CrossSection16x16.png" );
|
2018-10-23 16:32:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2018-10-23 16:32:40 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-12 11:13:38 +01:00
|
|
|
RimEclipseContourMapViewCollection::~RimEclipseContourMapViewCollection()
|
|
|
|
|
{
|
|
|
|
|
}
|
2018-10-23 16:32:40 +02:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2018-10-23 16:32:40 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-01-16 10:51:43 +01:00
|
|
|
std::vector<RimEclipseContourMapView*> RimEclipseContourMapViewCollection::views()
|
2018-10-23 16:32:40 +02:00
|
|
|
{
|
2026-05-08 15:25:15 +02:00
|
|
|
return items();
|
2018-10-23 16:32:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2024-04-17 13:46:31 +02:00
|
|
|
void RimEclipseContourMapViewCollection::addView( RimEclipseContourMapView* contourMap )
|
2018-10-23 16:32:40 +02:00
|
|
|
{
|
2026-05-08 15:25:15 +02:00
|
|
|
addItem( contourMap );
|
2026-09-01 15:13:57 +02:00
|
|
|
|
|
|
|
|
RimContourMapInViewCollection::updateViewTreeItemsInAllViews();
|
2018-10-23 16:32:40 +02:00
|
|
|
}
|
2022-10-31 10:41:50 +01:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimEclipseContourMapViewCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
|
|
|
|
std::vector<caf::PdmObjectHandle*>& referringObjects )
|
|
|
|
|
{
|
2023-05-12 21:41:34 +02:00
|
|
|
auto eclipseCase = firstAncestorOrThisOfType<RimEclipseCase>();
|
2022-10-31 10:41:50 +01:00
|
|
|
if ( eclipseCase ) eclipseCase->updateConnectedEditors();
|
2026-09-01 15:13:57 +02:00
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-10-31 10:41:50 +01:00
|
|
|
}
|
2024-03-15 09:32:45 +01:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimEclipseContourMapViewCollection::clearWithoutDelete()
|
|
|
|
|
{
|
2026-05-08 15:25:15 +02:00
|
|
|
m_items.clearWithoutDelete();
|
2024-03-15 09:32:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RimEclipseContourMapViewCollection::removeChild( RimEclipseContourMapView* contourMap )
|
|
|
|
|
{
|
2026-05-08 15:25:15 +02:00
|
|
|
m_items.removeChild( contourMap );
|
2024-03-15 09:32:45 +01:00
|
|
|
}
|