///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2016-2018 Statoil ASA // Copyright (C) 2019- 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 "RiaDefines.h" #include "RimPlotAxisPropertiesInterface.h" #include "RiuPlotAxis.h" #include "cafAppEnum.h" #include "cafFontTools.h" #include "cafPdmChildArrayField.h" #include "cafPdmField.h" #include "cafPdmObject.h" #include class RimPlotAxisAnnotation; //================================================================================================== /// /// //================================================================================================== class RimPlotAxisProperties : public RimPlotAxisPropertiesInterface { CAF_PDM_HEADER_INIT; public: enum NumberFormatType { NUMBER_FORMAT_AUTO, NUMBER_FORMAT_DECIMAL, NUMBER_FORMAT_SCIENTIFIC }; public: caf::Signal<> settingsChanged; caf::Signal logarithmicChanged; caf::Signal axisPositionChanged; public: RimPlotAxisProperties(); void setEnableTitleTextSettings( bool enable ); void enableRangeSettings( bool enable ); void setNameAndAxis( const QString& name, RiaDefines::PlotAxis axis, int axisIndex = 0 ); AxisTitlePositionType titlePosition() const override; int titleFontSize() const override; int valuesFontSize() const override; const QString& name() const override; RiuPlotAxis plotAxisType() const override; bool useAutoTitle() const; bool showDescription() const; bool showAcronym() const; bool showUnitText() const; bool isAutoZoom() const override; void setAutoZoom( bool enableAutoZoom ) override; bool isAxisInverted() const override; void setAxisInverted( bool inverted ); bool isDeletable() const override; std::vector annotations() const override; void appendAnnotation( RimPlotAxisAnnotation* annotation ) override; void removeAllAnnotations() override; caf::PdmField customTitle; caf::PdmField> numberFormat; caf::PdmField numberOfDecimals; caf::PdmField scaleFactor; bool isLogarithmicScaleEnabled() const override; bool isActive() const override; void showAnnotationObjectsInProjectTree(); double visibleRangeMin() const override; double visibleRangeMax() const override; void setVisibleRangeMin( double value ) override; void setVisibleRangeMax( double value ) override; protected: void initAfterRead() override; caf::PdmFieldHandle* userDescriptionField() override; caf::PdmFieldHandle* objectToggleField() override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; private: void updateOptionSensitivity(); caf::FontTools::FontSize plotFontSize() const; private: caf::PdmField m_isActive; caf::PdmField isAutoTitle; caf::PdmField m_displayShortName; caf::PdmField m_displayLongName; caf::PdmField m_displayUnitText; caf::PdmField m_isAutoZoom; caf::PdmField m_isAxisInverted; caf::PdmField m_visibleRangeMin; caf::PdmField m_visibleRangeMax; caf::PdmField m_name; caf::PdmField> m_plotAxis; caf::PdmField m_plotAxisIndex; caf::PdmField m_isLogarithmicScaleEnabled; bool m_enableTitleTextSettings; bool m_isRangeSettingsEnabled; caf::PdmField m_titleFontSize; caf::PdmField> m_titlePositionEnum; caf::PdmField m_valuesFontSize; caf::PdmChildArrayField m_annotations; };