2018-10-05 04:49:44 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
|
2018-10-09 01:01:56 -05:00
|
|
|
#include "RigCompletionDataGridCell.h"
|
2018-10-05 04:49:44 -05:00
|
|
|
#include "cafCmdFeature.h"
|
2018-10-09 01:01:56 -05:00
|
|
|
#include <cafVecIjk.h>
|
|
|
|
#include <memory>
|
2018-10-10 02:04:14 -05:00
|
|
|
#include <limits>
|
2018-10-05 04:49:44 -05:00
|
|
|
|
2018-10-10 02:04:14 -05:00
|
|
|
class RimEclipseCase;
|
2018-10-05 04:49:44 -05:00
|
|
|
class RimSimWellInView;
|
|
|
|
class RimWellPath;
|
2018-10-09 02:47:01 -05:00
|
|
|
class RicExportLgrUi;
|
2018-10-09 01:01:56 -05:00
|
|
|
class QFile;
|
|
|
|
class QTextStream;
|
|
|
|
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
class LgrInfo
|
|
|
|
{
|
|
|
|
public:
|
2018-10-10 02:04:14 -05:00
|
|
|
LgrInfo(const QString&name,
|
|
|
|
const caf::VecIjk& sizes,
|
|
|
|
const caf::VecIjk& mainGridStartCell,
|
|
|
|
const caf::VecIjk& mainGridEndCell)
|
|
|
|
: name(name), sizes(sizes), mainGridStartCell(mainGridStartCell), mainGridEndCell(mainGridEndCell)
|
2018-10-09 01:01:56 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QString name;
|
|
|
|
caf::VecIjk sizes;
|
|
|
|
std::vector<double> values;
|
2018-10-10 02:04:14 -05:00
|
|
|
|
|
|
|
caf::VecIjk mainGridStartCell;
|
|
|
|
caf::VecIjk mainGridEndCell;
|
2018-10-09 01:01:56 -05:00
|
|
|
};
|
2018-10-05 04:49:44 -05:00
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
2018-10-09 02:47:01 -05:00
|
|
|
class RicExportLgrFeature : public caf::CmdFeature
|
2018-10-05 04:49:44 -05:00
|
|
|
{
|
|
|
|
CAF_CMD_HEADER_INIT;
|
|
|
|
|
2018-10-10 02:04:14 -05:00
|
|
|
typedef std::pair<size_t, size_t> Range;
|
|
|
|
static Range initRange() { return std::make_pair(std::numeric_limits<size_t>::max(), 0); }
|
|
|
|
|
2018-10-11 02:31:06 -05:00
|
|
|
static RicExportLgrUi* openDialog(RimEclipseCase* defaultCase = nullptr, int defaultTimeStep = 0);
|
2018-10-09 01:01:56 -05:00
|
|
|
static bool openFileForExport(const QString& folderName, const QString& fileName, QFile* exportFile);
|
2018-10-10 04:56:27 -05:00
|
|
|
static void exportLgrs(QTextStream& stream, const std::vector<LgrInfo>& lgrInfos);
|
2018-10-10 02:04:14 -05:00
|
|
|
|
|
|
|
static std::vector<LgrInfo> buildOneLgrPerMainCell(RimEclipseCase* eclipseCase,
|
|
|
|
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
|
|
|
const caf::VecIjk& lgrSizes);
|
|
|
|
static std::vector<LgrInfo> buildSingleLgr(RimEclipseCase* eclipseCase,
|
|
|
|
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
|
|
|
const caf::VecIjk& lgrSizes);
|
|
|
|
|
|
|
|
static std::vector<RigCompletionDataGridCell> cellsIntersectingCompletions(RimEclipseCase* eclipseCase,
|
|
|
|
const RimWellPath* wellPath,
|
|
|
|
size_t timeStep);
|
2018-10-05 04:49:44 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool isCommandEnabled() override;
|
|
|
|
virtual void onActionTriggered(bool isChecked) override;
|
|
|
|
virtual void setupActionLook(QAction* actionToSetup) override;
|
|
|
|
|
2018-10-09 01:01:56 -05:00
|
|
|
private:
|
2018-10-09 03:10:29 -05:00
|
|
|
static std::vector<RimWellPath*> selectedWellPaths();
|
2018-10-10 02:04:14 -05:00
|
|
|
static bool containsAnyNonMainGridCells(const std::vector<RigCompletionDataGridCell>& cells);
|
2018-10-05 04:49:44 -05:00
|
|
|
};
|