2015-08-18 04:23:53 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2017-09-12 07:08:09 -05:00
|
|
|
// Copyright (C) 2017- Statoil ASA
|
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.
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
|
2015-10-23 04:03:23 -05:00
|
|
|
#include "cafPdmUiDragDropInterface.h"
|
2015-10-21 10:21:56 -05:00
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
#include "cafPdmObjectGroup.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
|
|
|
|
{
|
2015-10-21 10:21:56 -05:00
|
|
|
class PdmObjectHandle;
|
2015-08-20 03:24:03 -05:00
|
|
|
}
|
2015-08-18 04:23:53 -05:00
|
|
|
|
2015-10-21 10:21:56 -05:00
|
|
|
class RimIdenticalGridCaseGroup;
|
2017-09-11 07:39:21 -05:00
|
|
|
class RimSummaryCaseCollection;
|
|
|
|
class RimSummaryCaseMainCollection;
|
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
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
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;
|
2017-09-12 07:08:09 -05:00
|
|
|
|
2015-10-23 04:03:23 -05:00
|
|
|
protected:
|
2018-10-18 12:45:57 -05:00
|
|
|
Qt::DropActions supportedDropActions() const override;
|
|
|
|
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;
|
|
|
|
QStringList mimeTypes() const override;
|
|
|
|
|
|
|
|
void onDragCanceled() override;
|
|
|
|
void onProposedDropActionUpdated(Qt::DropAction action) override;
|
2015-08-20 03:24:03 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
void moveCasesToGridGroup(caf::PdmObjectGroup& objectGroup, RimIdenticalGridCaseGroup* gridCaseGroup);
|
2015-10-16 09:58:49 -05:00
|
|
|
bool handleGridCaseGroupDrop(Qt::DropAction action, caf::PdmObjectGroup& objectGroup, RimIdenticalGridCaseGroup* gridCaseGroup);
|
2015-11-04 08:57:06 -06:00
|
|
|
bool handleWellLogPlotTrackDrop(Qt::DropAction action, caf::PdmObjectGroup& objectGroup, RimWellLogTrack* wellLogPlotTrack);
|
2015-10-19 06:57:01 -05:00
|
|
|
bool handleWellLogPlotDrop(Qt::DropAction action, caf::PdmObjectGroup& objectGroup, RimWellLogPlot* wellLogPlot);
|
2015-11-04 09:19:38 -06:00
|
|
|
bool handleWellLogPlotCurveDrop(Qt::DropAction action, caf::PdmObjectGroup& objectGroup, RimWellLogCurve* wellLogPlotCurve);
|
2017-09-11 07:39:21 -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
|
|
|
|
|
|
|
static void objectGroupFromModelIndexes(caf::PdmObjectGroup* objectGroup, const QModelIndexList &indexes);
|
2015-10-22 07:47:51 -05:00
|
|
|
static std::vector<caf::PdmPointer<caf::PdmObjectHandle> > objectHandlesFromSelection();
|
2015-10-21 10:21:56 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
mutable std::vector<caf::PdmPointer<caf::PdmObjectHandle> > m_dragItems;
|
2015-10-23 04:03:23 -05:00
|
|
|
Qt::DropAction m_proposedDropAction;
|
2015-08-18 04:23:53 -05:00
|
|
|
};
|
|
|
|
|