mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add support for dropping folders in summary plots and multi summary plots
This commit is contained in:
parent
53af120f39
commit
ff57252812
@ -357,7 +357,7 @@ bool RimSummaryAddressCollection::canBeDragged() const
|
|||||||
ok = ok && ( m_contentType == CollectionContentType::WELL || m_contentType == CollectionContentType::GROUP ||
|
ok = ok && ( m_contentType == CollectionContentType::WELL || m_contentType == CollectionContentType::GROUP ||
|
||||||
m_contentType == CollectionContentType::REGION );
|
m_contentType == CollectionContentType::REGION );
|
||||||
|
|
||||||
return ok;
|
return ok || isFolder();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -217,7 +217,20 @@ void RimSummaryMultiPlot::handleDroppedObjects( const std::vector<caf::PdmObject
|
|||||||
if ( address ) addresses.push_back( address );
|
if ( address ) addresses.push_back( address );
|
||||||
|
|
||||||
auto adrColl = dynamic_cast<RimSummaryAddressCollection*>( o );
|
auto adrColl = dynamic_cast<RimSummaryAddressCollection*>( o );
|
||||||
if ( adrColl ) addressCollections.push_back( adrColl );
|
if ( adrColl )
|
||||||
|
{
|
||||||
|
if ( objects.size() == 1 )
|
||||||
|
{
|
||||||
|
if ( adrColl->isFolder() )
|
||||||
|
{
|
||||||
|
// If a folder is selected, return all sub items in folder
|
||||||
|
auto childObjects = adrColl->subFolders();
|
||||||
|
addressCollections.insert( addressCollections.end(), childObjects.begin(), childObjects.end() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
addressCollections.push_back( adrColl );
|
||||||
|
}
|
||||||
|
|
||||||
auto summaryCase = dynamic_cast<RimSummaryCase*>( o );
|
auto summaryCase = dynamic_cast<RimSummaryCase*>( o );
|
||||||
if ( summaryCase ) cases.push_back( summaryCase );
|
if ( summaryCase ) cases.push_back( summaryCase );
|
||||||
|
@ -2124,10 +2124,23 @@ void RimSummaryPlot::handleDroppedObjects( const std::vector<caf::PdmObjectHandl
|
|||||||
auto addressCollection = dynamic_cast<RimSummaryAddressCollection*>( obj );
|
auto addressCollection = dynamic_cast<RimSummaryAddressCollection*>( obj );
|
||||||
if ( addressCollection )
|
if ( addressCollection )
|
||||||
{
|
{
|
||||||
auto [curveCount, curvesCreated] = handleAddressCollectionDrop( addressCollection );
|
if ( addressCollection->isFolder() )
|
||||||
accumulatedCurveCount += curveCount;
|
{
|
||||||
curvesToUpdate.insert( curvesToUpdate.end(), curvesCreated.begin(), curvesCreated.end() );
|
for ( auto coll : addressCollection->subFolders() )
|
||||||
continue;
|
{
|
||||||
|
auto [curveCount, curvesCreated] = handleAddressCollectionDrop( coll );
|
||||||
|
accumulatedCurveCount += curveCount;
|
||||||
|
curvesToUpdate.insert( curvesToUpdate.end(), curvesCreated.begin(), curvesCreated.end() );
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto [curveCount, curvesCreated] = handleAddressCollectionDrop( addressCollection );
|
||||||
|
accumulatedCurveCount += curveCount;
|
||||||
|
curvesToUpdate.insert( curvesToUpdate.end(), curvesCreated.begin(), curvesCreated.end() );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user