2018-09-21 06:44:27 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2016- Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2018-09-21 06:44:27 -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
|
|
|
//
|
2018-09-21 06:44:27 -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>
|
2018-09-21 06:44:27 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-09-21 09:16:46 -05:00
|
|
|
#include "cafCmdFeature.h"
|
|
|
|
|
2018-09-21 06:44:27 -05:00
|
|
|
#include <QFile>
|
|
|
|
|
2020-10-06 05:37:16 -05:00
|
|
|
#include <gsl/gsl>
|
|
|
|
|
2018-09-21 09:16:46 -05:00
|
|
|
#include <memory>
|
2018-09-21 06:44:27 -05:00
|
|
|
|
2018-10-03 02:38:54 -05:00
|
|
|
class RigWellPath;
|
2020-09-04 06:46:53 -05:00
|
|
|
class RigWellPathGeom;
|
2018-09-21 06:44:27 -05:00
|
|
|
class RimWellPath;
|
|
|
|
class RicExportWellPathsUi;
|
2018-10-03 02:38:54 -05:00
|
|
|
class QTextStream;
|
2018-09-21 06:44:27 -05:00
|
|
|
|
|
|
|
//==================================================================================================
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-09-21 06:44:27 -05:00
|
|
|
//==================================================================================================
|
2019-09-06 03:40:57 -05:00
|
|
|
typedef std::shared_ptr<QFile> QFilePtr;
|
2018-10-03 02:38:54 -05:00
|
|
|
typedef std::shared_ptr<QTextStream> QTextStreamPtr;
|
2018-09-21 06:44:27 -05:00
|
|
|
|
|
|
|
//==================================================================================================
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-09-21 06:44:27 -05:00
|
|
|
//==================================================================================================
|
|
|
|
class RicExportSelectedWellPathsFeature : public caf::CmdFeature
|
|
|
|
{
|
|
|
|
CAF_CMD_HEADER_INIT;
|
|
|
|
|
2021-02-16 08:46:26 -06:00
|
|
|
static void exportWellPathsToFile( const std::vector<RimWellPath*>& wellPaths );
|
2020-10-06 05:37:16 -05:00
|
|
|
static void exportWellPath( gsl::not_null<const RimWellPath*> wellPath,
|
|
|
|
double mdStepSize,
|
|
|
|
const QString& folder,
|
|
|
|
bool writeProjectInfo = true );
|
2018-10-03 02:38:54 -05:00
|
|
|
|
|
|
|
static RicExportWellPathsUi* openDialog();
|
2019-09-06 03:40:57 -05:00
|
|
|
static QFilePtr openFileForExport( const QString& folderName, const QString& fileName );
|
|
|
|
static QTextStreamPtr createOutputFileStream( QFile& file );
|
|
|
|
|
2020-10-06 05:37:16 -05:00
|
|
|
static void writeWellPathGeometryToStream( QTextStream& stream,
|
|
|
|
gsl::not_null<const RimWellPath*> wellPath,
|
|
|
|
const QString& exportName,
|
|
|
|
double mdStepSize,
|
|
|
|
bool writeProjectInfo = true );
|
2018-09-21 06:44:27 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static void writeWellPathGeometryToStream( QTextStream& stream,
|
2020-10-06 05:37:16 -05:00
|
|
|
const RigWellPath& wellPath,
|
2019-09-06 03:40:57 -05:00
|
|
|
const QString& exportName,
|
|
|
|
double mdStepSize,
|
|
|
|
bool useMdRkb,
|
|
|
|
double rkbOffset,
|
|
|
|
bool writeProjectInfo );
|
2018-12-05 05:47:07 -06:00
|
|
|
|
2018-09-21 06:44:27 -05:00
|
|
|
private:
|
2020-09-04 06:46:53 -05:00
|
|
|
static void writeWellPathGeometryToStream( QTextStream& stream,
|
|
|
|
const QString& exportName,
|
|
|
|
const std::vector<double>& xValues,
|
|
|
|
const std::vector<double>& yValues,
|
|
|
|
const std::vector<double>& tvdValues,
|
|
|
|
const std::vector<double>& mdValues,
|
|
|
|
bool useMdRkb,
|
|
|
|
bool writeProjectInfo );
|
|
|
|
|
2018-09-21 09:16:46 -05:00
|
|
|
bool isCommandEnabled() override;
|
|
|
|
void onActionTriggered( bool isChecked ) override;
|
2019-09-06 03:40:57 -05:00
|
|
|
void setupActionLook( QAction* actionToSetup ) override;
|
2018-09-21 06:44:27 -05:00
|
|
|
};
|