Summary Multiplot: drag/drop updates (#8692)

Drag'n'drop improvements - accept drops in empty multiplot areas to create new plots
This commit is contained in:
jonjenssen
2022-03-15 15:57:15 +01:00
committed by GitHub
parent 72ff44071d
commit 75a3d3d8f1
12 changed files with 189 additions and 101 deletions

View File

@@ -92,7 +92,10 @@ void RimSummaryMultiPlot::addPlot( RimPlot* plot )
{
RimSummaryPlot* sumPlot = dynamic_cast<RimSummaryPlot*>( plot );
CVF_ASSERT( sumPlot != nullptr );
if ( sumPlot ) RimMultiPlot::addPlot( plot );
if ( sumPlot )
{
RimMultiPlot::addPlot( plot );
}
}
//--------------------------------------------------------------------------------------------------
@@ -102,7 +105,36 @@ void RimSummaryMultiPlot::insertPlot( RimPlot* plot, size_t index )
{
RimSummaryPlot* sumPlot = dynamic_cast<RimSummaryPlot*>( plot );
CVF_ASSERT( sumPlot != nullptr );
if ( sumPlot ) RimMultiPlot::insertPlot( plot, index );
if ( sumPlot )
{
RimMultiPlot::insertPlot( plot, index );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryMultiPlot::addPlot( const std::vector<caf::PdmObjectHandle*>& objects )
{
RimSummaryPlot* plot = new RimSummaryPlot();
plot->enableAutoPlotTitle( true );
addPlot( plot );
plot->handleDroppedObjects( objects );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryMultiPlot::removePlot( RimPlot* plot )
{
RimSummaryPlot* sumPlot = dynamic_cast<RimSummaryPlot*>( plot );
CVF_ASSERT( sumPlot != nullptr );
if ( sumPlot )
{
RimMultiPlot::removePlot( plot );
}
}
//--------------------------------------------------------------------------------------------------