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

This commit is contained in:
Pål Hagen
2015-10-19 12:07:17 +02:00
parent 3a01fe0782
commit 1c3e9d8751
6 changed files with 138 additions and 10 deletions

View File

@@ -14,6 +14,7 @@ ${CEE_CURRENT_LIST_DIR}RicNewWellLogPlotTrackFeature.h
${CEE_CURRENT_LIST_DIR}RicWellLogPlotCurveFeatureImpl.h
${CEE_CURRENT_LIST_DIR}RicWellLogsImportFileFeature.h
${CEE_CURRENT_LIST_DIR}RicDeleteWellLogPlotTrackFeature.h
${CEE_CURRENT_LIST_DIR}RicWellLogPlotTrackFeatureImpl.h
)
set (SOURCE_GROUP_SOURCE_FILES
@@ -26,6 +27,7 @@ ${CEE_CURRENT_LIST_DIR}RicNewWellLogPlotTrackFeature.cpp
${CEE_CURRENT_LIST_DIR}RicWellLogPlotCurveFeatureImpl.cpp
${CEE_CURRENT_LIST_DIR}RicWellLogsImportFileFeature.cpp
${CEE_CURRENT_LIST_DIR}RicDeleteWellLogPlotTrackFeature.cpp
${CEE_CURRENT_LIST_DIR}RicWellLogPlotTrackFeatureImpl.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicWellLogPlotTrackFeatureImpl.h"
#include "RimWellLogPlotTrack.h"
#include "RimWellLogPlotCurve.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack(RimWellLogPlotTrack* wellLogPlotTrack, const std::vector<RimWellLogPlotCurve*>& curves)
{
CVF_ASSERT(wellLogPlotTrack);
for (size_t cIdx = 0; cIdx < curves.size(); cIdx++)
{
RimWellLogPlotTrack* oldPlotTrack;
curves[cIdx]->firstAnchestorOrThisOfType(oldPlotTrack);
if (oldPlotTrack)
{
oldPlotTrack->removeCurve(curves[cIdx]);
oldPlotTrack->updateConnectedEditors();
}
wellLogPlotTrack->addCurve(curves[cIdx]);
wellLogPlotTrack->updateAxisRangesAndReplot();
wellLogPlotTrack->updateConnectedEditors();
}
}

View File

@@ -0,0 +1,35 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <vector>
class RimWellLogPlotTrack;
class RimWellLogPlotCurve;
//==================================================================================================
///
//==================================================================================================
class RicWellLogPlotTrackFeatureImpl
{
public:
static void moveCurvesToWellLogPlotTrack(RimWellLogPlotTrack* wellLogPlotTrack, const std::vector<RimWellLogPlotCurve*>& curves);
};