///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2018- Equinor 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RicCreateMultipleFracturesOptionItemUi.h" #include #include "cafPdmChildArrayField.h" #include "cafPdmField.h" #include "cafPdmObject.h" #include "cafPdmProxyValueField.h" class RimEclipseCase; class RimWellPath; class RigMainGrid; namespace caf { class PdmUiPropertyViewDialog; } //================================================================================================== /// //================================================================================================== class LocationForNewFracture { public: LocationForNewFracture( RimFractureTemplate* fractureTemplate, RimWellPath* wellPath, double measuredDepth ) : fractureTemplate( fractureTemplate ) , wellPath( wellPath ) , measuredDepth( measuredDepth ) { } bool operator<( const LocationForNewFracture& loc ) const { return measuredDepth < loc.measuredDepth; } RimFractureTemplate* fractureTemplate; RimWellPath* wellPath; double measuredDepth; }; //================================================================================================== /// //================================================================================================== class RiuCreateMultipleFractionsUi : public caf::PdmObject { CAF_PDM_HEADER_INIT; public: static const QString ADD_FRACTURES_BUTTON_TEXT; static const QString REPLACE_FRACTURES_BUTTON_TEXT; RiuCreateMultipleFractionsUi(); void setParentDialog( QPointer dialog ); void setValues( RimEclipseCase* eclipseCase, double minimumDistanceFromWellTip, int maxFracturesPerWell ); void resetValues(); std::vector options() const; void insertOptionItem( RicCreateMultipleFracturesOptionItemUi* insertAfterThisObject, RicCreateMultipleFracturesOptionItemUi* objectToInsert ); void deleteOptionItem( RicCreateMultipleFracturesOptionItemUi* optionsItem ); void clearOptions(); void addWellPath( RimWellPath* wellPath ); void clearWellPaths(); std::vector locationsForNewFractures() const; void updateButtonsEnableState(); private: QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override; void defineCustomContextMenu( const caf::PdmFieldHandle* fieldNeedingMenu, QMenu* menu, QWidget* fieldEditorWidget ) override; void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; QString summaryText() const; private: caf::PdmPtrField m_sourceCase; caf::PdmField m_minDistanceFromWellTd; caf::PdmField m_maxFracturesPerWell; caf::PdmChildArrayField m_options; caf::PdmProxyValueField m_fractureCreationSummary; std::vector m_wellPaths; QPointer m_dialog; };