mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4134 #4124 Refactor RiuSummaryQwtPlot on top of a base RiuQwtPlot class and use this for Cross Plots
* Get a lot of functionality included: zoom, panning, etc.
This commit is contained in:
111
ApplicationCode/ProjectDataModel/RimPlotAxisProperties.h
Normal file
111
ApplicationCode/ProjectDataModel/RimPlotAxisProperties.h
Normal file
@@ -0,0 +1,111 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "qwt_plot.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimPlotAxisProperties : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
enum NumberFormatType
|
||||
{
|
||||
NUMBER_FORMAT_AUTO,
|
||||
NUMBER_FORMAT_DECIMAL,
|
||||
NUMBER_FORMAT_SCIENTIFIC
|
||||
};
|
||||
|
||||
enum AxisTitlePositionType
|
||||
{
|
||||
AXIS_TITLE_CENTER,
|
||||
AXIS_TITLE_END
|
||||
};
|
||||
|
||||
public:
|
||||
RimPlotAxisProperties();
|
||||
|
||||
void setEnableTitleTextSettings(bool enable);
|
||||
void setNameAndAxis(const QString& name, QwtPlot::Axis axis);
|
||||
QwtPlot::Axis qwtPlotAxisType() const;
|
||||
RiaDefines::PlotAxis plotAxisType() const;
|
||||
bool useAutoTitle() const;
|
||||
bool showDescription() const;
|
||||
bool showAcronym() const;
|
||||
bool showUnitText() const;
|
||||
bool isAutoZoom() const;
|
||||
void setAutoZoom(bool enableAutoZoom);
|
||||
|
||||
caf::PdmField<QString> customTitle;
|
||||
caf::PdmField<int> titleFontSize;
|
||||
caf::PdmField<caf::AppEnum<AxisTitlePositionType>> titlePositionEnum;
|
||||
|
||||
caf::PdmField<double> visibleRangeMin;
|
||||
caf::PdmField<double> visibleRangeMax;
|
||||
|
||||
caf::PdmField<caf::AppEnum<NumberFormatType>> numberFormat;
|
||||
caf::PdmField<int> numberOfDecimals;
|
||||
caf::PdmField<double> scaleFactor;
|
||||
caf::PdmField<bool> isLogarithmicScaleEnabled;
|
||||
caf::PdmField<int> valuesFontSize;
|
||||
|
||||
bool isActive() const;
|
||||
|
||||
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<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly) override;
|
||||
|
||||
private:
|
||||
void updateOptionSensitivity();
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_isActive;
|
||||
|
||||
caf::PdmField<bool> isAutoTitle;
|
||||
caf::PdmField<bool> m_displayShortName;
|
||||
caf::PdmField<bool> m_displayLongName;
|
||||
caf::PdmField<bool> m_displayUnitText;
|
||||
caf::PdmField<bool> m_isAutoZoom;
|
||||
|
||||
caf::PdmField<QString> m_name;
|
||||
QwtPlot::Axis m_axis;
|
||||
|
||||
bool m_enableTitleTextSettings;
|
||||
};
|
||||
Reference in New Issue
Block a user