ResInsight/ApplicationLibCode/ProjectDataModel/RimEclipseContourMapViewCollection.cpp
Magne Sjaastad 9b61ebcac2
Maintenance october
* Hide contour plot collection when empty
* Update the project tree when a linked view is removed
* Make sure the window title is in sync with link state
* Do not use link state to find window tile ordering
2022-10-31 10:41:50 +01:00

52 lines
2.2 KiB
C++

#include "RimEclipseContourMapViewCollection.h"
#include "RimEclipseCase.h"
#include "RimEclipseContourMapView.h"
CAF_PDM_SOURCE_INIT( RimEclipseContourMapViewCollection, "Eclipse2dViewCollection" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseContourMapViewCollection::RimEclipseContourMapViewCollection()
{
CAF_PDM_InitObject( "Contour Maps", ":/2DMaps16x16.png" );
CAF_PDM_InitFieldNoDefault( &m_contourMapViews, "EclipseViews", "Contour Maps", ":/CrossSection16x16.png" );
m_contourMapViews.uiCapability()->setUiTreeHidden( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseContourMapViewCollection::~RimEclipseContourMapViewCollection()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimEclipseContourMapView*> RimEclipseContourMapViewCollection::views()
{
return m_contourMapViews.children();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseContourMapViewCollection::push_back( RimEclipseContourMapView* contourMap )
{
m_contourMapViews.push_back( contourMap );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseContourMapViewCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects )
{
RimEclipseCase* eclipseCase = nullptr;
this->firstAncestorOrThisOfType( eclipseCase );
if ( eclipseCase ) eclipseCase->updateConnectedEditors();
}