///////////////////////////////////////////////////////////////////////////////// // // 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 "cafPdmField.h" #include "cafPdmObject.h" #include "cafPdmPointer.h" #include "cafAppEnum.h" #include "RigFemResultPosEnum.h" #include "RigFemResultAddress.h" class RimGeoMechView; class RimGeoMechPropertyFilter; class RifGeoMechReaderInterface; class RigGeoMechCaseData; class RimGeoMechCase; //================================================================================================== /// /// //================================================================================================== class RimGeoMechResultDefinition : public caf::PdmObject { CAF_PDM_HEADER_INIT; public: RimGeoMechResultDefinition(void); virtual ~RimGeoMechResultDefinition(void); void setGeoMechCase(RimGeoMechCase* geomCase); RigGeoMechCaseData* ownerCaseData(); bool hasResult(); void loadResult(); RigFemResultAddress resultAddress(); RigFemResultPosEnum resultPositionType() { return m_resultPositionType();} QString resultFieldName() { return m_resultFieldName();} QString resultComponentName() { return m_resultComponentName();} void setResultAddress(const RigFemResultAddress& resultAddress); QString resultFieldUiName(); QString resultComponentUiName(); bool hasCategoryResult() { return m_resultPositionType() == RIG_FORMATION_NAMES; } protected: virtual void updateLegendCategorySettings() {}; virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; private: // Overridden PDM methods virtual QList calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly); virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); virtual void initAfterRead(); // Metadata and option build tools std::map > getResultMetaDataForUIFieldSetting(); static void getUiAndResultVariableStringList(QStringList* uiNames, QStringList* variableNames, const std::map >& fieldCompNames, bool isTimeLapseResultList, int baseFrameIdx); static QString composeFieldCompString(const QString& resultFieldName, const QString& resultComponentName); static QString convertToUiResultFieldName(QString resultFieldName, bool isTimeLapseResultList, int baseFrameIdx); static QString convertToUIComponentName(QString resultComponentName, bool isTimeLapseResultList, int baseFrameIdx); // Data Fields caf::PdmField > m_resultPositionType; caf::PdmField m_resultFieldName; caf::PdmField m_resultComponentName; caf::PdmField m_isTimeLapseResult; caf::PdmField m_timeLapseBaseTimestep; // UI Fields only friend class RimGeoMechPropertyFilter; // Property filter needs the ui fields friend class RimWellLogExtractionCurve; // Curve needs the ui fields friend class RimGeoMechCellColors; // Needs the ui fields caf::PdmField > m_resultPositionTypeUiField; caf::PdmField m_resultVariableUiField; caf::PdmField m_isTimeLapseResultUiField; caf::PdmField m_timeLapseBaseTimestepUiField; caf::PdmPointer m_geomCase; };