2016-05-09 05:13:54 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2016 Statoil 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 "cafPdmObject.h"
|
|
|
|
#include "cafPdmField.h"
|
|
|
|
#include "cafPdmChildArrayField.h"
|
|
|
|
#include "cafAppEnum.h"
|
|
|
|
|
|
|
|
#include <QPointer>
|
|
|
|
|
2016-05-24 03:37:10 -05:00
|
|
|
#include "RimViewWindow.h"
|
|
|
|
|
2016-05-26 06:17:26 -05:00
|
|
|
class RiuSummaryQwtPlot;
|
2016-05-09 05:13:54 -05:00
|
|
|
class RimSummaryCurve;
|
2016-06-13 07:50:28 -05:00
|
|
|
class RimSummaryCurveFilter;
|
2016-06-22 04:34:26 -05:00
|
|
|
class QwtPlotCurve;
|
2016-05-09 05:13:54 -05:00
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
2016-05-24 03:37:10 -05:00
|
|
|
class RimSummaryPlot : public RimViewWindow
|
2016-05-09 05:13:54 -05:00
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
|
|
|
public:
|
|
|
|
RimSummaryPlot();
|
|
|
|
virtual ~RimSummaryPlot();
|
|
|
|
|
2016-06-13 07:50:28 -05:00
|
|
|
void setDescription(const QString& description);
|
|
|
|
void addCurve(RimSummaryCurve* curve);
|
|
|
|
void addCurveFilter(RimSummaryCurveFilter* curveFilter);
|
2016-06-22 04:34:26 -05:00
|
|
|
|
|
|
|
RimSummaryCurve* findRimCurveFromQwtCurve(const QwtPlotCurve* curve) const;
|
2016-06-13 07:50:28 -05:00
|
|
|
|
|
|
|
void loadDataAndUpdate();
|
|
|
|
void handleViewerDeletion();
|
2016-06-22 07:34:56 -05:00
|
|
|
void updateYAxisUnit();
|
2016-07-06 06:35:24 -05:00
|
|
|
void updateCaseNameHasChanged();
|
2016-06-27 14:01:17 -05:00
|
|
|
|
2016-06-28 04:38:11 -05:00
|
|
|
QWidget* viewer();
|
|
|
|
|
2016-07-05 03:47:03 -05:00
|
|
|
|
|
|
|
virtual void zoomAll() override;
|
|
|
|
|
2016-05-09 05:13:54 -05:00
|
|
|
protected:
|
|
|
|
// Overridden PDM methods
|
2016-06-13 07:50:28 -05:00
|
|
|
virtual caf::PdmFieldHandle* objectToggleField() { return &m_showWindow; }
|
|
|
|
virtual caf::PdmFieldHandle* userDescriptionField() { return &m_userName; }
|
|
|
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
|
|
|
virtual void setupBeforeSave() override;
|
2016-05-09 05:13:54 -05:00
|
|
|
|
2016-06-27 14:01:17 -05:00
|
|
|
virtual QImage snapshotWindowContent() override;
|
|
|
|
|
2016-05-09 05:13:54 -05:00
|
|
|
private:
|
2016-06-13 07:50:28 -05:00
|
|
|
void updateViewerWidget();
|
2016-06-29 07:15:39 -05:00
|
|
|
void updateViewerWidgetWindowTitle();
|
2016-06-13 07:50:28 -05:00
|
|
|
void detachAllCurves();
|
|
|
|
void deletePlotWidget();
|
2016-05-25 06:15:17 -05:00
|
|
|
|
2016-06-13 07:50:28 -05:00
|
|
|
caf::PdmField<bool> m_showWindow;
|
|
|
|
caf::PdmField<QString> m_userName;
|
|
|
|
caf::PdmChildArrayField<RimSummaryCurve*> m_curves;
|
|
|
|
caf::PdmChildArrayField<RimSummaryCurveFilter*> m_curveFilters;
|
2016-07-05 07:58:42 -05:00
|
|
|
caf::PdmField<std::vector<float> > m_visibleWindow;
|
2016-05-09 05:13:54 -05:00
|
|
|
|
2016-06-13 07:50:28 -05:00
|
|
|
QPointer<RiuSummaryQwtPlot> m_qwtPlot;
|
2016-05-09 05:13:54 -05:00
|
|
|
};
|