2018-07-03 01:42:31 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2019-01-09 08:21:38 -06:00
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2018-07-03 01:42:31 -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-07-03 01:42:31 -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-07-03 01:42:31 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RiaLineArcWellPathCalculator.h"
|
|
|
|
#include "RiaWellPlanCalculator.h"
|
2020-04-07 08:07:52 -05:00
|
|
|
|
2018-07-03 01:42:31 -05:00
|
|
|
#include "cafAppEnum.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "cafPdmChildArrayField.h"
|
2020-05-22 03:07:32 -05:00
|
|
|
#include "cafPdmChildField.h"
|
2018-07-03 01:42:31 -05:00
|
|
|
#include "cafPdmField.h"
|
|
|
|
#include "cafPdmFieldCvfVec3d.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "cafPdmObject.h"
|
2018-07-03 01:42:31 -05:00
|
|
|
#include "cafPdmPtrField.h"
|
2020-04-07 08:07:52 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "cvfObject.h"
|
2018-08-29 09:03:31 -05:00
|
|
|
|
2018-07-03 01:42:31 -05:00
|
|
|
class RimWellPath;
|
|
|
|
class RimWellPathTarget;
|
2018-08-29 09:03:31 -05:00
|
|
|
class RicCreateWellTargetsPickEventHandler;
|
2018-07-03 01:42:31 -05:00
|
|
|
|
|
|
|
class RigWellPath;
|
|
|
|
|
|
|
|
class RimWellPathGeometryDef : public caf::PdmObject
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_HEADER_INIT;
|
2018-07-03 01:42:31 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
public:
|
2018-07-03 01:42:31 -05:00
|
|
|
RimWellPathGeometryDef();
|
|
|
|
~RimWellPathGeometryDef() override;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::Vec3d referencePointXyz() const;
|
|
|
|
void setReferencePointXyz( const cvf::Vec3d& refPointXyz );
|
2018-08-29 09:03:31 -05:00
|
|
|
|
2020-02-06 09:18:50 -06:00
|
|
|
double airGap() const;
|
|
|
|
void setAirGap( double airGap );
|
2020-04-15 01:40:12 -05:00
|
|
|
double mdAtFirstTarget() const;
|
|
|
|
void setMdAtFirstTarget( double mdrkb );
|
2018-10-31 08:55:27 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::ref<RigWellPath> createWellPathGeometry();
|
2018-07-03 01:42:31 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void updateWellPathVisualization();
|
|
|
|
std::pair<RimWellPathTarget*, RimWellPathTarget*>
|
|
|
|
findActiveTargetsAroundInsertionPoint( const RimWellPathTarget* targetToInsertBefore );
|
2018-07-03 01:42:31 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void insertTarget( const RimWellPathTarget* targetToInsertBefore, RimWellPathTarget* targetToInsert );
|
|
|
|
void deleteTarget( RimWellPathTarget* targetTodelete );
|
2020-05-13 23:39:55 -05:00
|
|
|
void deleteAllTargets();
|
2019-09-06 03:40:57 -05:00
|
|
|
void appendTarget();
|
2018-07-04 09:49:04 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
const RimWellPathTarget* firstActiveTarget() const;
|
|
|
|
const RimWellPathTarget* lastActiveTarget() const;
|
2018-07-04 09:49:04 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void enableTargetPointPicking( bool isEnabling );
|
2018-09-11 02:31:50 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<RiaWellPlanCalculator::WellPlanSegment> wellPlan() const;
|
|
|
|
std::vector<RimWellPathTarget*> activeWellTargets() const;
|
2018-09-11 02:31:50 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
protected:
|
2020-02-12 04:43:15 -06:00
|
|
|
void defineCustomContextMenu( const caf::PdmFieldHandle* fieldNeedingMenu, QMenu* menu, QWidget* fieldEditorWidget ) override;
|
2019-02-11 06:46:48 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
|
|
|
QString uiConfigName,
|
|
|
|
caf::PdmUiEditorAttribute* attribute ) override;
|
|
|
|
|
|
|
|
virtual void defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
2019-02-11 06:46:48 -06:00
|
|
|
|
2018-09-11 02:31:50 -05:00
|
|
|
private:
|
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;
|
|
|
|
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName ) override;
|
|
|
|
void initAfterRead() override;
|
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
|
|
|
bool* useOptionsOnly ) override;
|
|
|
|
|
|
|
|
RiaLineArcWellPathCalculator lineArcWellPathCalculator() const;
|
2018-07-03 01:42:31 -05:00
|
|
|
|
2020-04-07 08:07:52 -05:00
|
|
|
void updateTargetAtSeaLevel();
|
2020-05-22 03:07:32 -05:00
|
|
|
void test();
|
2020-04-07 08:07:52 -05:00
|
|
|
|
2018-07-31 01:44:37 -05:00
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmField<cvf::Vec3d> m_referencePointUtmXyd;
|
2018-07-03 01:42:31 -05:00
|
|
|
|
2020-02-06 09:18:50 -06:00
|
|
|
caf::PdmField<double> m_airGap;
|
|
|
|
|
|
|
|
caf::PdmField<double> m_mdAtFirstTarget;
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmChildArrayField<RimWellPathTarget*> m_wellTargets;
|
2020-04-07 08:07:52 -05:00
|
|
|
caf::PdmField<bool> m_useAutoGeneratedTargetAtSeaLevel;
|
2020-05-22 03:07:32 -05:00
|
|
|
caf::PdmChildField<RimWellPathTarget*> m_autoTargetAtSeaLevel;
|
|
|
|
caf::PdmField<bool> m_pickPointsEnabled;
|
2018-09-11 02:31:50 -05:00
|
|
|
|
2019-02-11 06:46:48 -06:00
|
|
|
std::shared_ptr<RicCreateWellTargetsPickEventHandler> m_pickTargetsEventHandler;
|
2018-07-03 01:42:31 -05:00
|
|
|
};
|