(#467) Implemented tree view drag & drop of LAS file well log channels to plot tracks

Did some refactoring/cleanup of existing drag & drop code to make it
easier to add drag & drop for other item types.
This commit is contained in:
Pål Hagen
2015-10-16 16:58:49 +02:00
parent 8e682926c6
commit 3a01fe0782
4 changed files with 110 additions and 34 deletions

View File

@@ -25,6 +25,7 @@
#include "RimWellLogFileCurve.h"
#include "RimWellLogPlotTrack.h"
#include "RimWellLogFile.h"
#include "RimWellLogFileChannel.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimProject.h"
@@ -157,3 +158,24 @@ RimWellLogFileCurve* RicNewWellLogFileCurveFeature::addCurve(RimWellLogPlotTrack
return curve;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewWellLogFileCurveFeature::addWellLogChannelsToPlotTrack(RimWellLogPlotTrack* plotTrack, const std::vector<RimWellLogFileChannel*>& wellLogFileChannels)
{
for (size_t cIdx = 0; cIdx < wellLogFileChannels.size(); cIdx++)
{
RimWellLogFileCurve* plotCurve = addCurve(plotTrack);
RimWellPath* wellPath;
wellLogFileChannels[cIdx]->firstAnchestorOrThisOfType(wellPath);
if (wellPath)
{
plotCurve->setWellPath(wellPath);
plotCurve->setWellLogChannelName(wellLogFileChannels[cIdx]->name());
plotCurve->updatePlotData();
plotCurve->updateConnectedEditors();
}
}
}

View File

@@ -21,9 +21,13 @@
#include "cafCmdFeature.h"
#include <vector>
class RimWellLogPlotTrack;
class RimWellLogFileCurve;
class RimWellPath;
class RimWellLogFileChannel;
//==================================================================================================
///
@@ -35,6 +39,7 @@ class RicNewWellLogFileCurveFeature : public caf::CmdFeature
public:
static RimWellLogFileCurve* addCurve(RimWellLogPlotTrack* plotTrack);
static void addWellLogChannelsToPlotTrack(RimWellLogPlotTrack* plotTrack, const std::vector<RimWellLogFileChannel*>& wellLogFileChannels);
protected:
// Overrides