2018-08-06 00:52:02 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2019-01-09 08:21:38 -06:00
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2018-08-06 00:52:02 -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
|
|
|
|
|
2018-10-09 06:42:03 -05:00
|
|
|
#include "RimWellPathComponentInterface.h"
|
2018-10-09 04:06:10 -05:00
|
|
|
|
2018-08-06 00:52:02 -05:00
|
|
|
#include "cafAppEnum.h"
|
|
|
|
#include "cafPdmField.h"
|
2020-10-06 05:37:16 -05:00
|
|
|
#include "cafPdmObject.h"
|
2018-08-06 00:52:02 -05:00
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
2020-10-06 05:37:16 -05:00
|
|
|
#include <gsl/gsl>
|
|
|
|
|
2018-10-05 03:26:26 -05:00
|
|
|
class RimWellPath;
|
|
|
|
|
2018-10-09 06:42:03 -05:00
|
|
|
class RimWellPathAttribute : public caf::PdmObject, public RimWellPathComponentInterface
|
2018-08-06 00:52:02 -05:00
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2018-08-06 00:52:02 -05:00
|
|
|
public:
|
2019-09-06 03:40:57 -05:00
|
|
|
static double MAX_DIAMETER_IN_INCHES;
|
|
|
|
static double MIN_DIAMETER_IN_INCHES;
|
2018-10-09 06:42:03 -05:00
|
|
|
typedef caf::AppEnum<RiaDefines::WellPathComponentType> CompletionTypeEnum;
|
2018-08-06 00:52:02 -05:00
|
|
|
|
|
|
|
RimWellPathAttribute();
|
2018-10-18 12:45:57 -05:00
|
|
|
~RimWellPathAttribute() override;
|
2018-08-06 00:52:02 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
double diameterInInches() const;
|
|
|
|
QString diameterLabel() const;
|
|
|
|
bool operator<( const RimWellPathAttribute& rhs ) const;
|
2020-10-06 05:37:16 -05:00
|
|
|
void setDepthsFromWellPath( gsl::not_null<const RimWellPath*> wellPath );
|
2018-08-30 06:54:00 -05:00
|
|
|
|
2018-10-09 04:06:10 -05:00
|
|
|
// Overrides from RimWellPathCompletionInterface
|
2018-11-22 05:57:11 -06:00
|
|
|
bool isEnabled() const override;
|
2018-10-10 01:44:26 -05:00
|
|
|
RiaDefines::WellPathComponentType componentType() const override;
|
|
|
|
QString componentLabel() const override;
|
2019-09-06 03:40:57 -05:00
|
|
|
QString componentTypeLabel() const override;
|
2018-10-10 09:57:43 -05:00
|
|
|
cvf::Color3f defaultComponentColor() const override;
|
|
|
|
double startMD() const override;
|
|
|
|
double endMD() const override;
|
|
|
|
|
2018-08-06 00:52:02 -05:00
|
|
|
private:
|
2019-10-28 07:53:54 -05:00
|
|
|
static std::set<double> supportedDiameters( RiaDefines::WellPathComponentType type );
|
|
|
|
|
2018-11-22 05:57:11 -06:00
|
|
|
bool isDiameterSupported() const;
|
2019-09-06 03:40:57 -05:00
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
|
|
|
bool* useOptionsOnly ) override;
|
|
|
|
static QString generateInchesLabel( double diameter );
|
2020-02-12 04:43:15 -06:00
|
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
2019-09-06 03:40:57 -05:00
|
|
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
2018-08-06 00:52:02 -05:00
|
|
|
|
2018-08-30 07:03:58 -05:00
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmField<CompletionTypeEnum> m_type;
|
|
|
|
caf::PdmField<double> m_startMD;
|
|
|
|
caf::PdmField<double> m_endMD;
|
|
|
|
caf::PdmField<double> m_diameterInInches;
|
2018-08-06 00:52:02 -05:00
|
|
|
};
|