2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2012-05-18 02:45:23 -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
|
|
|
|
|
|
|
|
#include "cafPdmObject.h"
|
|
|
|
#include "cafPdmPointer.h"
|
2013-03-20 00:11:45 -05:00
|
|
|
#include "cafPdmDocument.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "cafUiTreeModelPdm.h"
|
|
|
|
|
|
|
|
class QFileSystemWatcher;
|
|
|
|
|
|
|
|
class RimCellPropertyFilter;
|
2012-06-26 09:10:41 -05:00
|
|
|
class RimCellRangeFilter;
|
2015-05-15 01:40:27 -05:00
|
|
|
class RimEclipseCase;
|
2012-06-26 09:10:41 -05:00
|
|
|
class RimReservoirView;
|
|
|
|
class RimInputProperty;
|
2013-03-22 04:03:51 -05:00
|
|
|
class RimStatisticsCase;
|
2013-03-14 03:50:40 -05:00
|
|
|
class RimIdenticalGridCaseGroup;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-03-18 05:40:39 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
class RimUiTreeModelPdm : public caf::UiTreeModelPdm
|
|
|
|
{
|
|
|
|
Q_OBJECT;
|
|
|
|
|
|
|
|
public:
|
|
|
|
RimUiTreeModelPdm(QObject* parent);
|
|
|
|
|
2013-03-21 07:41:44 -05:00
|
|
|
|
|
|
|
// TO BE DELETED, NOT USED
|
2013-03-21 08:03:37 -05:00
|
|
|
virtual bool insertRows_special(int position, int rows, const QModelIndex &parent = QModelIndex());
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
// Special edit methods
|
2013-03-21 08:03:37 -05:00
|
|
|
bool deleteRangeFilter(const QModelIndex& itemIndex);
|
|
|
|
bool deletePropertyFilter(const QModelIndex& itemIndex);
|
|
|
|
bool deleteReservoirView(const QModelIndex& itemIndex);
|
|
|
|
void deleteInputProperty(const QModelIndex& itemIndex);
|
2015-05-15 01:40:27 -05:00
|
|
|
void deleteReservoir(RimEclipseCase* reservoir);
|
2013-09-08 05:11:22 -05:00
|
|
|
void deleteAllWellPaths(const QModelIndex& itemIndex);
|
2013-03-21 08:03:37 -05:00
|
|
|
|
|
|
|
RimCellPropertyFilter* addPropertyFilter(const QModelIndex& itemIndex, QModelIndex& insertedModelIndex);
|
|
|
|
RimCellRangeFilter* addRangeFilter(const QModelIndex& itemIndex, QModelIndex& insertedModelIndex);
|
|
|
|
RimReservoirView* addReservoirView(const QModelIndex& itemIndex, QModelIndex& insertedModelIndex);
|
|
|
|
void addInputProperty(const QModelIndex& itemIndex, const QStringList& fileNames);
|
2013-04-05 06:22:36 -05:00
|
|
|
|
2013-04-22 04:54:41 -05:00
|
|
|
void addToParentAndBuildUiItems(caf::PdmUiTreeItem* parentTreeItem, int position, caf::PdmObject* pdmObject);
|
|
|
|
|
2013-09-12 01:11:56 -05:00
|
|
|
void populateObjectGroupFromModelIndexList(const QModelIndexList& modelIndexList, caf::PdmObjectGroup* objectGroup);
|
2014-08-28 06:37:56 -05:00
|
|
|
void addObjects(const QModelIndex& itemIndex, const caf::PdmObjectGroup& pdmObjects);
|
2013-04-05 06:22:36 -05:00
|
|
|
void moveObjects(const QModelIndex& itemIndex, caf::PdmObjectGroup& pdmObjects);
|
2013-02-15 01:44:45 -06:00
|
|
|
|
2013-04-05 06:22:36 -05:00
|
|
|
RimStatisticsCase* addStatisticalCalculation(const QModelIndex& itemIndex, QModelIndex& insertedModelIndex);
|
2013-04-11 04:03:52 -05:00
|
|
|
RimIdenticalGridCaseGroup* addCaseGroup(QModelIndex& insertedModelIndex);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-03-21 08:03:37 -05:00
|
|
|
bool deleteObjectFromPdmPointersField(const QModelIndex& itemIndex);
|
2013-03-20 06:08:40 -05:00
|
|
|
|
2013-03-21 08:03:37 -05:00
|
|
|
void updateScriptPaths();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-03-21 08:03:37 -05: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 07:41:44 -05:00
|
|
|
|
2013-04-05 06:22:36 -05:00
|
|
|
RimIdenticalGridCaseGroup* gridCaseGroupFromItemIndex(const QModelIndex& itemIndex);
|
2013-04-25 01:47:01 -05:00
|
|
|
void setObjectToggleStateForSelection(QModelIndexList selectedIndexes, int state);
|
2013-04-05 06:22:36 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
private slots:
|
2013-03-21 08:03:37 -05:00
|
|
|
void slotRefreshScriptTree(QString path);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
private:
|
2013-03-21 08:03:37 -05:00
|
|
|
void clearClipboard();
|
2015-05-15 01:40:27 -05:00
|
|
|
RimEclipseCase* caseFromItemIndex(const QModelIndex& itemIndex);
|
2013-03-21 08:03:37 -05:00
|
|
|
private:
|
|
|
|
QFileSystemWatcher* m_scriptChangeDetector;
|
|
|
|
};
|
2012-05-18 02:45:23 -05:00
|
|
|
|