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