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