First non-MDI version. Still some missing links and features.

This commit is contained in:
Jon Jenssen authored and JJ committed 2026-06-17 13:55:32 +02:00
1 parent fee0599139
commit d2d7c6ac61
79 files changed
+421 -1915

No files matched your search

@@ -170,7 +170,7 @@ RimAnalysisPlot::RimAnalysisPlot()
//--------------------------------------------------------------------------------------------------
RimAnalysisPlot::~RimAnalysisPlot()
{
removeMdiWindowFromMdiArea();
removeWindowFromDock();
cleanupBeforeClose();
}
@@ -776,7 +776,7 @@ void RimAnalysisPlot::deleteViewWidget()
//--------------------------------------------------------------------------------------------------
void RimAnalysisPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
updateAndGetCurveAnalyzer();
@@ -51,7 +51,7 @@ RimAnalysisPlotCollection::~RimAnalysisPlotCollection()
RimAnalysisPlot* RimAnalysisPlotCollection::createAnalysisPlot()
{
RimAnalysisPlot* plot = new RimAnalysisPlot();
plot->setAsPlotMdiWindow();
plot->dockAsPlotWindow();
if ( firstEnsemble() )
{
@@ -86,7 +86,7 @@ RimAnalysisPlot* RimAnalysisPlotCollection::createAnalysisPlot()
RimAnalysisPlot* RimAnalysisPlotCollection::createAnalysisPlot( RimSummaryEnsemble* ensemble, const QString& quantityName, std::time_t timeStep )
{
RimAnalysisPlot* plot = new RimAnalysisPlot();
plot->setAsPlotMdiWindow();
plot->dockAsPlotWindow();
applySummaryCaseCollectionAndFieldAddressToPlot( plot, ensemble, quantityName.toStdString() );
plot->setTimeSteps( { timeStep } );
@@ -546,7 +546,7 @@ void RimEclipseContourMapView::childFieldChangedByUi( const caf::PdmFieldHandle*
{
if ( changedChildField == &m_contourMapProjection )
{
updateMdiWindowTitle();
updateWindowTitle();
}
}
@@ -144,7 +144,7 @@ RimCorrelationMatrixPlot::RimCorrelationMatrixPlot()
//--------------------------------------------------------------------------------------------------
RimCorrelationMatrixPlot::~RimCorrelationMatrixPlot()
{
if ( isMdiWindow() ) removeMdiWindowFromMdiArea();
if ( isMainDockedWindow() ) removeWindowFromDock();
cleanupBeforeClose();
}
@@ -385,7 +385,7 @@ QList<caf::PdmOptionItemInfo> RimCorrelationMatrixPlot::calculateValueOptions( c
//--------------------------------------------------------------------------------------------------
void RimCorrelationMatrixPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
m_selectedVarsUiField = selectedVectorNamesText();
@@ -735,7 +735,7 @@ void RimCorrelationMatrixPlot::updatePlotTitle()
{
m_plotWidget->setPlotTitle( m_description );
m_plotWidget->setPlotTitleEnabled( m_showPlotTitle );
if ( isMdiWindow() )
if ( isMainDockedWindow() )
{
m_plotWidget->setPlotTitleFontSize( titleFontSize() );
}
@@ -86,7 +86,7 @@ RimCorrelationPlot::RimCorrelationPlot()
//--------------------------------------------------------------------------------------------------
RimCorrelationPlot::~RimCorrelationPlot()
{
if ( isMdiWindow() ) removeMdiWindowFromMdiArea();
if ( isMainDockedWindow() ) removeWindowFromDock();
cleanupBeforeClose();
}
@@ -177,7 +177,7 @@ QList<caf::PdmOptionItemInfo> RimCorrelationPlot::calculateValueOptions( const c
//--------------------------------------------------------------------------------------------------
void RimCorrelationPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
m_selectedVarsUiField = selectedVectorNamesText();
@@ -79,7 +79,7 @@ RimCorrelationPlotCollection::~RimCorrelationPlotCollection()
RimCorrelationPlot* RimCorrelationPlotCollection::createCorrelationPlot( bool defaultToFirstEnsembleFopt )
{
RimCorrelationPlot* plot = new RimCorrelationPlot();
plot->setAsPlotMdiWindow();
plot->dockAsPlotWindow();
if ( defaultToFirstEnsembleFopt ) applyFirstEnsembleFieldAddressesToPlot( plot, { "FOPT" } );
plot->selectAllParameters();
@@ -96,7 +96,7 @@ RimCorrelationPlot*
RimCorrelationPlotCollection::createCorrelationPlot( RimSummaryEnsemble* ensemble, const QString& quantityName, std::time_t timeStep )
{
RimCorrelationPlot* plot = new RimCorrelationPlot();
plot->setAsPlotMdiWindow();
plot->dockAsPlotWindow();
applyEnsembleFieldAndTimeStepToPlot( plot, ensemble, { quantityName }, timeStep );
plot->selectAllParameters();
@@ -112,7 +112,7 @@ RimCorrelationPlot*
RimCorrelationMatrixPlot* RimCorrelationPlotCollection::createCorrelationMatrixPlot( bool defaultToFirstEnsembleField )
{
RimCorrelationMatrixPlot* plot = new RimCorrelationMatrixPlot();
plot->setAsPlotMdiWindow();
plot->dockAsPlotWindow();
if ( defaultToFirstEnsembleField ) applyFirstEnsembleFieldAddressesToPlot( plot, { "FOPT", "FWPT", "FGPT" } );
plot->selectAllParameters();
@@ -129,7 +129,7 @@ RimCorrelationMatrixPlot* RimCorrelationPlotCollection::createCorrelationMatrixP
std::time_t timeStep )
{
RimCorrelationMatrixPlot* plot = new RimCorrelationMatrixPlot();
plot->setAsPlotMdiWindow();
plot->dockAsPlotWindow();
applyEnsembleFieldAndTimeStepToPlot( plot, ensemble, quantityNames, timeStep );
plot->selectAllParameters();
@@ -144,7 +144,7 @@ RimCorrelationMatrixPlot* RimCorrelationPlotCollection::createCorrelationMatrixP
RimParameterResultCrossPlot* RimCorrelationPlotCollection::createParameterResultCrossPlot( bool defaultToFirstEnsembleFopt )
{
RimParameterResultCrossPlot* plot = new RimParameterResultCrossPlot;
plot->setAsPlotMdiWindow();
plot->dockAsPlotWindow();
if ( defaultToFirstEnsembleFopt ) applyFirstEnsembleFieldAddressesToPlot( plot, { "FOPT" } );
addPlot( plot );
@@ -160,7 +160,7 @@ RimParameterResultCrossPlot* RimCorrelationPlotCollection::createParameterResult
std::time_t timeStep )
{
RimParameterResultCrossPlot* plot = new RimParameterResultCrossPlot;
plot->setAsPlotMdiWindow();
plot->dockAsPlotWindow();
applyEnsembleFieldAndTimeStepToPlot( plot, ensemble, { quantityName }, timeStep );
plot->setEnsembleParameter( paramName );
@@ -174,7 +174,7 @@ RimParameterResultCrossPlot* RimCorrelationPlotCollection::createParameterResult
RimCorrelationReportPlot* RimCorrelationPlotCollection::createCorrelationReportPlot( bool defaultToFirstEnsembleField /*= true */ )
{
RimCorrelationReportPlot* report = new RimCorrelationReportPlot;
report->setAsPlotMdiWindow();
report->dockAsPlotWindow();
if ( defaultToFirstEnsembleField ) applyFirstEnsembleFieldAddressesToReport( report, { "FOPT", "FWPT", "FGPT" }, "FOPT" );
report->matrixPlot()->selectAllParameters();
report->correlationPlot()->selectAllParameters();
@@ -191,7 +191,7 @@ RimCorrelationReportPlot* RimCorrelationPlotCollection::createCorrelationReportP
std::time_t timeStep )
{
RimCorrelationReportPlot* report = new RimCorrelationReportPlot;
report->setAsPlotMdiWindow();
report->dockAsPlotWindow();
applyEnsembleFieldAndTimeStepToReport( report, ensemble, matrixQuantityNames, tornadoAndCrossPlotQuantityName, timeStep );
report->matrixPlot()->selectAllParameters();
report->correlationPlot()->selectAllParameters();
@@ -205,7 +205,7 @@ RimCorrelationReportPlot* RimCorrelationPlotCollection::createCorrelationReportP
RimRftCorrelationReportPlot* RimCorrelationPlotCollection::createRftCorrelationReportPlot( RimWellRftPlot* source )
{
auto* report = new RimRftCorrelationReportPlot;
report->setAsPlotMdiWindow();
report->dockAsPlotWindow();
if ( source )
{
@@ -217,7 +217,7 @@ RimCorrelationReportPlot::RimCorrelationReportPlot()
CAF_PDM_InitField( &m_dockState, "DockState", QString(), "Dock State" );
m_dockState.uiCapability()->setUiHidden( true );
setAsPlotMdiWindow();
dockAsPlotWindow();
m_showWindow = true;
m_showPlotLegends = false;
@@ -255,7 +255,7 @@ RimCorrelationReportPlot::RimCorrelationReportPlot()
//--------------------------------------------------------------------------------------------------
RimCorrelationReportPlot::~RimCorrelationReportPlot()
{
removeMdiWindowFromMdiArea();
removeWindowFromDock();
cleanupBeforeClose();
}
@@ -550,7 +550,7 @@ void RimCorrelationReportPlot::deleteViewWidget()
//--------------------------------------------------------------------------------------------------
void RimCorrelationReportPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
if ( m_showWindow )
{
@@ -97,7 +97,7 @@ RimParameterResultCrossPlot::RimParameterResultCrossPlot()
//--------------------------------------------------------------------------------------------------
RimParameterResultCrossPlot::~RimParameterResultCrossPlot()
{
if ( isMdiWindow() ) removeMdiWindowFromMdiArea();
if ( isMainDockedWindow() ) removeWindowFromDock();
cleanupBeforeClose();
}
@@ -255,7 +255,7 @@ void RimParameterResultCrossPlot::defineEditorAttribute( const caf::PdmFieldHand
//--------------------------------------------------------------------------------------------------
void RimParameterResultCrossPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
m_selectedVarsUiField = selectedVectorNamesText();
@@ -514,7 +514,7 @@ RiuPlotWidget* RimParameterRftCrossPlot::doCreatePlotViewWidget( QWidget* parent
//--------------------------------------------------------------------------------------------------
void RimParameterRftCrossPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
if ( m_plotWidget )
{
@@ -114,13 +114,13 @@ RimRftCorrelationReportPlot::RimRftCorrelationReportPlot()
CAF_PDM_InitField( &m_dockState, "DockState", QString(), "Dock State" );
m_dockState.uiCapability()->setUiHidden( true );
setAsPlotMdiWindow();
dockAsPlotWindow();
m_showWindow = true;
m_showPlotLegends = false;
m_wellRftPlot = new RimWellRftPlot;
m_wellRftPlot->revokeMdiWindowStatus();
m_wellRftPlot->removeWindowFromDock();
m_wellRftPlot->setShowWindow( true );
m_parameterRftCrossPlot = new RimParameterRftCrossPlot;
@@ -134,7 +134,7 @@ RimRftCorrelationReportPlot::RimRftCorrelationReportPlot()
//--------------------------------------------------------------------------------------------------
RimRftCorrelationReportPlot::~RimRftCorrelationReportPlot()
{
removeMdiWindowFromMdiArea();
removeWindowFromDock();
cleanupBeforeClose();
}
@@ -374,7 +374,7 @@ void RimRftCorrelationReportPlot::deleteViewWidget()
//--------------------------------------------------------------------------------------------------
void RimRftCorrelationReportPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
if ( m_showWindow )
{
@@ -279,7 +279,7 @@ RiuPlotWidget* RimRftTornadoPlot::doCreatePlotViewWidget( QWidget* parent )
//--------------------------------------------------------------------------------------------------
void RimRftTornadoPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
if ( m_plotWidget )
{
@@ -98,7 +98,7 @@ RimFlowCharacteristicsPlot::RimFlowCharacteristicsPlot()
CAF_PDM_InitField( &m_maxTof, "MaxTof", 146000, "Max Time of Flight [days]" );
m_showWindow = false;
setAsPlotMdiWindow();
dockAsPlotWindow();
setDeletable( true );
}
@@ -107,7 +107,7 @@ RimFlowCharacteristicsPlot::RimFlowCharacteristicsPlot()
//--------------------------------------------------------------------------------------------------
RimFlowCharacteristicsPlot::~RimFlowCharacteristicsPlot()
{
removeMdiWindowFromMdiArea();
removeWindowFromDock();
if ( m_flowCharPlotWidget )
{
@@ -585,7 +585,7 @@ void RimFlowCharacteristicsPlot::fieldChangedByUi( const caf::PdmFieldHandle* ch
//--------------------------------------------------------------------------------------------------
void RimFlowCharacteristicsPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
if ( m_flowDiagSolution && m_flowCharPlotWidget )
{
@@ -61,7 +61,7 @@ RimTofAccumulatedPhaseFractionsPlot::RimTofAccumulatedPhaseFractionsPlot()
//--------------------------------------------------------------------------------------------------
RimTofAccumulatedPhaseFractionsPlot::~RimTofAccumulatedPhaseFractionsPlot()
{
removeMdiWindowFromMdiArea();
removeWindowFromDock();
if ( m_tofAccumulatedPhaseFractionsPlotWidget )
{
@@ -173,7 +173,7 @@ void RimTofAccumulatedPhaseFractionsPlot::fieldChangedByUi( const caf::PdmFieldH
if ( changedField == &m_userName || changedField == &m_showPlotTitle )
{
updateMdiWindowTitle();
updateWindowTitle();
}
else if ( changedField == &m_maxTof )
{
@@ -199,7 +199,7 @@ QImage RimTofAccumulatedPhaseFractionsPlot::snapshotWindowContent()
void RimTofAccumulatedPhaseFractionsPlot::setDescription( const QString& description )
{
m_userName = description;
updateMdiWindowTitle();
updateWindowTitle();
}
//--------------------------------------------------------------------------------------------------
@@ -222,7 +222,7 @@ void RimTofAccumulatedPhaseFractionsPlot::assignIdIfNecessary()
//--------------------------------------------------------------------------------------------------
void RimTofAccumulatedPhaseFractionsPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
if ( m_tofAccumulatedPhaseFractionsPlotWidget && m_showWindow() )
{
@@ -55,7 +55,7 @@ RimTotalWellAllocationPlot::RimTotalWellAllocationPlot()
//--------------------------------------------------------------------------------------------------
RimTotalWellAllocationPlot::~RimTotalWellAllocationPlot()
{
removeMdiWindowFromMdiArea();
removeWindowFromDock();
if ( m_wellTotalAllocationPlotWidget )
{
@@ -127,7 +127,7 @@ void RimTotalWellAllocationPlot::fieldChangedByUi( const caf::PdmFieldHandle* ch
if ( changedField == &m_userName || changedField == &m_showPlotTitle )
{
updateMdiWindowTitle();
updateWindowTitle();
}
}
@@ -156,7 +156,7 @@ QImage RimTotalWellAllocationPlot::snapshotWindowContent()
void RimTotalWellAllocationPlot::setDescription( const QString& description )
{
m_userName = description;
updateMdiWindowTitle();
updateWindowTitle();
}
//--------------------------------------------------------------------------------------------------
@@ -220,7 +220,7 @@ void RimTotalWellAllocationPlot::clearSlices()
//--------------------------------------------------------------------------------------------------
void RimTotalWellAllocationPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
}
//--------------------------------------------------------------------------------------------------
@@ -126,7 +126,7 @@ RimWellAllocationOverTimePlot::RimWellAllocationOverTimePlot()
m_axisValueFontSize = caf::FontTools::RelativeSize::Medium;
m_legendFontSize = caf::FontTools::RelativeSize::Medium;
setAsPlotMdiWindow();
dockAsPlotWindow();
setShowWindow( false );
}
@@ -135,7 +135,7 @@ RimWellAllocationOverTimePlot::RimWellAllocationOverTimePlot()
//--------------------------------------------------------------------------------------------------
RimWellAllocationOverTimePlot::~RimWellAllocationOverTimePlot()
{
removeMdiWindowFromMdiArea();
removeWindowFromDock();
deleteViewWidget();
}
@@ -302,7 +302,7 @@ void RimWellAllocationOverTimePlot::deleteViewWidget()
//--------------------------------------------------------------------------------------------------
void RimWellAllocationOverTimePlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
if ( m_plotWidget == nullptr || m_case == nullptr )
{
@@ -121,7 +121,7 @@ RimWellAllocationPlot::RimWellAllocationPlot()
CAF_PDM_InitFieldNoDefault( &m_tofAccumulatedPhaseFractionsPlot, "TofAccumulatedPhaseFractionsPlot", "TOF Accumulated Phase Fractions" );
m_tofAccumulatedPhaseFractionsPlot = new RimTofAccumulatedPhaseFractionsPlot;
setAsPlotMdiWindow();
dockAsPlotWindow();
m_accumulatedWellFlowPlot->setAvailableDepthUnits( {} );
m_accumulatedWellFlowPlot->setAvailableDepthTypes(
@@ -141,7 +141,7 @@ RimWellAllocationPlot::RimWellAllocationPlot()
//--------------------------------------------------------------------------------------------------
RimWellAllocationPlot::~RimWellAllocationPlot()
{
removeMdiWindowFromMdiArea();
removeWindowFromDock();
delete m_accumulatedWellFlowPlot();
delete m_totalWellAllocationPlot();
@@ -524,7 +524,7 @@ void RimWellAllocationPlot::addStackedCurve( const QString& tracerNa
//--------------------------------------------------------------------------------------------------
void RimWellAllocationPlot::updateWidgetTitleWindowTitle()
{
updateMdiWindowTitle();
updateWindowTitle();
if ( m_wellAllocationPlotWidget )
{
@@ -739,7 +739,7 @@ QString RimWellAllocationPlot::wellName() const
//--------------------------------------------------------------------------------------------------
void RimWellAllocationPlot::removeFromMdiAreaAndDeleteViewWidget()
{
removeMdiWindowFromMdiArea();
removeWindowFromDock();
deleteViewWidget();
}
@@ -862,7 +862,7 @@ QString RimWellAllocationPlot::description() const
//--------------------------------------------------------------------------------------------------
void RimWellAllocationPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
if ( !m_case )
{
@@ -194,7 +194,7 @@ RimWellConnectivityTable::RimWellConnectivityTable()
CAF_PDM_InitFieldNoDefault( &m_rangeType, "RangeType", "Range Type" );
setLegendsVisible( true );
setAsPlotMdiWindow();
dockAsPlotWindow();
setShowWindow( false );
}
@@ -203,7 +203,7 @@ RimWellConnectivityTable::RimWellConnectivityTable()
//--------------------------------------------------------------------------------------------------
RimWellConnectivityTable::~RimWellConnectivityTable()
{
if ( isMdiWindow() ) removeMdiWindowFromMdiArea();
if ( isMainDockedWindow() ) removeWindowFromDock();
cleanupBeforeClose();
}
@@ -531,7 +531,7 @@ void RimWellConnectivityTable::defineEditorAttribute( const caf::PdmFieldHandle*
//--------------------------------------------------------------------------------------------------
void RimWellConnectivityTable::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
if ( m_matrixPlotWidget == nullptr || m_case == nullptr )
{
@@ -80,7 +80,7 @@ RimWellDistributionPlotCollection::RimWellDistributionPlotCollection()
m_showWindow = false;
setAsPlotMdiWindow();
dockAsPlotWindow();
addPlot( new RimWellDistributionPlot( RiaDefines::PhaseType::OIL_PHASE ) );
addPlot( new RimWellDistributionPlot( RiaDefines::PhaseType::GAS_PHASE ) );
@@ -92,7 +92,7 @@ RimWellDistributionPlotCollection::RimWellDistributionPlotCollection()
//--------------------------------------------------------------------------------------------------
RimWellDistributionPlotCollection::~RimWellDistributionPlotCollection()
{
removeMdiWindowFromMdiArea();
removeWindowFromDock();
m_plots.deleteChildren();
cleanupBeforeClose();
@@ -188,7 +188,7 @@ caf::PdmFieldHandle* RimWellDistributionPlotCollection::userDescriptionField()
void RimWellDistributionPlotCollection::onLoadDataAndUpdate()
{
// cvf::Trace::show("RimWellDistributionPlotCollection::onLoadDataAndUpdate()");
updateMdiWindowVisibility();
updateDockWindowVisibility();
updatePlots();
updateLayout();
}
@@ -137,7 +137,7 @@ RimWellPltPlot::RimWellPltPlot()
m_nameConfig->setCustomName( "PLT Plot" );
setNamingMethod( RiaDefines::ObjectNamingMethod::CUSTOM );
setAsPlotMdiWindow();
dockAsPlotWindow();
m_doInitAfterLoad = false;
m_isOnLoad = true;
m_plotLegendsHorizontal = false;
@@ -151,7 +151,7 @@ RimWellPltPlot::RimWellPltPlot()
//--------------------------------------------------------------------------------------------------
RimWellPltPlot::~RimWellPltPlot()
{
removeMdiWindowFromMdiArea();
removeWindowFromDock();
deleteViewWidget();
}
@@ -1073,7 +1073,7 @@ void RimWellPltPlot::onLoadDataAndUpdate()
m_isOnLoad = false;
}
updateMdiWindowVisibility();
updateDockWindowVisibility();
updateFormationsOnPlot();
syncCurvesFromUiSelection();
}
@@ -147,7 +147,7 @@ RimWellRftPlot::RimWellRftPlot()
setPlotTitleVisible( true );
setAsPlotMdiWindow();
dockAsPlotWindow();
m_isOnLoad = true;
}
@@ -156,7 +156,7 @@ RimWellRftPlot::RimWellRftPlot()
//--------------------------------------------------------------------------------------------------
RimWellRftPlot::~RimWellRftPlot()
{
removeMdiWindowFromMdiArea();
removeWindowFromDock();
deleteViewWidget();
}
@@ -1358,7 +1358,7 @@ void RimWellRftPlot::onLoadDataAndUpdate()
m_isOnLoad = false;
}
updateMdiWindowVisibility();
updateDockWindowVisibility();
updateFormationsOnPlot();
if ( depthType() == RiaDefines::DepthType::MEASURED_DEPTH )
@@ -193,7 +193,7 @@ void RimGeoMechView::onLoadDataAndUpdate()
progress.incrementProgress();
progress.setProgressDescription( "Create Display model" );
updateMdiWindowVisibility();
updateDockWindowVisibility();
geoMechPropertyFilterCollection()->loadAndInitializePropertyFilters();
m_wellMeasurementCollection->syncWithChangesInWellMeasurementCollection();
@@ -72,7 +72,7 @@ RimGridCrossPlot::RimGridCrossPlot()
//--------------------------------------------------------------------------------------------------
RimGridCrossPlot::~RimGridCrossPlot()
{
removeMdiWindowFromMdiArea();
if ( isMainDockedWindow() ) removeWindowFromDock();
cleanupBeforeClose();
}
@@ -464,7 +464,7 @@ void RimGridCrossPlot::deleteViewWidget()
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
for ( auto dataSet : m_crossPlotDataSets )
{
@@ -485,7 +485,7 @@ void RimGridCrossPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
caf::PdmUiGroup* generalGroup = uiOrdering.addNewGroup( "Plot Options" );
generalGroup->add( &m_showInfoBox );
if ( isMdiWindow() )
if ( isMainDockedWindow() )
{
RimPlotWindow::uiOrderingForLegendsAndFonts( uiConfigName, uiOrdering );
}
@@ -595,7 +595,7 @@ void RimGridCrossPlot::updateCurveNamesAndPlotTitle()
m_plotWidget->setPlotTitle( plotTitle );
m_plotWidget->setPlotTitleEnabled( m_showPlotTitle && !isSubPlot() );
}
updateMdiWindowTitle();
updateWindowTitle();
updateInfoBox();
}
@@ -61,7 +61,7 @@ size_t RimGridCrossPlotCollection::plotCount() const
RimGridCrossPlot* RimGridCrossPlotCollection::createGridCrossPlot()
{
RimGridCrossPlot* plot = new RimGridCrossPlot();
plot->setAsPlotMdiWindow();
plot->dockAsPlotWindow();
// plot->setDescription(QString("Summary Cross Plot %1").arg(m_gridCrossPlots.size()));
addPlot( plot );
@@ -87,7 +87,7 @@ std::vector<RimSaturationPressurePlot*>
if ( eqlnumRegionIdsFound.find( zeroBasedEquilibriumRegion + 1 ) != eqlnumRegionIdsFound.end() )
{
RimSaturationPressurePlot* plot = new RimSaturationPressurePlot();
plot->setAsPlotMdiWindow();
plot->dockAsPlotWindow();
// As discussed with Liv Merete, it is not any use for creation of different plots for matrix/fracture. For
// now, use hardcoded value for MATRIX
@@ -131,7 +131,7 @@ RimHistogramPlot::~RimHistogramPlot()
{
m_isValid = false;
removeMdiWindowFromMdiArea();
if ( isMainDockedWindow() ) removeWindowFromDock();
deletePlotCurvesAndPlotWidget();
}
@@ -261,7 +261,7 @@ void RimHistogramPlot::updatePlotTitle()
}
updateCurveNames();
updateMdiWindowTitle();
updateWindowTitle();
if ( plotWidget() )
{
@@ -662,7 +662,7 @@ void RimHistogramPlot::onLoadDataAndUpdate()
updatePlotTitle();
auto plotWindow = firstAncestorOrThisOfType<RimMultiPlot>();
if ( plotWindow == nullptr ) updateMdiWindowVisibility();
if ( plotWindow == nullptr ) updateDockWindowVisibility();
if ( m_histogramCurveCollection )
{
@@ -987,7 +987,7 @@ void RimHistogramPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
{
caf::PdmUiGroup* mainOptions = uiOrdering.addNewGroup( "General Plot Options" );
if ( isMdiWindow() )
if ( isMainDockedWindow() )
{
mainOptions->add( &m_showPlotTitle );
if ( m_showPlotTitle )
@@ -1008,7 +1008,7 @@ void RimHistogramPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
uiOrdering.add( &m_histogramFrequencyType );
uiOrdering.add( &m_graphType );
if ( isMdiWindow() )
if ( isMainDockedWindow() )
{
RimPlotWindow::uiOrderingForLegendsAndFonts( uiConfigName, uiOrdering );
}
@@ -794,7 +794,7 @@ cvf::Transform* Rim2dIntersectionView::scaleTransform()
//--------------------------------------------------------------------------------------------------
void Rim2dIntersectionView::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
scheduleCreateDisplayModelAndRedraw();
}
@@ -186,7 +186,7 @@ Rim3dView::Rim3dView()
m_annotationsPartManager = new RivAnnotationsPartMgr( this );
m_measurementPartManager = new RivMeasurementPartMgr( this );
this->setAs3DViewMdiWindow();
this->dockAs3DViewWindow();
// Every timer tick, send a signal for updating animations.
// Any animation is supposed to connect to this signal
@@ -214,10 +214,13 @@ Rim3dView::~Rim3dView()
// Make sure the object is disconnected from other objects before delete
prepareForDelete();
removeMdiWindowFromMdiArea();
removeWindowFromDock();
delete m_viewer;
m_viewer = nullptr;
if ( m_viewer )
{
m_viewer->deleteLater();
m_viewer = nullptr;
}
}
//--------------------------------------------------------------------------------------------------
@@ -396,7 +399,7 @@ void Rim3dView::assignIdIfNecessary()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dView::updateMdiWindowTitle()
void Rim3dView::updateWindowTitle()
{
if ( m_viewer )
{
@@ -991,7 +994,7 @@ void Rim3dView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const
}
else if ( changedField == m_nameConfig->nameField() )
{
updateMdiWindowTitle();
updateWindowTitle();
if ( viewController() )
{
@@ -1437,7 +1440,7 @@ void Rim3dView::updateFonts()
//--------------------------------------------------------------------------------------------------
void Rim3dView::performAutoNameUpdate()
{
updateMdiWindowTitle();
updateWindowTitle();
}
//--------------------------------------------------------------------------------------------------
@@ -1677,14 +1680,6 @@ void Rim3dView::handleMdiWindowClosed()
RimViewWindow::handleMdiWindowClosed();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dView::setMdiWindowGeometry( const RimMdiWindowGeometry& windowGeometry )
{
RimViewWindow::setMdiWindowGeometry( windowGeometry );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -1927,7 +1922,7 @@ void Rim3dView::convertToDocking( RiuMainWindowBase* mainWindow )
{
if ( isDockingViewer() ) return;
removeMdiWindowFromMdiArea();
removeWindowFromDock();
QWidget* viewWidget = createViewWidget( nullptr );
@@ -1950,7 +1945,7 @@ void Rim3dView::convertToMdi( RiuMainWindowBase* mainWindow )
m_windowController->updateViewerWidget();
updateMdiWindowVisibility();
updateDockWindowVisibility();
updateViewWidgetAfterCreation();
scheduleCreateDisplayModelAndRedraw();
@@ -200,7 +200,7 @@ public:
Rim3dView* activeComparisonView() const;
void setComparisonView( Rim3dView* compView );
std::set<Rim3dView*> viewsUsingThisAsComparisonView();
void updateMdiWindowTitle() override;
void updateWindowTitle() override;
std::vector<Rim3dView*> validComparisonViews() const;
RimViewLinker* assosiatedViewLinker() const override;
@@ -318,7 +318,6 @@ private:
caf::PdmObjectHandle* implementingPdmObject() override;
void handleMdiWindowClosed() override;
void setMdiWindowGeometry( const RimMdiWindowGeometry& windowGeometry ) override;
// Pure private methods
@@ -185,7 +185,7 @@ RimDepthTrackPlot::~RimDepthTrackPlot()
delete m_commonDataSource;
delete m_nameConfig;
removeMdiWindowFromMdiArea();
removeWindowFromDock();
m_plots.deleteChildren();
cleanupBeforeClose();
@@ -791,7 +791,7 @@ void RimDepthTrackPlot::performAutoNameUpdate()
m_viewer->setTitleVisible( m_showPlotTitle() );
m_viewer->setPlotTitle( m_plotWindowTitle );
}
updateMdiWindowTitle();
updateWindowTitle();
}
//--------------------------------------------------------------------------------------------------
@@ -1228,7 +1228,7 @@ void RimDepthTrackPlot::initAfterRead()
//--------------------------------------------------------------------------------------------------
void RimDepthTrackPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
performAutoNameUpdate();
updatePlots();
updateLayout();
@@ -33,12 +33,9 @@ CAF_PDM_XML_SOURCE_INIT( RimDockWindowController, "DockWindowController" );
//--------------------------------------------------------------------------------------------------
RimDockWindowController::RimDockWindowController()
{
CAF_PDM_InitField( &m_mainWindowID, "MainWindowID", -1, "" );
CAF_PDM_InitField( &m_x, "xPos", -1, "" );
CAF_PDM_InitField( &m_y, "yPos", -1, "" );
CAF_PDM_InitField( &m_width, "Width", -1, "" );
CAF_PDM_InitField( &m_height, "Height", -1, "" );
CAF_PDM_InitField( &m_isMaximized, "IsMaximized", false, "" );
CAF_PDM_InitField( &m_mainWindowID, "MainWindowID", 0, "" );
CAF_PDM_InitFieldNoDefault( &m_viewToControl, "ViewToControl", "" );
m_viewToControl = nullptr;
}
//--------------------------------------------------------------------------------------------------
@@ -48,36 +45,6 @@ RimDockWindowController::~RimDockWindowController()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimDockWindowController::setWindowGeometry( const RimMdiWindowGeometry& windowGeometry )
{
m_mainWindowID = windowGeometry.mainWindowID;
m_x = windowGeometry.x;
m_y = windowGeometry.y;
m_width = windowGeometry.width;
m_height = windowGeometry.height;
m_isMaximized = windowGeometry.isMaximized;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimMdiWindowGeometry RimDockWindowController::windowGeometry()
{
RimMdiWindowGeometry windowGeometry;
windowGeometry.mainWindowID = m_mainWindowID;
windowGeometry.x = m_x;
windowGeometry.y = m_y;
windowGeometry.width = m_width;
windowGeometry.height = m_height;
windowGeometry.isMaximized = m_isMaximized;
return windowGeometry;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -98,10 +65,12 @@ void RimDockWindowController::handleViewerDeletion()
void RimDockWindowController::removeWindowFromDock()
{
RiuMainWindowBase* mainWin = getMainWindow();
if ( mainWin && viewWidget() )
if ( mainWin && viewWidget() && viewPdmObject() )
{
mainWin->removeViewer( viewWidget() );
viewPdmObject()->deleteDockViewer();
viewPdmObject()->deleteViewWidget();
mainWin->removeViewer( viewWidget() );
}
}
@@ -110,7 +79,7 @@ void RimDockWindowController::removeWindowFromDock()
//--------------------------------------------------------------------------------------------------
RimViewWindow* RimDockWindowController::viewPdmObject()
{
return firstAncestorOrThisOfType<RimViewWindow>();
return m_viewToControl;
}
//--------------------------------------------------------------------------------------------------
@@ -118,6 +87,7 @@ RimViewWindow* RimDockWindowController::viewPdmObject()
//--------------------------------------------------------------------------------------------------
QWidget* RimDockWindowController::viewWidget()
{
if ( !viewPdmObject() ) return nullptr;
return viewPdmObject()->viewWidget();
}
@@ -138,10 +108,6 @@ RiuMainWindowBase* RimDockWindowController::getMainWindow()
//--------------------------------------------------------------------------------------------------
void RimDockWindowController::setupBeforeSave()
{
if ( viewWidget() && getMainWindow() )
{
setWindowGeometry( getMainWindow()->windowGeometryForViewer( viewWidget() ) );
}
}
//--------------------------------------------------------------------------------------------------
@@ -151,6 +117,7 @@ void RimDockWindowController::updateViewerWidget()
{
RiuMainWindowBase* mainWindow = getMainWindow();
if ( !mainWindow ) return;
if ( !viewPdmObject() ) return;
if ( viewPdmObject()->isWindowVisible() )
{
@@ -159,22 +126,37 @@ void RimDockWindowController::updateViewerWidget()
ads::CDockWidget* dockWidget = viewPdmObject()->createDockWidget();
QWidget* viewWidget = viewPdmObject()->createViewWidget( dockWidget );
dockWidget->setWidget( viewWidget );
mainWindow->initializeViewer( dockWidget, viewWidget, windowGeometry() );
mainWindow->initializeViewer( dockWidget, viewWidget );
viewPdmObject()->updateViewWidgetAfterCreation();
}
viewPdmObject()->updateMdiWindowTitle();
viewPdmObject()->updateWindowTitle();
}
else
{
if ( viewWidget() )
{
setWindowGeometry( mainWindow->windowGeometryForViewer( viewWidget() ) );
viewPdmObject()->deleteDockViewer();
mainWindow->removeViewer( viewWidget() );
viewPdmObject()->deleteViewWidget();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimDockWindowController::setMainWindowId( int mainId )
{
m_mainWindowID = mainId;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimDockWindowController::setViewToControl( RimViewWindow* view )
{
m_viewToControl = view;
}
@@ -23,7 +23,6 @@
#include "cafPdmObject.h"
class RiuMainWindowBase;
// class RiuMdiSubWindow;
class RimViewWindow;
struct RimMdiWindowGeometry;
@@ -39,8 +38,8 @@ public:
RimDockWindowController();
~RimDockWindowController() override;
void setWindowGeometry( const RimMdiWindowGeometry& windowGeometry );
RimMdiWindowGeometry windowGeometry();
void setMainWindowId( int mainId );
void setViewToControl( RimViewWindow* view );
void updateViewerWidget();
void handleViewerDeletion();
@@ -55,11 +54,6 @@ protected:
void setupBeforeSave() override;
private:
caf::PdmField<int> m_mainWindowID;
caf::PdmField<int> m_x;
caf::PdmField<int> m_y;
caf::PdmField<int> m_width;
caf::PdmField<int> m_height;
caf::PdmField<bool> m_isMaximized;
caf::PdmField<int> m_mainWindowID;
caf::PdmPtrField<RimViewWindow*> m_viewToControl;
};
@@ -579,7 +579,7 @@ void RimEclipseView::childFieldChangedByUi( const caf::PdmFieldHandle* changedCh
{
if ( changedChildField == &m_cellResult )
{
updateMdiWindowTitle();
updateWindowTitle();
m_propertyFilterCollection->updateDefaultResult( m_cellResult() );
}
@@ -1268,7 +1268,7 @@ void RimEclipseView::onLoadDataAndUpdate()
faultResultSettings()->customFaultResult()->loadResult();
fractureColors()->loadDataAndUpdate();
updateMdiWindowVisibility();
updateDockWindowVisibility();
m_propertyFilterCollection()->loadAndInitializePropertyFilters();
@@ -172,7 +172,7 @@ void RimMainPlotCollection::initAfterRead()
auto* summaryMultiPlot = new RimSummaryMultiPlot;
summaryMultiPlot->setMultiPlotTitle( QString( "Multi Plot %1" ).arg( m_summaryMultiPlotCollection->multiPlots().size() + 1 ) );
summaryMultiPlot->setAsPlotMdiWindow();
summaryMultiPlot->dockAsPlotWindow();
m_summaryMultiPlotCollection->addSummaryMultiPlot( summaryMultiPlot );
// We want to convert RimSummaryCrossPlot into a RimSummaryPlot. The cross plot is derived from RimSummaryPlot, but we need to
@@ -85,7 +85,7 @@ RimMultiPlot::~RimMultiPlot()
{
m_isValid = false;
removeMdiWindowFromMdiArea();
removeWindowFromDock();
m_plots.deleteChildren();
cleanupBeforeClose();
@@ -259,7 +259,7 @@ void RimMultiPlot::movePlotsToThis( const std::vector<RimPlot*>& plotsToMove, in
}
else
{
plotsToMove[tIdx]->removeFromMdiAreaAndCollection();
plotsToMove[tIdx]->removeFromDockAreaAndCollection();
}
}
@@ -790,7 +790,7 @@ void RimMultiPlot::onLoadDataAndUpdate()
bool originalShowState = m_showPlotLegends();
m_showPlotLegends = false;
updateMdiWindowVisibility();
updateDockWindowVisibility();
updatePlotTitles();
applyPlotWindowTitleToWidgets();
updatePlots();
@@ -820,7 +820,7 @@ void RimMultiPlot::applyPlotWindowTitleToWidgets()
m_viewer->setTitleVisible( m_showPlotWindowTitle() );
m_viewer->setPlotTitle( multiPlotTitle() );
}
updateMdiWindowTitle();
updateWindowTitle();
}
//--------------------------------------------------------------------------------------------------
@@ -138,11 +138,11 @@ void RimPlot::setColSpan( RowOrColSpan colSpan )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlot::removeFromMdiAreaAndCollection()
void RimPlot::removeFromDockAreaAndCollection()
{
if ( isMdiWindow() )
if ( isMainDockedWindow() )
{
revokeMdiWindowStatus();
removeWindowFromDock();
}
auto plotCollection = firstAncestorOfType<RimAbstractPlotCollection>();
@@ -165,7 +165,7 @@ void RimPlot::updateAfterInsertingIntoMultiPlot()
//--------------------------------------------------------------------------------------------------
void RimPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
if ( !isMdiWindow() )
if ( !isMainDockedWindow() )
{
uiOrdering.add( &m_rowSpan );
uiOrdering.add( &m_colSpan );
@@ -73,7 +73,7 @@ public:
RowOrColSpan colSpan() const;
void setRowSpan( RowOrColSpan rowSpan );
void setColSpan( RowOrColSpan colSpan );
void removeFromMdiAreaAndCollection();
void removeFromDockAreaAndCollection();
void updateAfterInsertingIntoMultiPlot();
// Pure virtual interface methods
@@ -389,9 +389,9 @@ bool RimPlotWindow::hasCustomPageLayout( QPageLayout* customPageLayout ) const
//--------------------------------------------------------------------------------------------------
void RimPlotWindow::updateWindowVisibility()
{
if ( isMdiWindow() )
if ( isMainDockedWindow() )
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
}
else
{
@@ -414,7 +414,7 @@ void RimPlotWindow::setId( int id )
//--------------------------------------------------------------------------------------------------
void RimPlotWindow::assignIdIfNecessary()
{
if ( m_id == -1 && isMdiWindow() )
if ( m_id == -1 && isMainDockedWindow() )
{
RimProject::current()->assignPlotIdToPlotWindow( this );
}
@@ -654,7 +654,7 @@ void RimTools::updateViewWindowContent( std::vector<caf::PdmObjectHandle*>& obje
}
else
{
viewWindow->updateMdiWindowVisibility();
viewWindow->updateDockWindowVisibility();
}
}
}
@@ -168,7 +168,7 @@ void RimViewController::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel
updateDisplayNameAndIcon();
updateTimeStepLink();
if ( m_managedView ) m_managedView->updateMdiWindowTitle();
if ( m_managedView ) m_managedView->updateWindowTitle();
}
else if ( changedField == &m_syncCamera )
{
@@ -233,13 +233,13 @@ void RimViewLinker::updateOverrides()
//--------------------------------------------------------------------------------------------------
void RimViewLinker::updateWindowTitles()
{
if ( m_masterView ) m_masterView->updateMdiWindowTitle();
if ( m_masterView ) m_masterView->updateWindowTitle();
for ( RimViewController* viewController : m_viewControllers )
{
if ( auto view = viewController->managedView() )
{
view->updateMdiWindowTitle();
view->updateWindowTitle();
}
}
}
@@ -26,6 +26,7 @@
#include "RicfCommandObject.h"
#include "Rim3dView.h"
#include "RimDockWindowController.h"
#include "RimProject.h"
@@ -46,18 +47,12 @@ CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimViewWindow, "ViewWindow" ); // Do not use.
//--------------------------------------------------------------------------------------------------
RimViewWindow::RimViewWindow()
: m_dockWidget( nullptr )
, m_windowController( nullptr )
{
CAF_PDM_InitScriptableObjectWithNameAndComment( "View window", "", "", "", "ViewWindow", "The Base Class for all Views and Plots in ResInsight" );
CAF_PDM_InitFieldNoDefault( &m_windowController, "WindowController", "" );
m_windowController.uiCapability()->setUiTreeChildrenHidden( true );
CAF_PDM_InitField( &m_showWindow, "ShowWindow", true, "Show Window" );
m_showWindow.uiCapability()->setUiHidden( true );
// Obsolete field
CAF_PDM_InitFieldNoDefault( &obsoleteField_windowGeometry, "WindowGeometry", "" );
RiaFieldHandleTools::disableWriteAndSetFieldHidden( &obsoleteField_windowGeometry );
}
//--------------------------------------------------------------------------------------------------
@@ -65,7 +60,6 @@ RimViewWindow::RimViewWindow()
//--------------------------------------------------------------------------------------------------
RimViewWindow::~RimViewWindow()
{
if ( m_windowController() ) delete m_windowController();
}
//--------------------------------------------------------------------------------------------------
@@ -97,9 +91,17 @@ void RimViewWindow::loadDataAndUpdate()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimViewWindow::removeMdiWindowFromMdiArea()
bool RimViewWindow::isMainDockedWindow() const
{
if ( m_windowController() ) m_windowController->removeWindowFromDock();
return m_windowController != nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimViewWindow::removeWindowFromDock()
{
if ( m_windowController != nullptr ) m_windowController->removeWindowFromDock();
}
//--------------------------------------------------------------------------------------------------
@@ -122,19 +124,28 @@ QString RimViewWindow::windowTitle()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimViewWindow::handleMdiWindowClosed()
void RimViewWindow::deleteDockViewer()
{
if ( m_windowController() ) m_windowController->handleViewerDeletion();
m_dockWidget->deleteDockWidget();
m_dockWidget = nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimViewWindow::updateMdiWindowVisibility()
void RimViewWindow::handleMdiWindowClosed()
{
if ( m_windowController != nullptr ) m_windowController->handleViewerDeletion();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimViewWindow::updateDockWindowVisibility()
{
if ( !RiaGuiApplication::isRunning() ) return;
if ( m_windowController() )
if ( m_windowController != nullptr )
{
m_windowController->updateViewerWidget();
}
@@ -157,58 +168,17 @@ void RimViewWindow::updateMdiWindowVisibility()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimViewWindow::setAs3DViewMdiWindow()
void RimViewWindow::dockAs3DViewWindow()
{
setAsMdiWindow( 0 );
dockInWindow( 0 );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimViewWindow::setAsPlotMdiWindow()
void RimViewWindow::dockAsPlotWindow()
{
setAsMdiWindow( 1 );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimViewWindow::revokeMdiWindowStatus()
{
if ( m_windowController() )
{
handleMdiWindowClosed();
deleteViewWidget();
delete m_windowController();
m_windowController = nullptr;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimViewWindow::isMdiWindow() const
{
return m_windowController() != nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimViewWindow::setMdiWindowGeometry( const RimMdiWindowGeometry& windowGeometry )
{
if ( m_windowController() ) m_windowController()->setWindowGeometry( windowGeometry );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimMdiWindowGeometry RimViewWindow::mdiWindowGeometry()
{
if ( m_windowController() )
return m_windowController()->windowGeometry();
else
return RimMdiWindowGeometry();
dockInWindow( 1 );
}
//--------------------------------------------------------------------------------------------------
@@ -272,7 +242,7 @@ void RimViewWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedField, c
}
else
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
}
uiCapability()->updateUiIconFromToggleField();
}
@@ -281,7 +251,7 @@ void RimViewWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedField, c
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimViewWindow::updateMdiWindowTitle()
void RimViewWindow::updateWindowTitle()
{
if ( viewWidget() && dockWidget() )
{
@@ -293,44 +263,21 @@ void RimViewWindow::updateMdiWindowTitle()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimViewWindow::setAsMdiWindow( int mainWindowID )
void RimViewWindow::dockInWindow( int mainWindowID )
{
if ( !m_windowController() )
if ( m_windowController == nullptr )
{
m_windowController = new RimDockWindowController;
RimMdiWindowGeometry mwg;
mwg.mainWindowID = mainWindowID;
setMdiWindowGeometry( mwg );
m_windowController = new RimDockWindowController();
m_windowController->setViewToControl( this );
}
m_windowController->setMainWindowId( mainWindowID );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
#include "Rim3dView.h"
void RimViewWindow::initAfterRead()
{
if ( obsoleteField_windowGeometry.value().size() == 5 )
{
RimMdiWindowGeometry wg;
int mainWindowID = -1;
if ( dynamic_cast<Rim3dView*>( this ) )
mainWindowID = 0;
else
mainWindowID = 1;
wg.mainWindowID = mainWindowID;
wg.x = obsoleteField_windowGeometry.value()[0];
wg.y = obsoleteField_windowGeometry.value()[1];
wg.width = obsoleteField_windowGeometry.value()[2];
wg.height = obsoleteField_windowGeometry.value()[3];
wg.isMaximized = obsoleteField_windowGeometry.value()[4];
setAsMdiWindow( mainWindowID );
setMdiWindowGeometry( wg );
}
}
//--------------------------------------------------------------------------------------------------
@@ -25,8 +25,6 @@
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include <vector>
class RimDockWindowController;
namespace ads
@@ -34,28 +32,6 @@ namespace ads
class CDockWidget;
} // namespace ads
struct RimMdiWindowGeometry
{
RimMdiWindowGeometry()
: mainWindowID( -1 )
, x( 0 )
, y( 0 )
, width( -1 )
, height( -1 )
, isMaximized( false )
{
}
bool isValid() const { return ( mainWindowID >= 0 && width >= 0 && height >= 0 ); }
int mainWindowID;
int x;
int y;
int width;
int height;
bool isMaximized;
};
class RimViewWindow : public caf::PdmObject, public caf::FontHolderInterface
{
CAF_PDM_HEADER_INIT;
@@ -69,18 +45,16 @@ public:
bool showWindow() const;
void setShowWindow( bool showWindow );
bool isMainDockedWindow() const;
void loadDataAndUpdate();
void handleMdiWindowClosed();
void updateMdiWindowVisibility();
void updateDockWindowVisibility();
void setAs3DViewMdiWindow();
void setAsPlotMdiWindow();
void revokeMdiWindowStatus();
void removeWindowFromDock();
bool isMdiWindow() const;
void setMdiWindowGeometry( const RimMdiWindowGeometry& windowGeometry );
RimMdiWindowGeometry mdiWindowGeometry();
void dockAs3DViewWindow();
void dockAsPlotWindow();
virtual QWidget* viewWidget() = 0;
@@ -92,11 +66,9 @@ public:
void viewNavigationChanged();
virtual void updateMdiWindowTitle();
virtual void updateWindowTitle();
protected:
void removeMdiWindowFromMdiArea();
///////// Interface for the Window controller
friend class RimDockWindowController;
@@ -107,6 +79,7 @@ protected:
virtual void onLoadDataAndUpdate() = 0;
virtual void onViewNavigationChanged();
virtual bool isWindowVisible() const; // Virtual To allow special visibility control
void deleteDockViewer();
//////////
// Derived classes are not supposed to override this function. The intention is to always use m_showWindow
@@ -121,15 +94,11 @@ protected:
private:
friend class RimProject;
void setAsMdiWindow( int mainWindowID );
void dockInWindow( int mainWindowID );
virtual void assignIdIfNecessary() = 0;
protected:
caf::PdmField<bool> m_showWindow;
caf::PdmChildField<RimDockWindowController*> m_windowController;
ads::CDockWidget* m_dockWidget;
private:
// Obsoleted field
caf::PdmField<std::vector<int>> obsoleteField_windowGeometry;
caf::PdmField<bool> m_showWindow;
RimDockWindowController* m_windowController;
ads::CDockWidget* m_dockWidget;
};
@@ -411,7 +411,7 @@ void RimSeismicView::onLoadDataAndUpdate()
synchronizeLocalAnnotationsFromGlobal();
onUpdateScaleTransform();
updateMdiWindowVisibility();
updateDockWindowVisibility();
if ( m_surfaceCollection ) m_surfaceCollection->loadData( m_currentTimeStep );
@@ -116,7 +116,7 @@ void RimSummaryCrossPlotCollection::removePlot( RimSummaryPlot* plot )
RimSummaryPlot* RimSummaryCrossPlotCollection::createSummaryPlot()
{
RimSummaryPlot* plot = new RimSummaryCrossPlot();
plot->setAsPlotMdiWindow();
plot->dockAsPlotWindow();
plot->setDescription( QString( "Summary Cross Plot %1" ).arg( m_summaryCrossPlots.size() ) );
@@ -192,7 +192,7 @@ RimSummaryPlot::~RimSummaryPlot()
{
m_isValid = false;
removeMdiWindowFromMdiArea();
removeWindowFromDock();
deletePlotCurvesAndPlotWidget();
@@ -503,7 +503,7 @@ void RimSummaryPlot::updatePlotTitle()
}
updateCurveNames();
updateMdiWindowTitle();
updateWindowTitle();
if ( plotWidget() )
{
@@ -1784,7 +1784,7 @@ void RimSummaryPlot::onLoadDataAndUpdate()
updatePlotTitle();
auto plotWindow = firstAncestorOrThisOfType<RimMultiPlot>();
if ( plotWindow == nullptr ) updateMdiWindowVisibility();
if ( plotWindow == nullptr ) updateDockWindowVisibility();
if ( m_summaryCurveCollection )
{
@@ -2516,7 +2516,7 @@ void RimSummaryPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
}
caf::PdmUiGroup* mainOptions = uiOrdering.addNewGroup( "General Plot Options" );
if ( isMdiWindow() )
if ( isMainDockedWindow() )
{
mainOptions->add( &m_showPlotTitle );
if ( m_showPlotTitle )
@@ -2534,7 +2534,7 @@ void RimSummaryPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
mainOptions->add( &m_normalizeCurveYValues );
if ( isMdiWindow() )
if ( isMainDockedWindow() )
{
RimPlotWindow::uiOrderingForLegendsAndFonts( uiConfigName, uiOrdering );
}
@@ -56,7 +56,7 @@ RimSummaryPlotCollection::~RimSummaryPlotCollection()
RimSummaryPlot* RimSummaryPlotCollection::createSummaryPlotWithAutoTitle()
{
RimSummaryPlot* plot = new RimSummaryPlot();
plot->setAsPlotMdiWindow();
plot->dockAsPlotWindow();
plot->enableAutoPlotTitle( true );
@@ -71,7 +71,7 @@ RimSummaryPlot* RimSummaryPlotCollection::createSummaryPlotWithAutoTitle()
RimSummaryPlot* RimSummaryPlotCollection::createNamedSummaryPlot( const QString& name )
{
RimSummaryPlot* plot = new RimSummaryPlot();
plot->setAsPlotMdiWindow();
plot->dockAsPlotWindow();
addPlot( plot );
@@ -121,7 +121,7 @@ RimSummaryTable::RimSummaryTable()
CAF_PDM_InitField( &m_endDate, "EndDate", QDateTime::currentDateTime(), "End Date" );
setLegendsVisible( true );
setAsPlotMdiWindow();
dockAsPlotWindow();
setShowWindow( true );
setDeletable( true );
}
@@ -131,7 +131,7 @@ RimSummaryTable::RimSummaryTable()
//--------------------------------------------------------------------------------------------------
RimSummaryTable::~RimSummaryTable()
{
if ( isMdiWindow() ) removeMdiWindowFromMdiArea();
if ( isMainDockedWindow() ) removeWindowFromDock();
cleanupBeforeClose();
}
@@ -432,7 +432,7 @@ QList<caf::PdmOptionItemInfo> RimSummaryTable::calculateValueOptions( const caf:
//--------------------------------------------------------------------------------------------------
void RimSummaryTable::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
createTableData();
setExcludedRowsUiSelectionsFromTableData();
@@ -104,7 +104,7 @@ RimSummaryTable* RimSummaryTableCollection::createDefaultSummaryTable()
{
RimSummaryTable* table = new RimSummaryTable();
table->setDefaultCaseAndCategoryAndVectorName();
table->setAsPlotMdiWindow();
table->dockAsPlotWindow();
return table;
}
@@ -118,7 +118,7 @@ RimSummaryTable* RimSummaryTableCollection::createSummaryTableFromCategoryAndVec
{
RimSummaryTable* table = new RimSummaryTable();
table->setFromCaseAndCategoryAndVectorName( summaryCase, category, vectorName );
table->setAsPlotMdiWindow();
table->dockAsPlotWindow();
return table;
}
@@ -163,7 +163,7 @@ RimCustomVfpPlot::RimCustomVfpPlot()
m_showWindow = true;
m_showPlotLegends = true;
setAsPlotMdiWindow();
dockAsPlotWindow();
setDeletable( true );
}
@@ -173,7 +173,7 @@ RimCustomVfpPlot::RimCustomVfpPlot()
//--------------------------------------------------------------------------------------------------
RimCustomVfpPlot::~RimCustomVfpPlot()
{
removeMdiWindowFromMdiArea();
removeWindowFromDock();
deleteViewWidget();
}
@@ -333,7 +333,7 @@ void RimCustomVfpPlot::updateLegend()
// Hide the legend when in multiplot mode, as the legend is handled by the multi plot grid layout
bool doShowLegend = false;
if ( isMdiWindow() )
if ( isMainDockedWindow() )
{
doShowLegend = m_showPlotLegends;
}
@@ -612,9 +612,9 @@ void generateCombinations( const std::vector<std::vector<double>>& vectors,
//--------------------------------------------------------------------------------------------------
void RimCustomVfpPlot::onLoadDataAndUpdate()
{
if ( isMdiWindow() )
if ( isMainDockedWindow() )
{
updateMdiWindowVisibility();
updateDockWindowVisibility();
}
else
{
@@ -1394,7 +1394,7 @@ void RimCustomVfpPlot::updatePlotTitle( const QString& plotTitle )
{
m_plotTitle = plotTitle;
updateMdiWindowTitle();
updateWindowTitle();
if ( m_plotWidget )
{
@@ -121,7 +121,7 @@ void RimVfpPlotCollection::onChildrenUpdated( caf::PdmChildArrayFieldHandle* chi
{
for ( auto plot : plots() )
{
plot->updateMdiWindowVisibility();
plot->updateDockWindowVisibility();
}
}