mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Major improvements to D&D of curves.
This commit is contained in:
@@ -36,8 +36,9 @@
|
||||
void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack( RimWellLogTrack* destTrack,
|
||||
const std::vector<RimWellLogCurve*>& curves,
|
||||
RimWellLogCurve* curveToInsertBeforeOrAfter,
|
||||
bool isSwapOperation )
|
||||
int insertAtPosition )
|
||||
{
|
||||
CVF_ASSERT( insertAtPosition >= 0 );
|
||||
CVF_ASSERT( destTrack );
|
||||
|
||||
std::set<RimWellLogTrack*> srcTracks;
|
||||
@@ -47,8 +48,6 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack( RimWellLogTra
|
||||
{
|
||||
RimWellLogCurve* curve = curves[cIdx];
|
||||
|
||||
if ( curve == curveToInsertBeforeOrAfter ) continue;
|
||||
|
||||
RimWellLogTrack* wellLogPlotTrack;
|
||||
curve->firstAncestorOrThisOfType( wellLogPlotTrack );
|
||||
if ( wellLogPlotTrack )
|
||||
@@ -61,24 +60,18 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack( RimWellLogTra
|
||||
}
|
||||
}
|
||||
|
||||
size_t insertionStartIndex = 0;
|
||||
if ( curveToInsertBeforeOrAfter )
|
||||
{
|
||||
insertionStartIndex = destTrack->curveIndex( curveToInsertBeforeOrAfter );
|
||||
if ( !isSwapOperation ) insertionStartIndex += 1;
|
||||
}
|
||||
|
||||
for ( size_t cIdx = 0; cIdx < curves.size(); cIdx++ )
|
||||
{
|
||||
destTrack->insertCurve( curves[cIdx], insertionStartIndex + cIdx );
|
||||
size_t position = (size_t)insertAtPosition + cIdx;
|
||||
destTrack->insertCurve( curves[cIdx], position );
|
||||
}
|
||||
|
||||
for ( auto track : srcTracks )
|
||||
{
|
||||
track->setAutoScaleXEnabled( true );
|
||||
track->updateParentPlotZoom();
|
||||
track->updateConnectedEditors();
|
||||
track->updateStackedCurveData();
|
||||
track->updateConnectedEditors();
|
||||
}
|
||||
|
||||
for ( auto plot : srcPlots )
|
||||
|
||||
Reference in New Issue
Block a user