mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Re-add missing drag and drop for well log tracks
This commit is contained in:
@@ -24,10 +24,6 @@
|
||||
#include "RiuQwtPlotWidget.h"
|
||||
#include "RiuWellLogPlot.h"
|
||||
|
||||
#include "RimGridCrossPlot.h"
|
||||
#include "RimGridCrossPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
#include "RimWellLogCurve.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
@@ -87,3 +83,33 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack( RimWellLogTra
|
||||
destTrack->updateParentPlotZoom();
|
||||
destTrack->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicWellLogPlotTrackFeatureImpl::moveTracksToWellLogPlot( RimWellLogPlot* wellLogPlot,
|
||||
const std::vector<RimWellLogTrack*>& tracksToMove,
|
||||
RimWellLogTrack* insertAfterTrack )
|
||||
{
|
||||
CVF_ASSERT( wellLogPlot );
|
||||
|
||||
for ( size_t tIdx = 0; tIdx < tracksToMove.size(); tIdx++ )
|
||||
{
|
||||
RimWellLogTrack* plot = tracksToMove[tIdx];
|
||||
caf::PdmObject* pdmObject = dynamic_cast<caf::PdmObject*>( plot );
|
||||
RimWellLogPlot* srcPlot;
|
||||
pdmObject->firstAncestorOrThisOfType( srcPlot );
|
||||
if ( srcPlot )
|
||||
{
|
||||
srcPlot->removePlot( plot );
|
||||
}
|
||||
}
|
||||
|
||||
size_t insertionStartIndex = 0;
|
||||
if ( insertAfterTrack ) insertionStartIndex = wellLogPlot->plotIndex( insertAfterTrack ) + 1;
|
||||
|
||||
for ( size_t tIdx = 0; tIdx < tracksToMove.size(); tIdx++ )
|
||||
{
|
||||
wellLogPlot->insertPlot( tracksToMove[tIdx], insertionStartIndex + tIdx );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RimWellLogPlot;
|
||||
class RimWellLogTrack;
|
||||
class RimWellLogCurve;
|
||||
|
||||
@@ -33,4 +34,7 @@ public:
|
||||
static void moveCurvesToWellLogPlotTrack( RimWellLogTrack* dstTrack,
|
||||
const std::vector<RimWellLogCurve*>& curves,
|
||||
RimWellLogCurve* insertAfterCurve );
|
||||
static void moveTracksToWellLogPlot( RimWellLogPlot* wellLogPlot,
|
||||
const std::vector<RimWellLogTrack*>& tracks,
|
||||
RimWellLogTrack* trackToInsertAfter );
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user