mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 23:46:00 -06:00
47b93dc0d1
* First PDF creation support * Reimplement info box * Set title and make overlay frame margins more unified * Remove a style sheet that was never meant to be applied to Project Tree * Update RiuDraggableOverlayFrame when changing content * Default page layout in Preferences * undo removal of elision * Remove friend class assignment in cafCategoryMapper * the required methods have been made public * Fix up after review * Remove spurious const on by-value return * Fix compile errors on Linux * Fix size adjustment of legends with plot resizing
102 lines
3.1 KiB
C++
102 lines
3.1 KiB
C++
/////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// 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 "RimPlotWindow.h"
|
|
|
|
#include "cafAppEnum.h"
|
|
#include "cafPdmChildArrayField.h"
|
|
#include "cafPdmField.h"
|
|
#include "cafPdmObject.h"
|
|
|
|
#include <QPointer>
|
|
|
|
class RiuQwtPlotWidget;
|
|
class RimPlotCurve;
|
|
class QwtPlotCurve;
|
|
|
|
//==================================================================================================
|
|
///
|
|
///
|
|
//==================================================================================================
|
|
class RimPlot : public RimPlotWindow
|
|
{
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
public:
|
|
enum RowOrColSpan
|
|
{
|
|
UNLIMITED = -1,
|
|
ONE = 1,
|
|
TWO = 2,
|
|
THREE = 3,
|
|
FOUR = 4,
|
|
FIVE = 5
|
|
};
|
|
using RowOrColSpanEnum = caf::AppEnum<RowOrColSpan>;
|
|
|
|
public:
|
|
RimPlot();
|
|
virtual ~RimPlot();
|
|
|
|
// Real implementations
|
|
void createPlotWidget();
|
|
RowOrColSpan rowSpan() const;
|
|
RowOrColSpan colSpan() const;
|
|
void setRowSpan( RowOrColSpan rowSpan );
|
|
void setColSpan( RowOrColSpan colSpan );
|
|
void removeFromMdiAreaAndCollection();
|
|
void updateAfterInsertingIntoMultiPlot();
|
|
|
|
// Pure virtual interface methods
|
|
virtual RiuQwtPlotWidget* viewer() = 0;
|
|
|
|
virtual void setAutoScaleXEnabled( bool enabled ) = 0;
|
|
virtual void setAutoScaleYEnabled( bool enabled ) = 0;
|
|
virtual void updateAxes() = 0;
|
|
|
|
virtual void updateLegend() = 0;
|
|
virtual void updateZoomInQwt() = 0;
|
|
virtual void updateZoomFromQwt() = 0;
|
|
|
|
virtual QString asciiDataForPlotExport() const = 0;
|
|
|
|
virtual void reattachAllCurves() = 0;
|
|
virtual void detachAllCurves() = 0;
|
|
|
|
virtual caf::PdmObject* findPdmObjectFromQwtCurve( const QwtPlotCurve* curve ) const = 0;
|
|
|
|
virtual void onAxisSelected( int axis, bool toggle ) = 0;
|
|
|
|
protected:
|
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|
const QVariant& oldValue,
|
|
const QVariant& newValue ) override;
|
|
|
|
private:
|
|
virtual void doRemoveFromCollection() = 0;
|
|
virtual void doRenderWindowContent( QPainter* painter );
|
|
|
|
protected:
|
|
caf::PdmField<RowOrColSpanEnum> m_rowSpan;
|
|
caf::PdmField<RowOrColSpanEnum> m_colSpan;
|
|
};
|