2012-05-18 09:45:23 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2014-09-23 15:04:57 +02:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2012-05-18 09:45:23 +02: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
|
|
|
|
|
|
|
|
|
|
#include "cafPdmObject.h"
|
|
|
|
|
#include "cafPdmPointer.h"
|
2013-03-20 06:11:45 +01:00
|
|
|
#include "cafPdmDocument.h"
|
2012-05-18 09:45:23 +02:00
|
|
|
#include "cafUiTreeModelPdm.h"
|
|
|
|
|
|
|
|
|
|
class QFileSystemWatcher;
|
|
|
|
|
|
|
|
|
|
class RimCellPropertyFilter;
|
2012-06-26 16:10:41 +02:00
|
|
|
class RimCellRangeFilter;
|
2015-06-19 14:09:45 +02:00
|
|
|
class RimGeoMechPropertyFilter;
|
2015-05-15 08:40:27 +02:00
|
|
|
class RimEclipseCase;
|
2015-05-21 10:05:33 +02:00
|
|
|
class RimEclipseView;
|
2012-06-26 16:10:41 +02:00
|
|
|
class RimInputProperty;
|
2013-03-22 10:03:51 +01:00
|
|
|
class RimStatisticsCase;
|
2013-03-14 09:50:40 +01:00
|
|
|
class RimIdenticalGridCaseGroup;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2015-05-20 12:33:06 +02:00
|
|
|
class RimView;
|
|
|
|
|
|
2013-03-18 11:40:39 +01:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
//==================================================================================================
|
|
|
|
|
///
|
|
|
|
|
///
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
class RimUiTreeModelPdm : public caf::UiTreeModelPdm
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
RimUiTreeModelPdm(QObject* parent);
|
|
|
|
|
|
|
|
|
|
// Special edit methods
|
2013-03-21 14:03:37 +01:00
|
|
|
bool deleteRangeFilter(const QModelIndex& itemIndex);
|
|
|
|
|
bool deletePropertyFilter(const QModelIndex& itemIndex);
|
2015-05-20 12:33:06 +02:00
|
|
|
|
2013-03-21 14:03:37 +01:00
|
|
|
void deleteInputProperty(const QModelIndex& itemIndex);
|
2015-05-15 08:40:27 +02:00
|
|
|
void deleteReservoir(RimEclipseCase* reservoir);
|
2013-09-08 12:11:22 +02:00
|
|
|
void deleteAllWellPaths(const QModelIndex& itemIndex);
|
2013-03-21 14:03:37 +01:00
|
|
|
|
|
|
|
|
RimCellPropertyFilter* addPropertyFilter(const QModelIndex& itemIndex, QModelIndex& insertedModelIndex);
|
2015-06-19 14:09:45 +02:00
|
|
|
RimGeoMechPropertyFilter* addGeoMechPropertyFilter(const QModelIndex& itemIndex, QModelIndex& insertedModelIndex);
|
2013-03-21 14:03:37 +01:00
|
|
|
RimCellRangeFilter* addRangeFilter(const QModelIndex& itemIndex, QModelIndex& insertedModelIndex);
|
2015-05-20 12:33:06 +02:00
|
|
|
|
|
|
|
|
RimView* addReservoirView(const std::vector<caf::PdmUiItem*>& treeSelection);
|
|
|
|
|
void deleteReservoirViews(const std::vector<caf::PdmUiItem*>& treeSelection);
|
2015-05-20 13:45:46 +02:00
|
|
|
void deleteGeoMechCases(const std::vector<caf::PdmUiItem*>& treeSelection);
|
2015-05-20 12:33:06 +02:00
|
|
|
|
2013-03-21 14:03:37 +01:00
|
|
|
void addInputProperty(const QModelIndex& itemIndex, const QStringList& fileNames);
|
2013-04-05 13:22:36 +02:00
|
|
|
|
2013-04-22 11:54:41 +02:00
|
|
|
void addToParentAndBuildUiItems(caf::PdmUiTreeItem* parentTreeItem, int position, caf::PdmObject* pdmObject);
|
|
|
|
|
|
2013-09-12 08:11:56 +02:00
|
|
|
void populateObjectGroupFromModelIndexList(const QModelIndexList& modelIndexList, caf::PdmObjectGroup* objectGroup);
|
2014-08-28 13:37:56 +02:00
|
|
|
void addObjects(const QModelIndex& itemIndex, const caf::PdmObjectGroup& pdmObjects);
|
2013-04-05 13:22:36 +02:00
|
|
|
void moveObjects(const QModelIndex& itemIndex, caf::PdmObjectGroup& pdmObjects);
|
2013-02-15 08:44:45 +01:00
|
|
|
|
2013-04-05 13:22:36 +02:00
|
|
|
RimStatisticsCase* addStatisticalCalculation(const QModelIndex& itemIndex, QModelIndex& insertedModelIndex);
|
2013-04-11 11:03:52 +02:00
|
|
|
RimIdenticalGridCaseGroup* addCaseGroup(QModelIndex& insertedModelIndex);
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2013-03-21 14:03:37 +01:00
|
|
|
bool deleteObjectFromPdmPointersField(const QModelIndex& itemIndex);
|
2013-03-20 12:08:40 +01:00
|
|
|
|
2013-03-21 14:03:37 +01:00
|
|
|
void updateScriptPaths();
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2013-03-21 14:03:37 +01:00
|
|
|
virtual Qt::DropActions supportedDropActions() const;
|
|
|
|
|
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
|
|
|
|
|
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
|
|
|
|
|
virtual QMimeData* mimeData(const QModelIndexList &indexes) const;
|
|
|
|
|
virtual QStringList mimeTypes() const;
|
2013-03-21 13:41:44 +01:00
|
|
|
|
2013-04-05 13:22:36 +02:00
|
|
|
RimIdenticalGridCaseGroup* gridCaseGroupFromItemIndex(const QModelIndex& itemIndex);
|
2013-04-25 08:47:01 +02:00
|
|
|
void setObjectToggleStateForSelection(QModelIndexList selectedIndexes, int state);
|
2013-04-05 13:22:36 +02:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
private slots:
|
2013-03-21 14:03:37 +01:00
|
|
|
void slotRefreshScriptTree(QString path);
|
2012-05-18 09:45:23 +02:00
|
|
|
|
|
|
|
|
private:
|
2013-03-21 14:03:37 +01:00
|
|
|
void clearClipboard();
|
2015-05-15 08:40:27 +02:00
|
|
|
RimEclipseCase* caseFromItemIndex(const QModelIndex& itemIndex);
|
2013-03-21 14:03:37 +01:00
|
|
|
private:
|
|
|
|
|
QFileSystemWatcher* m_scriptChangeDetector;
|
|
|
|
|
};
|
2012-05-18 09:45:23 +02:00
|
|
|
|