mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#467) Implemented drag & drop for moving tracks between plots
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user