///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2015- Statoil ASA // Copyright (C) 2015- Ceetron Solutions AS // // 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 "RimCase.h" #include "cafFilePath.h" #include "cafPdmChildArrayField.h" #include "cafPdmField.h" #include "cafPdmObject.h" #include "cafPdmPointer.h" #include "cvfObject.h" #include class RimGeoMechView; class RigGeoMechCaseData; class RifGeoMechReaderInterface; class RimGeoMechContourMapView; class RimGeoMechContourMapViewCollection; //================================================================================================== /// /// //================================================================================================== class RimGeoMechCase : public RimCase { CAF_PDM_HEADER_INIT; public: enum CaseOpenStatus { CASE_OPEN_OK = 0, CASE_OPEN_CANCELLED, CASE_OPEN_ERROR }; RimGeoMechCase( void ); ~RimGeoMechCase( void ) override; void setFileName( const QString& fileName ); QString caseFileName() const; CaseOpenStatus openGeoMechCase( std::string* errorMessage ); RigGeoMechCaseData* geoMechData(); const RigGeoMechCaseData* geoMechData() const; RimGeoMechContourMapViewCollection* contourMapCollection(); void reloadDataAndUpdate(); RimGeoMechView* createAndAddReservoirView(); RimGeoMechView* createCopyAndAddView( const RimGeoMechView* sourceView ); void updateFilePathsFromProjectPath( const QString& projectPath, const QString& oldProjectPath ) override; std::vector timeStepDates() const override; QStringList timeStepStrings() const override; QString timeStepName( int frameIdx ) const override; cvf::BoundingBox activeCellsBoundingBox() const override; cvf::BoundingBox allCellsBoundingBox() const override; double characteristicCellSize() const override; void setFormationNames( RimFormationNames* formationNames ) override; void addElementPropertyFiles( const std::vector& filenames ); double cohesion() const; double frictionAngleDeg() const; void setApplyTimeFilter( bool applyTimeFilter ); // Fields: caf::PdmChildArrayField geoMechViews; private: cvf::Vec3d displayModelOffset() const override; static std::vector vectorOfValidDateTimesFromTimeStepStrings( const QStringList& timeStepStrings ); static QDateTime dateTimeFromTimeStepString( const QString& timeStepString ); void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override; void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; void updateFormationNamesData() override; void initAfterRead() override; static QString subStringOfDigits( const QString& timeStepString, int numberOfDigitsToFind ); void closeSelectedElementPropertyFiles(); void reloadSelectedElementPropertyFiles(); std::vector allSpecialViews() const override; private: cvf::ref m_geoMechCaseData; caf::PdmField m_caseFileName; caf::PdmField m_cohesion; caf::PdmField m_frictionAngleDeg; caf::PdmField> m_elementPropertyFileNames; caf::PdmField> m_elementPropertyFileNameIndexUiSelection; caf::PdmField m_closeElementPropertyFileCommand; caf::PdmField m_reloadElementPropertyFileCommand; caf::PdmChildField m_contourMapCollection; bool m_applyTimeFilter; };