2016-10-07 03:51:08 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2019-02-25 07:54:36 -06:00
|
|
|
// Copyright (C) 2016-2018 Statoil ASA
|
|
|
|
// Copyright (C) 2019- Equinor ASA
|
2017-12-12 00:42:16 -06:00
|
|
|
//
|
2016-10-07 03:51:08 -05:00
|
|
|
// 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.
|
2017-12-12 00:42:16 -06:00
|
|
|
//
|
2016-10-07 03:51:08 -05:00
|
|
|
// 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.
|
2017-12-12 00:42:16 -06:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2016-10-07 03:51:08 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2017-06-13 08:41:52 -05:00
|
|
|
#include "RiaDefines.h"
|
2019-04-10 09:13:40 -05:00
|
|
|
#include "RimPlotAxisPropertiesInterface.h"
|
2016-11-24 03:14:26 -06:00
|
|
|
|
2022-01-19 02:50:28 -06:00
|
|
|
#include "RiuPlotAxis.h"
|
|
|
|
|
2016-10-07 03:51:08 -05:00
|
|
|
#include "cafAppEnum.h"
|
2020-05-09 04:23:58 -05:00
|
|
|
#include "cafFontTools.h"
|
2017-12-12 00:42:16 -06:00
|
|
|
#include "cafPdmChildArrayField.h"
|
|
|
|
#include "cafPdmField.h"
|
|
|
|
#include "cafPdmObject.h"
|
2016-10-07 03:51:08 -05:00
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
2019-03-12 10:05:58 -05:00
|
|
|
class RimPlotAxisAnnotation;
|
|
|
|
|
2016-10-07 03:51:08 -05:00
|
|
|
//==================================================================================================
|
2017-12-12 00:42:16 -06:00
|
|
|
///
|
|
|
|
///
|
2016-10-07 03:51:08 -05:00
|
|
|
//==================================================================================================
|
2022-01-19 02:50:28 -06:00
|
|
|
class RimPlotAxisProperties : public RimPlotAxisPropertiesInterface
|
2016-10-07 03:51:08 -05:00
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum NumberFormatType
|
|
|
|
{
|
|
|
|
NUMBER_FORMAT_AUTO,
|
|
|
|
NUMBER_FORMAT_DECIMAL,
|
|
|
|
NUMBER_FORMAT_SCIENTIFIC
|
|
|
|
};
|
|
|
|
|
2020-07-02 06:06:31 -05:00
|
|
|
public:
|
2022-02-09 08:14:32 -06:00
|
|
|
caf::Signal<> settingsChanged;
|
|
|
|
caf::Signal<bool> logarithmicChanged;
|
|
|
|
caf::Signal<RimPlotAxisProperties*, RiuPlotAxis, RiuPlotAxis> axisPositionChanged;
|
2020-07-02 06:06:31 -05:00
|
|
|
|
2016-10-07 03:51:08 -05:00
|
|
|
public:
|
2019-02-25 07:54:36 -06:00
|
|
|
RimPlotAxisProperties();
|
2016-10-07 03:51:08 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void setEnableTitleTextSettings( bool enable );
|
2020-02-28 07:51:21 -06:00
|
|
|
void enableRangeSettings( bool enable );
|
2022-01-19 02:50:28 -06:00
|
|
|
void setNameAndAxis( const QString& name, RiaDefines::PlotAxis axis, int axisIndex = 0 );
|
2019-04-10 09:13:40 -05:00
|
|
|
AxisTitlePositionType titlePosition() const override;
|
2020-05-09 04:23:58 -05:00
|
|
|
|
|
|
|
int titleFontSize() const override;
|
|
|
|
int valuesFontSize() const override;
|
2019-04-10 09:13:40 -05:00
|
|
|
|
2022-01-19 02:50:28 -06:00
|
|
|
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 );
|
2016-10-07 03:51:08 -05:00
|
|
|
|
2022-02-21 04:32:26 -06:00
|
|
|
bool isDeletable() const override;
|
|
|
|
|
|
|
|
|
2020-12-15 01:19:36 -06:00
|
|
|
std::vector<RimPlotAxisAnnotation*> annotations() const override;
|
|
|
|
void appendAnnotation( RimPlotAxisAnnotation* annotation ) override;
|
2020-12-07 09:47:34 -06:00
|
|
|
void removeAllAnnotations() override;
|
2019-03-12 10:05:58 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmField<QString> customTitle;
|
2017-12-11 09:41:18 -06:00
|
|
|
|
2017-12-12 00:42:16 -06:00
|
|
|
caf::PdmField<caf::AppEnum<NumberFormatType>> numberFormat;
|
|
|
|
caf::PdmField<int> numberOfDecimals;
|
|
|
|
caf::PdmField<double> scaleFactor;
|
2016-10-07 03:51:08 -05:00
|
|
|
|
2022-01-19 02:50:28 -06:00
|
|
|
bool isLogarithmicScaleEnabled() const override;
|
|
|
|
bool isActive() const override;
|
2019-03-18 06:41:44 -05:00
|
|
|
|
|
|
|
void showAnnotationObjectsInProjectTree();
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2022-01-19 02:50:28 -06:00
|
|
|
double visibleRangeMin() const override;
|
|
|
|
double visibleRangeMax() const override;
|
|
|
|
|
|
|
|
void setVisibleRangeMin( double value ) override;
|
|
|
|
void setVisibleRangeMax( double value ) override;
|
|
|
|
|
2016-10-07 03:51:08 -05:00
|
|
|
protected:
|
2018-10-18 12:45:57 -05:00
|
|
|
void initAfterRead() override;
|
|
|
|
caf::PdmFieldHandle* userDescriptionField() override;
|
|
|
|
caf::PdmFieldHandle* objectToggleField() override;
|
2020-02-12 04:43:15 -06:00
|
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
2019-09-06 03:40:57 -05:00
|
|
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
2017-12-12 00:42:16 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
|
|
|
bool* useOptionsOnly ) override;
|
2016-10-07 03:51:08 -05:00
|
|
|
|
|
|
|
private:
|
2020-05-09 04:23:58 -05:00
|
|
|
void updateOptionSensitivity();
|
|
|
|
caf::FontTools::FontSize plotFontSize() const;
|
2016-10-07 03:51:08 -05:00
|
|
|
|
|
|
|
private:
|
2017-12-11 09:41:18 -06:00
|
|
|
caf::PdmField<bool> m_isActive;
|
2017-12-12 00:42:16 -06:00
|
|
|
|
2017-12-11 09:41:18 -06:00
|
|
|
caf::PdmField<bool> isAutoTitle;
|
|
|
|
caf::PdmField<bool> m_displayShortName;
|
|
|
|
caf::PdmField<bool> m_displayLongName;
|
|
|
|
caf::PdmField<bool> m_displayUnitText;
|
2018-05-11 06:18:53 -05:00
|
|
|
caf::PdmField<bool> m_isAutoZoom;
|
2019-03-07 07:34:47 -06:00
|
|
|
caf::PdmField<bool> m_isAxisInverted;
|
2017-12-11 09:41:18 -06:00
|
|
|
|
2022-01-19 02:50:28 -06:00
|
|
|
caf::PdmField<double> m_visibleRangeMin;
|
|
|
|
caf::PdmField<double> m_visibleRangeMax;
|
|
|
|
|
2022-02-09 08:14:32 -06:00
|
|
|
caf::PdmField<QString> m_name;
|
2022-01-19 02:50:28 -06:00
|
|
|
caf::PdmField<caf::AppEnum<RiaDefines::PlotAxis>> m_plotAxis;
|
2022-02-09 08:14:32 -06:00
|
|
|
caf::PdmField<int> m_plotAxisIndex;
|
2022-01-19 02:50:28 -06:00
|
|
|
|
|
|
|
caf::PdmField<bool> m_isLogarithmicScaleEnabled;
|
2019-02-25 07:54:36 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool m_enableTitleTextSettings;
|
2020-02-28 07:51:21 -06:00
|
|
|
bool m_isRangeSettingsEnabled;
|
2019-03-12 10:05:58 -05:00
|
|
|
|
2020-05-09 04:23:58 -05:00
|
|
|
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_titleFontSize;
|
2019-04-10 09:13:40 -05:00
|
|
|
caf::PdmField<caf::AppEnum<AxisTitlePositionType>> m_titlePositionEnum;
|
2020-05-09 04:23:58 -05:00
|
|
|
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_valuesFontSize;
|
2019-04-10 09:13:40 -05:00
|
|
|
caf::PdmChildArrayField<RimPlotAxisAnnotation*> m_annotations;
|
2016-10-07 03:51:08 -05:00
|
|
|
};
|