(#467) Implemented drag & drop for moving tracks between plots

This commit is contained in:
Pål Hagen
2015-10-19 13:57:01 +02:00
parent ab0e3819a1
commit 2893b29bbc
6 changed files with 90 additions and 11 deletions

View File

@@ -19,9 +19,14 @@
#include "RicWellLogPlotTrackFeatureImpl.h"
#include "RimWellLogPlot.h"
#include "RimWellLogPlotTrack.h"
#include "RimWellLogPlotCurve.h"
#include "RiuMainWindow.h"
#include "cafPdmUiTreeView.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -44,3 +49,27 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack(RimWellLogPlot
wellLogPlotTrack->updateConnectedEditors();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellLogPlotTrackFeatureImpl::moveTracksToWellLogPlot(RimWellLogPlot* wellLogPlot, const std::vector<RimWellLogPlotTrack*>& tracks)
{
CVF_ASSERT(wellLogPlot);
for (size_t tIdx = 0; tIdx < tracks.size(); tIdx++)
{
RimWellLogPlot* oldPlot;
tracks[tIdx]->firstAnchestorOrThisOfType(oldPlot);
if (oldPlot)
{
oldPlot->removeTrack(tracks[tIdx]);
oldPlot->updateConnectedEditors();
}
wellLogPlot->addTrack(tracks[tIdx]);
wellLogPlot->updateTracks();
wellLogPlot->updateConnectedEditors();
RiuMainWindow::instance()->projectTreeView()->selectAsCurrentItem(tracks[tIdx]);
}
}