ResInsight/ApplicationLibCode/ProjectDataModel/RimPlotCurveAppearance.h
Magne Sjaastad 9a6e37a2f9
Adjustments for release
* #9681 Disable auto plot title check box when typing a custom name
The Auto Plot Title check box is not possible to click on using the mouse. A useful workaround is to disable the check box when the user enter a custom name in the name field.

* #10361 Make sure all objects change color when selecting curve color
Add support for direct change of all selected curve objects when changing color

* Use title as first field in group to avoid Qt checkbox not reacting to mouse click

* #9681 Disable auto name when name is changed in sub plot

* #10344 Surfaces: Add option to exclude inactive cells

* #10369 Use one color for bars in tornado plot

* Update license info
2023-06-09 14:09:08 +02:00

128 lines
4.7 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- 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 "RiaCurveDataTools.h"
#include "RiaDefines.h"
#include "RiuPlotCurveSymbol.h"
#include "RiuQwtPlotCurveDefines.h"
#include "cafPdmField.h"
#include "cafPdmFieldCvfColor.h"
#include "cafPdmObject.h"
//==================================================================================================
///
///
//==================================================================================================
class RimPlotCurveAppearance : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
caf::Signal<> appearanceChanged;
caf::Signal<> fillColorChanged;
public:
using CurveInterpolation = caf::AppEnum<RiuQwtPlotCurveDefines::CurveInterpolationEnum>;
using LineStyle = caf::AppEnum<RiuQwtPlotCurveDefines::LineStyleEnum>;
using PointSymbol = caf::AppEnum<RiuPlotCurveSymbol::PointSymbolEnum>;
using LabelPosition = caf::AppEnum<RiuPlotCurveSymbol::LabelPosition>;
using FillStyle = caf::AppEnum<Qt::BrushStyle>;
public:
RimPlotCurveAppearance();
~RimPlotCurveAppearance() override;
void setColor( const cvf::Color3f& color );
cvf::Color3f color() const;
void setColorWithFieldChanged( const QColor& color );
void setLineStyle( RiuQwtPlotCurveDefines::LineStyleEnum lineStyle );
RiuQwtPlotCurveDefines::LineStyleEnum lineStyle() const;
void setLineThickness( int thickness );
int lineThickness() const;
void setSymbol( RiuPlotCurveSymbol::PointSymbolEnum symbolStyle );
RiuPlotCurveSymbol::PointSymbolEnum symbol() const;
void setSymbolSize( int sizeInPixels );
int symbolSize() const;
cvf::Color3f symbolEdgeColor() const;
void setSymbolEdgeColor( const cvf::Color3f& edgeColor );
void setSymbolSkipDistance( float distance );
float symbolSkipDistance() const;
void setSymbolLabel( const QString& label );
QString symbolLabel() const;
void setSymbolLabelPosition( RiuPlotCurveSymbol::LabelPosition labelPosition );
RiuPlotCurveSymbol::LabelPosition symbolLabelPosition() const;
void resetAppearance();
Qt::BrushStyle fillStyle() const;
void setFillStyle( Qt::BrushStyle brushStyle );
void setFillColor( const cvf::Color3f& fillColor );
cvf::Color3f fillColor() const;
float curveFittingTolerance() const;
void setInterpolation( RiuQwtPlotCurveDefines::CurveInterpolationEnum );
RiuQwtPlotCurveDefines::CurveInterpolationEnum interpolation() const;
void setInterpolationVisible( bool isVisible );
void setColorVisible( bool isVisible );
void setFillOptionsVisible( bool isVisible );
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
protected:
// Overridden PDM methods
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void initAfterRead() override;
protected:
caf::PdmField<QString> m_symbolLabel;
caf::PdmField<int> m_symbolSize;
caf::PdmField<cvf::Color3f> m_curveColor;
caf::PdmField<int> m_curveThickness;
caf::PdmField<float> m_symbolSkipPixelDistance;
caf::PdmField<float> m_curveFittingTolerance;
caf::PdmField<PointSymbol> m_pointSymbol;
caf::PdmField<LineStyle> m_lineStyle;
caf::PdmField<FillStyle> m_fillStyle;
caf::PdmField<cvf::Color3f> m_fillColor;
caf::PdmField<CurveInterpolation> m_curveInterpolation;
caf::PdmField<LabelPosition> m_symbolLabelPosition;
caf::PdmField<cvf::Color3f> m_symbolEdgeColor;
bool m_colorVisible;
bool m_interpolationVisible;
bool m_fillOptionsVisible;
};