2015-08-18 04:23:53 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2017-09-12 07:08:09 -05:00
|
|
|
// Copyright (C) 2017- Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2015-08-18 04:23:53 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2015-08-18 04:23:53 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2015-08-18 04:23:53 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2015-10-21 10:21:56 -05:00
|
|
|
#include "cafPdmObjectGroup.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
#include "cafPdmUiDragDropInterface.h"
|
2015-08-18 04:23:53 -05:00
|
|
|
|
2015-10-21 10:21:56 -05:00
|
|
|
#include <vector>
|
2015-08-20 03:24:03 -05:00
|
|
|
|
|
|
|
namespace caf
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
class PdmObjectHandle;
|
2015-08-20 03:24:03 -05:00
|
|
|
}
|
2015-08-18 04:23:53 -05:00
|
|
|
|
2020-01-16 05:32:40 -06:00
|
|
|
class RimMultiPlot;
|
2015-10-21 10:21:56 -05:00
|
|
|
class RimIdenticalGridCaseGroup;
|
2017-09-11 07:39:21 -05:00
|
|
|
class RimSummaryCaseCollection;
|
|
|
|
class RimSummaryCaseMainCollection;
|
2020-07-03 06:39:52 -05:00
|
|
|
class RimSummaryCurve;
|
|
|
|
class RimSummaryPlot;
|
2020-08-24 04:09:22 -05:00
|
|
|
class RimSurfaceCollection;
|
2015-10-21 10:21:56 -05:00
|
|
|
class RimWellLogPlot;
|
2015-11-04 08:57:06 -06:00
|
|
|
class RimWellLogTrack;
|
2015-11-04 09:19:38 -06:00
|
|
|
class RimWellLogCurve;
|
2015-10-21 10:21:56 -05:00
|
|
|
|
2015-08-18 04:23:53 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-08-18 04:23:53 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-10-23 04:03:23 -05:00
|
|
|
class RiuDragDrop : public caf::PdmUiDragDropInterface
|
2015-08-18 04:23:53 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
RiuDragDrop();
|
2018-10-18 12:45:57 -05:00
|
|
|
~RiuDragDrop() override;
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2015-10-23 04:03:23 -05:00
|
|
|
protected:
|
2018-10-18 12:45:57 -05:00
|
|
|
Qt::DropActions supportedDropActions() const override;
|
2019-09-06 03:40:57 -05:00
|
|
|
Qt::ItemFlags flags( const QModelIndex& index ) const override;
|
|
|
|
bool dropMimeData( const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent ) override;
|
|
|
|
QMimeData* mimeData( const QModelIndexList& indexes ) const override;
|
2018-10-18 12:45:57 -05:00
|
|
|
QStringList mimeTypes() const override;
|
|
|
|
|
|
|
|
void onDragCanceled() override;
|
2019-09-06 03:40:57 -05:00
|
|
|
void onProposedDropActionUpdated( Qt::DropAction action ) override;
|
2015-08-20 03:24:03 -05:00
|
|
|
|
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
void moveCasesToGridGroup( caf::PdmObjectGroup& objectGroup, RimIdenticalGridCaseGroup* gridCaseGroup );
|
|
|
|
bool handleGridCaseGroupDrop( Qt::DropAction action,
|
|
|
|
caf::PdmObjectGroup& objectGroup,
|
|
|
|
RimIdenticalGridCaseGroup* gridCaseGroup );
|
2020-07-03 06:39:52 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool handleWellLogPlotTrackDrop( Qt::DropAction action,
|
|
|
|
caf::PdmObjectGroup& objectGroup,
|
2019-10-03 07:41:37 -05:00
|
|
|
RimWellLogTrack* wellLogPlotTrack,
|
2020-08-13 05:00:53 -05:00
|
|
|
int insertAtPosition );
|
2020-07-02 08:59:21 -05:00
|
|
|
|
|
|
|
bool handleWellLogPlotDrop( Qt::DropAction action,
|
|
|
|
caf::PdmObjectGroup& objectGroup,
|
|
|
|
RimWellLogPlot* wellLogPlot,
|
2020-08-13 05:00:53 -05:00
|
|
|
int insertAtPosition );
|
2020-07-03 06:39:52 -05:00
|
|
|
|
2020-08-07 00:31:57 -05:00
|
|
|
bool handleSummaryPlotDrop( Qt::DropAction action,
|
|
|
|
caf::PdmObjectGroup& objectGroup,
|
|
|
|
RimSummaryPlot* summaryPlot,
|
|
|
|
int insertAtPosition );
|
2020-07-03 06:39:52 -05:00
|
|
|
|
2019-11-13 05:22:50 -06:00
|
|
|
bool handleMultiPlotDrop( Qt::DropAction action,
|
|
|
|
caf::PdmObjectGroup& objectGroup,
|
2020-01-16 05:32:40 -06:00
|
|
|
RimMultiPlot* multiPlot,
|
2019-11-13 05:22:50 -06:00
|
|
|
int insertAtPosition );
|
2019-09-06 03:40:57 -05:00
|
|
|
bool handleSummaryCaseCollectionDrop( Qt::DropAction action,
|
|
|
|
caf::PdmObjectGroup& objectGroup,
|
|
|
|
RimSummaryCaseCollection* summaryCaseCollection );
|
|
|
|
bool handleSummaryCaseMainCollectionDrop( Qt::DropAction action,
|
|
|
|
caf::PdmObjectGroup& objectGroup,
|
|
|
|
RimSummaryCaseMainCollection* summaryCaseMainCollection );
|
2015-10-21 10:21:56 -05:00
|
|
|
|
2020-08-24 04:09:22 -05:00
|
|
|
bool handleSurfaceCollectionDrop( Qt::DropAction action,
|
|
|
|
int row,
|
|
|
|
caf::PdmObjectGroup& objectGroup,
|
|
|
|
RimSurfaceCollection* surfaceCollection );
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static void objectGroupFromModelIndexes( caf::PdmObjectGroup* objectGroup, const QModelIndexList& indexes );
|
|
|
|
static std::vector<caf::PdmPointer<caf::PdmObjectHandle>> objectHandlesFromSelection();
|
2015-10-21 10:21:56 -05:00
|
|
|
|
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
mutable std::vector<caf::PdmPointer<caf::PdmObjectHandle>> m_dragItems;
|
|
|
|
Qt::DropAction m_proposedDropAction;
|
2015-08-18 04:23:53 -05:00
|
|
|
};
|