///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) Statoil ASA // Copyright (C) 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 "RimLegendConfig.h" #include "cvfObject.h" #include "cafAppEnum.h" class RimEclipseView; class RivTernarySaturationOverlayItem; class RivTernaryScalarMapper; namespace cvf { class OverlayItem; } //================================================================================================== /// /// //================================================================================================== class RimTernaryLegendConfig : public RimLegendConfig { CAF_PDM_HEADER_INIT; public: enum TernaryArrayIndex { TERNARY_SOIL_IDX = 0, TERNARY_SGAS_IDX, TERNARY_SWAT_IDX }; public: RimTernaryLegendConfig(); ~RimTernaryLegendConfig() override; void setUiValuesFromLegendConfig( const RimTernaryLegendConfig* otherLegendConfig ); void setAutomaticRanges( TernaryArrayIndex ternaryIndex, double globalMin, double globalMax, double localMin, double localMax ); void onRecreateLegend() override; bool showLegend() const; void setTitle( const QString& title ); const RivTernaryScalarMapper* scalarMapper() const; const caf::TitledOverlayFrame* titledOverlayFrame() const override; caf::TitledOverlayFrame* titledOverlayFrame() override; void updateFonts() override; private: void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; caf::PdmFieldHandle* objectToggleField() override; void updateLegend(); void updateLabelText(); double roundToNumSignificantDigits( double value, double precision ); void ternaryRanges( double& soilLower, double& soilUpper, double& sgasLower, double& sgasUpper, double& swatLower, double& swatUpper ) const; private: caf::PdmField precision; caf::PdmField rangeMode; caf::PdmField userDefinedMaxValueSoil; caf::PdmField userDefinedMinValueSoil; caf::PdmField userDefinedMaxValueSgas; caf::PdmField userDefinedMinValueSgas; caf::PdmField userDefinedMaxValueSwat; caf::PdmField userDefinedMinValueSwat; caf::PdmField applyLocalMinMax; caf::PdmField applyGlobalMinMax; caf::PdmField applyFullRangeMinMax; caf::PdmField ternaryRangeSummary; caf::PdmField m_showLegend; std::vector m_globalAutoMax; std::vector m_globalAutoMin; std::vector m_localAutoMax; std::vector m_localAutoMin; cvf::ref m_legend; cvf::ref m_scalarMapper; };