2018-10-05 08:59:19 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2018-10-05 08:59:19 -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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2018-10-05 08:59:19 -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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2018-10-05 08:59:19 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "qwt_plot_item.h"
|
|
|
|
|
|
|
|
class QwtGraphic;
|
|
|
|
class QRectF;
|
|
|
|
class QPainter;
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
/// Class that can combine multiple Qwt plot items into one Qwt graphic with a combined legend.
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-10-05 08:59:19 -05:00
|
|
|
//==================================================================================================
|
|
|
|
class RiuQwtPlotItemGroup : public QwtPlotItem
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RiuQwtPlotItemGroup();
|
2018-10-18 12:45:57 -05:00
|
|
|
~RiuQwtPlotItemGroup() override;
|
2018-10-05 08:59:19 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void addPlotItem( QwtPlotItem* plotItem );
|
|
|
|
void addLegendItem( QwtPlotItem* legendItem );
|
2018-10-05 08:59:19 -05:00
|
|
|
|
2020-02-12 04:13:38 -06:00
|
|
|
int rtti() const override { return 5000; }
|
2019-09-06 03:40:57 -05:00
|
|
|
void draw( QPainter* painter, const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QRectF& canvasRect ) const override;
|
|
|
|
QRectF boundingRect() const override;
|
|
|
|
QwtGraphic legendIcon( int index, const QSizeF& size ) const override;
|
2018-10-05 08:59:19 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::vector<QwtPlotItem*> m_plotItems;
|
|
|
|
std::vector<QwtPlotItem*> m_legendItems;
|
|
|
|
};
|