mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#467) Moving curves onto a track inserts them in front of existing curves
Dragging and dropping curves onto a curve appends curves after the given curve.
This commit is contained in:
@@ -241,6 +241,13 @@ bool RiuDragDrop::dropMimeData(const QMimeData *data, Qt::DropAction action, int
|
||||
return handleGridCaseGroupDrop(action, objectGroup, gridCaseGroup);
|
||||
}
|
||||
|
||||
RimWellLogPlotCurve* wellLogPlotCurve;
|
||||
objHandle->firstAnchestorOrThisOfType(wellLogPlotCurve);
|
||||
if (wellLogPlotCurve)
|
||||
{
|
||||
return handleWellLogPlotCurveDrop(action, objectGroup, wellLogPlotCurve);
|
||||
}
|
||||
|
||||
RimWellLogPlotTrack* wellLogPlotTrack;
|
||||
objHandle->firstAnchestorOrThisOfType(wellLogPlotTrack);
|
||||
if (wellLogPlotTrack)
|
||||
@@ -361,6 +368,27 @@ bool RiuDragDrop::handleWellLogPlotTrackDrop(Qt::DropAction action, caf::PdmObje
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiuDragDrop::handleWellLogPlotCurveDrop(Qt::DropAction action, caf::PdmObjectGroup& objectGroup, RimWellLogPlotCurve* wellLogPlotCurve)
|
||||
{
|
||||
std::vector<RimWellLogPlotCurve*> wellLogPlotCurves = RiuTypedPdmObjects<RimWellLogPlotCurve>::typedObjectsFromGroup(objectGroup);
|
||||
if (wellLogPlotCurves.size() > 0)
|
||||
{
|
||||
if (action == Qt::MoveAction)
|
||||
{
|
||||
RimWellLogPlotTrack* wellLogPlotTrack;
|
||||
wellLogPlotCurve->firstAnchestorOrThisOfType(wellLogPlotTrack);
|
||||
|
||||
RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack(wellLogPlotTrack, wellLogPlotCurves, wellLogPlotCurve);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -31,8 +31,9 @@ namespace caf
|
||||
}
|
||||
|
||||
class RimIdenticalGridCaseGroup;
|
||||
class RimWellLogPlotTrack;
|
||||
class RimWellLogPlot;
|
||||
class RimWellLogPlotTrack;
|
||||
class RimWellLogPlotCurve;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -56,6 +57,7 @@ private:
|
||||
bool handleGridCaseGroupDrop(Qt::DropAction action, caf::PdmObjectGroup& objectGroup, RimIdenticalGridCaseGroup* gridCaseGroup);
|
||||
bool handleWellLogPlotTrackDrop(Qt::DropAction action, caf::PdmObjectGroup& objectGroup, RimWellLogPlotTrack* wellLogPlotTrack);
|
||||
bool handleWellLogPlotDrop(Qt::DropAction action, caf::PdmObjectGroup& objectGroup, RimWellLogPlot* wellLogPlot);
|
||||
bool handleWellLogPlotCurveDrop(Qt::DropAction action, caf::PdmObjectGroup& objectGroup, RimWellLogPlotCurve* wellLogPlotCurve);
|
||||
|
||||
static void objectGroupFromModelIndexes(caf::PdmObjectGroup* objectGroup, const QModelIndexList &indexes);
|
||||
static std::vector<caf::PdmPointer<caf::PdmObjectHandle> > objectHandlesFromSelection();
|
||||
|
||||
Reference in New Issue
Block a user