mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #6041 from OPM/fix-incorrect-line-endings-5891
#5891 Fix incorrect line endings (CRLF -> LF)
This commit is contained in:
commit
ef579d7933
File diff suppressed because it is too large
Load Diff
@ -1,158 +1,158 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 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 "RimViewWindow.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
class RigSimWellData;
|
||||
class RimEclipseResultCase;
|
||||
class RimFlowDiagSolution;
|
||||
class RimSimWellInView;
|
||||
class RimTofAccumulatedPhaseFractionsPlot;
|
||||
class RimTotalWellAllocationPlot;
|
||||
class RimWellAllocationPlotLegend;
|
||||
class RimWellLogPlot;
|
||||
class RimWellLogTrack;
|
||||
class RiuWellAllocationPlot;
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class Color3f;
|
||||
}
|
||||
|
||||
namespace caf
|
||||
{
|
||||
class PdmOptionItemInfo;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimWellAllocationPlot : public RimViewWindow
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
enum FlowType
|
||||
{
|
||||
ACCUMULATED,
|
||||
INFLOW
|
||||
};
|
||||
|
||||
public:
|
||||
RimWellAllocationPlot();
|
||||
~RimWellAllocationPlot() override;
|
||||
|
||||
int id() const final;
|
||||
void setFromSimulationWell( RimSimWellInView* simWell );
|
||||
|
||||
void setDescription( const QString& description );
|
||||
QString description() const;
|
||||
|
||||
QWidget* viewWidget() override;
|
||||
void zoomAll() override;
|
||||
|
||||
RimWellLogPlot* accumulatedWellFlowPlot();
|
||||
RimTotalWellAllocationPlot* totalWellFlowPlot();
|
||||
RimTofAccumulatedPhaseFractionsPlot* tofAccumulatedPhaseFractionsPlot();
|
||||
caf::PdmObject* plotLegend();
|
||||
RimEclipseResultCase* rimCase();
|
||||
int timeStep();
|
||||
FlowType flowType();
|
||||
|
||||
QString wellName() const;
|
||||
|
||||
void removeFromMdiAreaAndDeleteViewWidget();
|
||||
|
||||
void showPlotLegend( bool doShow );
|
||||
|
||||
int fontSize() const override;
|
||||
void updateFonts() override;
|
||||
|
||||
protected:
|
||||
// Overridden PDM methods
|
||||
caf::PdmFieldHandle* userDescriptionField() override { return &m_userName; }
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
std::set<QString> findSortedWellNames();
|
||||
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
|
||||
private:
|
||||
void updateFromWell();
|
||||
|
||||
std::map<QString, const std::vector<double>*> findRelevantTracerCellFractions( const RigSimWellData* simWellData );
|
||||
|
||||
void updateWellFlowPlotXAxisTitle( RimWellLogTrack* plotTrack );
|
||||
|
||||
void addStackedCurve( const QString& tracerName,
|
||||
RiaDefines::DepthTypeEnum depthType,
|
||||
const std::vector<double>& depthValues,
|
||||
const std::vector<double>& accFlow,
|
||||
RimWellLogTrack* plotTrack );
|
||||
|
||||
void updateWidgetTitleWindowTitle();
|
||||
static QString wellStatusTextForTimeStep( const QString& wellName,
|
||||
const RimEclipseResultCase* eclipseResultCase,
|
||||
size_t timeStep );
|
||||
|
||||
// RimViewWindow overrides
|
||||
void assignIdIfNecessary() final;
|
||||
|
||||
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
|
||||
void deleteViewWidget() override;
|
||||
|
||||
cvf::Color3f getTracerColor( const QString& tracerName );
|
||||
|
||||
void updateFormationNamesData() const;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showPlotTitle;
|
||||
caf::PdmField<QString> m_userName;
|
||||
|
||||
caf::PdmField<bool> m_branchDetection;
|
||||
|
||||
caf::PdmPtrField<RimEclipseResultCase*> m_case;
|
||||
caf::PdmField<QString> m_wellName;
|
||||
caf::PdmField<int> m_timeStep;
|
||||
caf::PdmPtrField<RimFlowDiagSolution*> m_flowDiagSolution;
|
||||
caf::PdmField<bool> m_groupSmallContributions;
|
||||
caf::PdmField<double> m_smallContributionsThreshold;
|
||||
caf::PdmField<caf::AppEnum<FlowType>> m_flowType;
|
||||
|
||||
QPointer<RiuWellAllocationPlot> m_wellAllocationPlotWidget;
|
||||
|
||||
caf::PdmChildField<RimWellLogPlot*> m_accumulatedWellFlowPlot;
|
||||
caf::PdmChildField<RimTotalWellAllocationPlot*> m_totalWellAllocationPlot;
|
||||
caf::PdmChildField<RimWellAllocationPlotLegend*> m_wellAllocationPlotLegend;
|
||||
caf::PdmChildField<RimTofAccumulatedPhaseFractionsPlot*> m_tofAccumulatedPhaseFractionsPlot;
|
||||
};
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 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 "RimViewWindow.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
class RigSimWellData;
|
||||
class RimEclipseResultCase;
|
||||
class RimFlowDiagSolution;
|
||||
class RimSimWellInView;
|
||||
class RimTofAccumulatedPhaseFractionsPlot;
|
||||
class RimTotalWellAllocationPlot;
|
||||
class RimWellAllocationPlotLegend;
|
||||
class RimWellLogPlot;
|
||||
class RimWellLogTrack;
|
||||
class RiuWellAllocationPlot;
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class Color3f;
|
||||
}
|
||||
|
||||
namespace caf
|
||||
{
|
||||
class PdmOptionItemInfo;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimWellAllocationPlot : public RimViewWindow
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
enum FlowType
|
||||
{
|
||||
ACCUMULATED,
|
||||
INFLOW
|
||||
};
|
||||
|
||||
public:
|
||||
RimWellAllocationPlot();
|
||||
~RimWellAllocationPlot() override;
|
||||
|
||||
int id() const final;
|
||||
void setFromSimulationWell( RimSimWellInView* simWell );
|
||||
|
||||
void setDescription( const QString& description );
|
||||
QString description() const;
|
||||
|
||||
QWidget* viewWidget() override;
|
||||
void zoomAll() override;
|
||||
|
||||
RimWellLogPlot* accumulatedWellFlowPlot();
|
||||
RimTotalWellAllocationPlot* totalWellFlowPlot();
|
||||
RimTofAccumulatedPhaseFractionsPlot* tofAccumulatedPhaseFractionsPlot();
|
||||
caf::PdmObject* plotLegend();
|
||||
RimEclipseResultCase* rimCase();
|
||||
int timeStep();
|
||||
FlowType flowType();
|
||||
|
||||
QString wellName() const;
|
||||
|
||||
void removeFromMdiAreaAndDeleteViewWidget();
|
||||
|
||||
void showPlotLegend( bool doShow );
|
||||
|
||||
int fontSize() const override;
|
||||
void updateFonts() override;
|
||||
|
||||
protected:
|
||||
// Overridden PDM methods
|
||||
caf::PdmFieldHandle* userDescriptionField() override { return &m_userName; }
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
std::set<QString> findSortedWellNames();
|
||||
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
|
||||
private:
|
||||
void updateFromWell();
|
||||
|
||||
std::map<QString, const std::vector<double>*> findRelevantTracerCellFractions( const RigSimWellData* simWellData );
|
||||
|
||||
void updateWellFlowPlotXAxisTitle( RimWellLogTrack* plotTrack );
|
||||
|
||||
void addStackedCurve( const QString& tracerName,
|
||||
RiaDefines::DepthTypeEnum depthType,
|
||||
const std::vector<double>& depthValues,
|
||||
const std::vector<double>& accFlow,
|
||||
RimWellLogTrack* plotTrack );
|
||||
|
||||
void updateWidgetTitleWindowTitle();
|
||||
static QString wellStatusTextForTimeStep( const QString& wellName,
|
||||
const RimEclipseResultCase* eclipseResultCase,
|
||||
size_t timeStep );
|
||||
|
||||
// RimViewWindow overrides
|
||||
void assignIdIfNecessary() final;
|
||||
|
||||
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
|
||||
void deleteViewWidget() override;
|
||||
|
||||
cvf::Color3f getTracerColor( const QString& tracerName );
|
||||
|
||||
void updateFormationNamesData() const;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showPlotTitle;
|
||||
caf::PdmField<QString> m_userName;
|
||||
|
||||
caf::PdmField<bool> m_branchDetection;
|
||||
|
||||
caf::PdmPtrField<RimEclipseResultCase*> m_case;
|
||||
caf::PdmField<QString> m_wellName;
|
||||
caf::PdmField<int> m_timeStep;
|
||||
caf::PdmPtrField<RimFlowDiagSolution*> m_flowDiagSolution;
|
||||
caf::PdmField<bool> m_groupSmallContributions;
|
||||
caf::PdmField<double> m_smallContributionsThreshold;
|
||||
caf::PdmField<caf::AppEnum<FlowType>> m_flowType;
|
||||
|
||||
QPointer<RiuWellAllocationPlot> m_wellAllocationPlotWidget;
|
||||
|
||||
caf::PdmChildField<RimWellLogPlot*> m_accumulatedWellFlowPlot;
|
||||
caf::PdmChildField<RimTotalWellAllocationPlot*> m_totalWellAllocationPlot;
|
||||
caf::PdmChildField<RimWellAllocationPlotLegend*> m_wellAllocationPlotLegend;
|
||||
caf::PdmChildField<RimTofAccumulatedPhaseFractionsPlot*> m_tofAccumulatedPhaseFractionsPlot;
|
||||
};
|
||||
|
@ -1,62 +1,62 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimWellAllocationPlotLegend.h"
|
||||
#include "RimWellAllocationPlot.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimWellAllocationPlotLegend, "WellAllocationPlotLegend" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellAllocationPlotLegend::RimWellAllocationPlotLegend()
|
||||
{
|
||||
CAF_PDM_InitObject( "Legend", ":/WellAllocLegend16x16.png", "", "" );
|
||||
CAF_PDM_InitField( &m_showLegend, "ShowPlotLegend", true, "Show Plot Legend", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellAllocationPlotLegend::~RimWellAllocationPlotLegend()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimWellAllocationPlotLegend::objectToggleField()
|
||||
{
|
||||
return &m_showLegend;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellAllocationPlotLegend::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
if ( changedField == &m_showLegend )
|
||||
{
|
||||
RimWellAllocationPlot* walp;
|
||||
firstAncestorOrThisOfType( walp );
|
||||
|
||||
if ( walp ) walp->showPlotLegend( m_showLegend() );
|
||||
}
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimWellAllocationPlotLegend.h"
|
||||
#include "RimWellAllocationPlot.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimWellAllocationPlotLegend, "WellAllocationPlotLegend" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellAllocationPlotLegend::RimWellAllocationPlotLegend()
|
||||
{
|
||||
CAF_PDM_InitObject( "Legend", ":/WellAllocLegend16x16.png", "", "" );
|
||||
CAF_PDM_InitField( &m_showLegend, "ShowPlotLegend", true, "Show Plot Legend", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellAllocationPlotLegend::~RimWellAllocationPlotLegend()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimWellAllocationPlotLegend::objectToggleField()
|
||||
{
|
||||
return &m_showLegend;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellAllocationPlotLegend::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
if ( changedField == &m_showLegend )
|
||||
{
|
||||
RimWellAllocationPlot* walp;
|
||||
firstAncestorOrThisOfType( walp );
|
||||
|
||||
if ( walp ) walp->showPlotLegend( m_showLegend() );
|
||||
}
|
||||
}
|
||||
|
@ -1,44 +1,44 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 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 "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
class RimWellAllocationPlotLegend : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimWellAllocationPlotLegend();
|
||||
~RimWellAllocationPlotLegend() override;
|
||||
|
||||
bool isShowingLegend() { return m_showLegend(); }
|
||||
|
||||
protected:
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showLegend;
|
||||
};
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 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 "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
class RimWellAllocationPlotLegend : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimWellAllocationPlotLegend();
|
||||
~RimWellAllocationPlotLegend() override;
|
||||
|
||||
bool isShowingLegend() { return m_showLegend(); }
|
||||
|
||||
protected:
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showLegend;
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,221 +1,221 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimEnsembleCurveSetCollection.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimPlot.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RiuCvfOverlayItemWidget.h"
|
||||
#include "RiuQwtCurvePointTracker.h"
|
||||
#include "RiuQwtPlotWheelZoomer.h"
|
||||
#include "RiuRimQwtPlotCurve.h"
|
||||
#include "RiuWidgetDragger.h"
|
||||
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
#include "RiuQwtPlotTools.h"
|
||||
#include "RiuQwtPlotWheelZoomer.h"
|
||||
#include "RiuQwtPlotZoomer.h"
|
||||
#include "RiuQwtScalePicker.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafCmdFeatureMenuBuilder.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafTitledOverlayFrame.h"
|
||||
|
||||
#include "qwt_date_scale_draw.h"
|
||||
#include "qwt_date_scale_engine.h"
|
||||
#include "qwt_interval.h"
|
||||
#include "qwt_legend.h"
|
||||
#include "qwt_legend_label.h"
|
||||
#include "qwt_plot_curve.h"
|
||||
#include "qwt_plot_panner.h"
|
||||
#include "qwt_plot_zoomer.h"
|
||||
#include "qwt_scale_div.h"
|
||||
#include "qwt_scale_draw.h"
|
||||
#include "qwt_scale_engine.h"
|
||||
|
||||
#include <QEvent>
|
||||
#include <QMenu>
|
||||
#include <QMouseEvent>
|
||||
#include <QWheelEvent>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class EnsembleCurveInfoTextProvider : public IPlotCurveInfoTextProvider
|
||||
{
|
||||
public:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString curveInfoText( QwtPlotCurve* curve ) override
|
||||
{
|
||||
RiuRimQwtPlotCurve* riuCurve = dynamic_cast<RiuRimQwtPlotCurve*>( curve );
|
||||
RimSummaryCurve* sumCurve = nullptr;
|
||||
if ( riuCurve )
|
||||
{
|
||||
sumCurve = dynamic_cast<RimSummaryCurve*>( riuCurve->ownerRimCurve() );
|
||||
}
|
||||
|
||||
return sumCurve && sumCurve->summaryCaseY() ? sumCurve->summaryCaseY()->displayCaseName() : "";
|
||||
}
|
||||
};
|
||||
static EnsembleCurveInfoTextProvider ensembleCurveInfoTextProvider;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuSummaryQwtPlot::RiuSummaryQwtPlot( RimSummaryPlot* plot, QWidget* parent /*= nullptr*/ )
|
||||
: RiuQwtPlotWidget( plot, parent )
|
||||
{
|
||||
// LeftButton for the zooming
|
||||
m_zoomerLeft = new RiuQwtPlotZoomer( canvas() );
|
||||
m_zoomerLeft->setRubberBandPen( QColor( Qt::black ) );
|
||||
m_zoomerLeft->setTrackerMode( QwtPicker::AlwaysOff );
|
||||
m_zoomerLeft->setTrackerPen( QColor( Qt::black ) );
|
||||
m_zoomerLeft->initMousePattern( 1 );
|
||||
|
||||
// Attach a zoomer for the right axis
|
||||
m_zoomerRight = new RiuQwtPlotZoomer( canvas() );
|
||||
m_zoomerRight->setAxis( xTop, yRight );
|
||||
m_zoomerRight->setTrackerMode( QwtPicker::AlwaysOff );
|
||||
m_zoomerRight->initMousePattern( 1 );
|
||||
|
||||
// MidButton for the panning
|
||||
QwtPlotPanner* panner = new QwtPlotPanner( canvas() );
|
||||
panner->setMouseButton( Qt::MidButton );
|
||||
|
||||
m_wheelZoomer = new RiuQwtPlotWheelZoomer( this );
|
||||
|
||||
connect( m_wheelZoomer, SIGNAL( zoomUpdated() ), SLOT( onZoomedSlot() ) );
|
||||
connect( m_zoomerLeft, SIGNAL( zoomed( const QRectF& ) ), SLOT( onZoomedSlot() ) );
|
||||
connect( m_zoomerRight, SIGNAL( zoomed( const QRectF& ) ), SLOT( onZoomedSlot() ) );
|
||||
connect( panner, SIGNAL( panned( int, int ) ), SLOT( onZoomedSlot() ) );
|
||||
|
||||
setDefaults();
|
||||
new RiuQwtCurvePointTracker( this, true, &ensembleCurveInfoTextProvider );
|
||||
|
||||
RiuQwtPlotTools::setCommonPlotBehaviour( this );
|
||||
RiuQwtPlotTools::setDefaultAxes( this );
|
||||
|
||||
setLegendVisible( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuSummaryQwtPlot::~RiuSummaryQwtPlot()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::useDateBasedTimeAxis( const QString& dateFormat,
|
||||
const QString& timeFormat,
|
||||
RiaQDateTimeTools::DateFormatComponents dateComponents,
|
||||
RiaQDateTimeTools::TimeFormatComponents timeComponents )
|
||||
{
|
||||
RiuQwtPlotTools::enableDateBasedBottomXAxis( this, dateFormat, timeFormat, dateComponents, timeComponents );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::useTimeBasedTimeAxis()
|
||||
{
|
||||
setAxisScaleEngine( QwtPlot::xBottom, new QwtLinearScaleEngine() );
|
||||
setAxisScaleDraw( QwtPlot::xBottom, new QwtScaleDraw() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::setAxisIsLogarithmic( QwtPlot::Axis axis, bool logarithmic )
|
||||
{
|
||||
if ( m_wheelZoomer ) m_wheelZoomer->setAxisIsLogarithmic( axis, logarithmic );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::contextMenuEvent( QContextMenuEvent* event )
|
||||
{
|
||||
QMenu menu;
|
||||
caf::CmdFeatureMenuBuilder menuBuilder;
|
||||
|
||||
emit plotSelected( false );
|
||||
|
||||
menuBuilder << "RicShowPlotDataFeature";
|
||||
menuBuilder << "RicSavePlotTemplateFeature";
|
||||
|
||||
menuBuilder.appendToMenu( &menu );
|
||||
|
||||
if ( menu.actions().size() > 0 )
|
||||
{
|
||||
menu.exec( event->globalPos() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::setDefaults()
|
||||
{
|
||||
QString dateFormat = RiaApplication::instance()->preferences()->dateFormat();
|
||||
QString timeFormat = RiaApplication::instance()->preferences()->timeFormat();
|
||||
|
||||
useDateBasedTimeAxis( dateFormat, timeFormat );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiuSummaryQwtPlot::isZoomerActive() const
|
||||
{
|
||||
return m_zoomerLeft->isActiveAndValid() || m_zoomerRight->isActiveAndValid();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::endZoomOperations()
|
||||
{
|
||||
m_zoomerLeft->endZoomOperation();
|
||||
m_zoomerRight->endZoomOperation();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::onZoomedSlot()
|
||||
{
|
||||
emit plotZoomed();
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimEnsembleCurveSetCollection.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimPlot.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCurveCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "RiuCvfOverlayItemWidget.h"
|
||||
#include "RiuQwtCurvePointTracker.h"
|
||||
#include "RiuQwtPlotWheelZoomer.h"
|
||||
#include "RiuRimQwtPlotCurve.h"
|
||||
#include "RiuWidgetDragger.h"
|
||||
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
#include "RiuQwtPlotTools.h"
|
||||
#include "RiuQwtPlotWheelZoomer.h"
|
||||
#include "RiuQwtPlotZoomer.h"
|
||||
#include "RiuQwtScalePicker.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafCmdFeatureMenuBuilder.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafTitledOverlayFrame.h"
|
||||
|
||||
#include "qwt_date_scale_draw.h"
|
||||
#include "qwt_date_scale_engine.h"
|
||||
#include "qwt_interval.h"
|
||||
#include "qwt_legend.h"
|
||||
#include "qwt_legend_label.h"
|
||||
#include "qwt_plot_curve.h"
|
||||
#include "qwt_plot_panner.h"
|
||||
#include "qwt_plot_zoomer.h"
|
||||
#include "qwt_scale_div.h"
|
||||
#include "qwt_scale_draw.h"
|
||||
#include "qwt_scale_engine.h"
|
||||
|
||||
#include <QEvent>
|
||||
#include <QMenu>
|
||||
#include <QMouseEvent>
|
||||
#include <QWheelEvent>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class EnsembleCurveInfoTextProvider : public IPlotCurveInfoTextProvider
|
||||
{
|
||||
public:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString curveInfoText( QwtPlotCurve* curve ) override
|
||||
{
|
||||
RiuRimQwtPlotCurve* riuCurve = dynamic_cast<RiuRimQwtPlotCurve*>( curve );
|
||||
RimSummaryCurve* sumCurve = nullptr;
|
||||
if ( riuCurve )
|
||||
{
|
||||
sumCurve = dynamic_cast<RimSummaryCurve*>( riuCurve->ownerRimCurve() );
|
||||
}
|
||||
|
||||
return sumCurve && sumCurve->summaryCaseY() ? sumCurve->summaryCaseY()->displayCaseName() : "";
|
||||
}
|
||||
};
|
||||
static EnsembleCurveInfoTextProvider ensembleCurveInfoTextProvider;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuSummaryQwtPlot::RiuSummaryQwtPlot( RimSummaryPlot* plot, QWidget* parent /*= nullptr*/ )
|
||||
: RiuQwtPlotWidget( plot, parent )
|
||||
{
|
||||
// LeftButton for the zooming
|
||||
m_zoomerLeft = new RiuQwtPlotZoomer( canvas() );
|
||||
m_zoomerLeft->setRubberBandPen( QColor( Qt::black ) );
|
||||
m_zoomerLeft->setTrackerMode( QwtPicker::AlwaysOff );
|
||||
m_zoomerLeft->setTrackerPen( QColor( Qt::black ) );
|
||||
m_zoomerLeft->initMousePattern( 1 );
|
||||
|
||||
// Attach a zoomer for the right axis
|
||||
m_zoomerRight = new RiuQwtPlotZoomer( canvas() );
|
||||
m_zoomerRight->setAxis( xTop, yRight );
|
||||
m_zoomerRight->setTrackerMode( QwtPicker::AlwaysOff );
|
||||
m_zoomerRight->initMousePattern( 1 );
|
||||
|
||||
// MidButton for the panning
|
||||
QwtPlotPanner* panner = new QwtPlotPanner( canvas() );
|
||||
panner->setMouseButton( Qt::MidButton );
|
||||
|
||||
m_wheelZoomer = new RiuQwtPlotWheelZoomer( this );
|
||||
|
||||
connect( m_wheelZoomer, SIGNAL( zoomUpdated() ), SLOT( onZoomedSlot() ) );
|
||||
connect( m_zoomerLeft, SIGNAL( zoomed( const QRectF& ) ), SLOT( onZoomedSlot() ) );
|
||||
connect( m_zoomerRight, SIGNAL( zoomed( const QRectF& ) ), SLOT( onZoomedSlot() ) );
|
||||
connect( panner, SIGNAL( panned( int, int ) ), SLOT( onZoomedSlot() ) );
|
||||
|
||||
setDefaults();
|
||||
new RiuQwtCurvePointTracker( this, true, &ensembleCurveInfoTextProvider );
|
||||
|
||||
RiuQwtPlotTools::setCommonPlotBehaviour( this );
|
||||
RiuQwtPlotTools::setDefaultAxes( this );
|
||||
|
||||
setLegendVisible( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuSummaryQwtPlot::~RiuSummaryQwtPlot()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::useDateBasedTimeAxis( const QString& dateFormat,
|
||||
const QString& timeFormat,
|
||||
RiaQDateTimeTools::DateFormatComponents dateComponents,
|
||||
RiaQDateTimeTools::TimeFormatComponents timeComponents )
|
||||
{
|
||||
RiuQwtPlotTools::enableDateBasedBottomXAxis( this, dateFormat, timeFormat, dateComponents, timeComponents );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::useTimeBasedTimeAxis()
|
||||
{
|
||||
setAxisScaleEngine( QwtPlot::xBottom, new QwtLinearScaleEngine() );
|
||||
setAxisScaleDraw( QwtPlot::xBottom, new QwtScaleDraw() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::setAxisIsLogarithmic( QwtPlot::Axis axis, bool logarithmic )
|
||||
{
|
||||
if ( m_wheelZoomer ) m_wheelZoomer->setAxisIsLogarithmic( axis, logarithmic );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::contextMenuEvent( QContextMenuEvent* event )
|
||||
{
|
||||
QMenu menu;
|
||||
caf::CmdFeatureMenuBuilder menuBuilder;
|
||||
|
||||
emit plotSelected( false );
|
||||
|
||||
menuBuilder << "RicShowPlotDataFeature";
|
||||
menuBuilder << "RicSavePlotTemplateFeature";
|
||||
|
||||
menuBuilder.appendToMenu( &menu );
|
||||
|
||||
if ( menu.actions().size() > 0 )
|
||||
{
|
||||
menu.exec( event->globalPos() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::setDefaults()
|
||||
{
|
||||
QString dateFormat = RiaApplication::instance()->preferences()->dateFormat();
|
||||
QString timeFormat = RiaApplication::instance()->preferences()->timeFormat();
|
||||
|
||||
useDateBasedTimeAxis( dateFormat, timeFormat );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiuSummaryQwtPlot::isZoomerActive() const
|
||||
{
|
||||
return m_zoomerLeft->isActiveAndValid() || m_zoomerRight->isActiveAndValid();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::endZoomOperations()
|
||||
{
|
||||
m_zoomerLeft->endZoomOperation();
|
||||
m_zoomerRight->endZoomOperation();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::onZoomedSlot()
|
||||
{
|
||||
emit plotZoomed();
|
||||
}
|
||||
|
@ -1,73 +1,73 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RiaQDateTimeTools.h"
|
||||
#include "RiuInterfaceToViewWindow.h"
|
||||
#include "RiuQwtPlotWidget.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
class RimEnsembleParameterColorHandlerInterface;
|
||||
class RimSummaryPlot;
|
||||
class RiuCvfOverlayItemWidget;
|
||||
class RiuQwtPlotZoomer;
|
||||
class RiuQwtPlotWheelZoomer;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiuSummaryQwtPlot : public RiuQwtPlotWidget
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
RiuSummaryQwtPlot( RimSummaryPlot* plot, QWidget* parent = nullptr );
|
||||
~RiuSummaryQwtPlot() override;
|
||||
|
||||
void useDateBasedTimeAxis( const QString& dateFormat,
|
||||
const QString& timeFormat,
|
||||
RiaQDateTimeTools::DateFormatComponents dateComponents = RiaQDateTimeTools::DATE_FORMAT_UNSPECIFIED,
|
||||
RiaQDateTimeTools::TimeFormatComponents timeComponents =
|
||||
RiaQDateTimeTools::TimeFormatComponents::TIME_FORMAT_UNSPECIFIED );
|
||||
|
||||
void useTimeBasedTimeAxis();
|
||||
void setAxisIsLogarithmic( QwtPlot::Axis axis, bool logarithmic );
|
||||
|
||||
signals:
|
||||
void plotZoomed();
|
||||
|
||||
protected:
|
||||
void contextMenuEvent( QContextMenuEvent* ) override;
|
||||
void setDefaults();
|
||||
bool isZoomerActive() const override;
|
||||
void endZoomOperations() override;
|
||||
|
||||
private slots:
|
||||
void onZoomedSlot();
|
||||
|
||||
private:
|
||||
QPointer<RiuQwtPlotZoomer> m_zoomerLeft;
|
||||
QPointer<RiuQwtPlotZoomer> m_zoomerRight;
|
||||
QPointer<RiuQwtPlotWheelZoomer> m_wheelZoomer;
|
||||
};
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RiaQDateTimeTools.h"
|
||||
#include "RiuInterfaceToViewWindow.h"
|
||||
#include "RiuQwtPlotWidget.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
class RimEnsembleParameterColorHandlerInterface;
|
||||
class RimSummaryPlot;
|
||||
class RiuCvfOverlayItemWidget;
|
||||
class RiuQwtPlotZoomer;
|
||||
class RiuQwtPlotWheelZoomer;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiuSummaryQwtPlot : public RiuQwtPlotWidget
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
RiuSummaryQwtPlot( RimSummaryPlot* plot, QWidget* parent = nullptr );
|
||||
~RiuSummaryQwtPlot() override;
|
||||
|
||||
void useDateBasedTimeAxis( const QString& dateFormat,
|
||||
const QString& timeFormat,
|
||||
RiaQDateTimeTools::DateFormatComponents dateComponents = RiaQDateTimeTools::DATE_FORMAT_UNSPECIFIED,
|
||||
RiaQDateTimeTools::TimeFormatComponents timeComponents =
|
||||
RiaQDateTimeTools::TimeFormatComponents::TIME_FORMAT_UNSPECIFIED );
|
||||
|
||||
void useTimeBasedTimeAxis();
|
||||
void setAxisIsLogarithmic( QwtPlot::Axis axis, bool logarithmic );
|
||||
|
||||
signals:
|
||||
void plotZoomed();
|
||||
|
||||
protected:
|
||||
void contextMenuEvent( QContextMenuEvent* ) override;
|
||||
void setDefaults();
|
||||
bool isZoomerActive() const override;
|
||||
void endZoomOperations() override;
|
||||
|
||||
private slots:
|
||||
void onZoomedSlot();
|
||||
|
||||
private:
|
||||
QPointer<RiuQwtPlotZoomer> m_zoomerLeft;
|
||||
QPointer<RiuQwtPlotZoomer> m_zoomerRight;
|
||||
QPointer<RiuQwtPlotWheelZoomer> m_wheelZoomer;
|
||||
};
|
||||
|
@ -1,211 +1,211 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiuWellAllocationPlot.h"
|
||||
|
||||
#include "RimContextCommandBuilder.h"
|
||||
#include "RimTofAccumulatedPhaseFractionsPlot.h"
|
||||
#include "RimTotalWellAllocationPlot.h"
|
||||
#include "RimWellAllocationPlot.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
|
||||
#include "RiuContextMenuLauncher.h"
|
||||
#include "RiuNightchartsWidget.h"
|
||||
#include "RiuPlotObjectPicker.h"
|
||||
|
||||
#include "cvfColor3.h"
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QContextMenuEvent>
|
||||
#include <QLabel>
|
||||
#include <QMenu>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuWellAllocationPlot::RiuWellAllocationPlot( RimWellAllocationPlot* plotDefinition, QWidget* parent )
|
||||
: QFrame( parent )
|
||||
, m_plotDefinition( plotDefinition )
|
||||
{
|
||||
Q_ASSERT( m_plotDefinition );
|
||||
|
||||
QVBoxLayout* mainLayout = new QVBoxLayout();
|
||||
this->setLayout( mainLayout );
|
||||
this->layout()->setMargin( 0 );
|
||||
this->layout()->setSpacing( 2 );
|
||||
|
||||
m_titleLabel = new QLabel( this );
|
||||
new RiuPlotObjectPicker( m_titleLabel, m_plotDefinition->accumulatedWellFlowPlot() );
|
||||
|
||||
QFont font = m_titleLabel->font();
|
||||
font.setPointSize( 14 );
|
||||
font.setBold( true );
|
||||
m_titleLabel->setFont( font );
|
||||
|
||||
// White background
|
||||
QPalette pal = this->palette();
|
||||
pal.setColor( QPalette::Window, Qt::white );
|
||||
this->setAutoFillBackground( true );
|
||||
this->setPalette( pal );
|
||||
|
||||
mainLayout->addWidget( m_titleLabel, 0, Qt::AlignCenter );
|
||||
|
||||
auto plotWidgetsLayout = new QHBoxLayout();
|
||||
auto leftColumnLayout = new QVBoxLayout();
|
||||
|
||||
mainLayout->addLayout( plotWidgetsLayout );
|
||||
plotWidgetsLayout->addLayout( leftColumnLayout );
|
||||
|
||||
m_legendWidget = new RiuNightchartsWidget( this );
|
||||
new RiuPlotObjectPicker( m_legendWidget, m_plotDefinition->plotLegend() );
|
||||
|
||||
caf::CmdFeatureMenuBuilder menuBuilder;
|
||||
menuBuilder << "RicShowTotalAllocationDataFeature";
|
||||
new RiuContextMenuLauncher( m_legendWidget, menuBuilder );
|
||||
|
||||
leftColumnLayout->addWidget( m_legendWidget );
|
||||
m_legendWidget->showPie( false );
|
||||
|
||||
QWidget* totalFlowAllocationWidget = m_plotDefinition->totalWellFlowPlot()->createViewWidget( this );
|
||||
new RiuPlotObjectPicker( totalFlowAllocationWidget, m_plotDefinition->totalWellFlowPlot() );
|
||||
new RiuContextMenuLauncher( totalFlowAllocationWidget, menuBuilder );
|
||||
|
||||
leftColumnLayout->addWidget( totalFlowAllocationWidget, Qt::AlignTop );
|
||||
leftColumnLayout->addWidget( m_plotDefinition->tofAccumulatedPhaseFractionsPlot()->createViewWidget( this ),
|
||||
Qt::AlignTop );
|
||||
leftColumnLayout->addStretch();
|
||||
|
||||
QWidget* wellFlowWidget = m_plotDefinition->accumulatedWellFlowPlot()->createPlotWidget();
|
||||
|
||||
plotWidgetsLayout->addWidget( wellFlowWidget );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuWellAllocationPlot::~RiuWellAllocationPlot()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellAllocationPlot* RiuWellAllocationPlot::ownerPlotDefinition()
|
||||
{
|
||||
return m_plotDefinition;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewWindow* RiuWellAllocationPlot::ownerViewWindow() const
|
||||
{
|
||||
return m_plotDefinition;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::showTitle( const QString& title )
|
||||
{
|
||||
m_titleLabel->show();
|
||||
|
||||
m_titleLabel->setText( title );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::hideTitle()
|
||||
{
|
||||
m_titleLabel->hide();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::showLegend( bool doShow )
|
||||
{
|
||||
if ( doShow )
|
||||
m_legendWidget->show();
|
||||
else
|
||||
m_legendWidget->hide();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::addLegendItem( const QString& name, const cvf::Color3f& color, float value )
|
||||
{
|
||||
QColor sliceColor( color.rByte(), color.gByte(), color.bByte() );
|
||||
|
||||
m_legendWidget->addItem( name, sliceColor, value );
|
||||
m_legendWidget->updateGeometry();
|
||||
m_legendWidget->update();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::clearLegend()
|
||||
{
|
||||
m_legendWidget->clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QSize RiuWellAllocationPlot::minimumSizeHint() const
|
||||
{
|
||||
return QSize( 0, 100 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::contextMenuEvent( QContextMenuEvent* event )
|
||||
{
|
||||
QMenu menu;
|
||||
caf::CmdFeatureMenuBuilder menuBuilder;
|
||||
|
||||
menuBuilder << "RicShowContributingWellsFromPlotFeature";
|
||||
menuBuilder << "RicShowCumulativePhasePlotFeature";
|
||||
|
||||
menuBuilder.appendToMenu( &menu );
|
||||
|
||||
if ( menu.actions().size() > 0 )
|
||||
{
|
||||
menu.exec( event->globalPos() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QSize RiuWellAllocationPlot::sizeHint() const
|
||||
{
|
||||
return QSize( 0, 0 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::setDefaults()
|
||||
{
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiuWellAllocationPlot.h"
|
||||
|
||||
#include "RimContextCommandBuilder.h"
|
||||
#include "RimTofAccumulatedPhaseFractionsPlot.h"
|
||||
#include "RimTotalWellAllocationPlot.h"
|
||||
#include "RimWellAllocationPlot.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
|
||||
#include "RiuContextMenuLauncher.h"
|
||||
#include "RiuNightchartsWidget.h"
|
||||
#include "RiuPlotObjectPicker.h"
|
||||
|
||||
#include "cvfColor3.h"
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QContextMenuEvent>
|
||||
#include <QLabel>
|
||||
#include <QMenu>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuWellAllocationPlot::RiuWellAllocationPlot( RimWellAllocationPlot* plotDefinition, QWidget* parent )
|
||||
: QFrame( parent )
|
||||
, m_plotDefinition( plotDefinition )
|
||||
{
|
||||
Q_ASSERT( m_plotDefinition );
|
||||
|
||||
QVBoxLayout* mainLayout = new QVBoxLayout();
|
||||
this->setLayout( mainLayout );
|
||||
this->layout()->setMargin( 0 );
|
||||
this->layout()->setSpacing( 2 );
|
||||
|
||||
m_titleLabel = new QLabel( this );
|
||||
new RiuPlotObjectPicker( m_titleLabel, m_plotDefinition->accumulatedWellFlowPlot() );
|
||||
|
||||
QFont font = m_titleLabel->font();
|
||||
font.setPointSize( 14 );
|
||||
font.setBold( true );
|
||||
m_titleLabel->setFont( font );
|
||||
|
||||
// White background
|
||||
QPalette pal = this->palette();
|
||||
pal.setColor( QPalette::Window, Qt::white );
|
||||
this->setAutoFillBackground( true );
|
||||
this->setPalette( pal );
|
||||
|
||||
mainLayout->addWidget( m_titleLabel, 0, Qt::AlignCenter );
|
||||
|
||||
auto plotWidgetsLayout = new QHBoxLayout();
|
||||
auto leftColumnLayout = new QVBoxLayout();
|
||||
|
||||
mainLayout->addLayout( plotWidgetsLayout );
|
||||
plotWidgetsLayout->addLayout( leftColumnLayout );
|
||||
|
||||
m_legendWidget = new RiuNightchartsWidget( this );
|
||||
new RiuPlotObjectPicker( m_legendWidget, m_plotDefinition->plotLegend() );
|
||||
|
||||
caf::CmdFeatureMenuBuilder menuBuilder;
|
||||
menuBuilder << "RicShowTotalAllocationDataFeature";
|
||||
new RiuContextMenuLauncher( m_legendWidget, menuBuilder );
|
||||
|
||||
leftColumnLayout->addWidget( m_legendWidget );
|
||||
m_legendWidget->showPie( false );
|
||||
|
||||
QWidget* totalFlowAllocationWidget = m_plotDefinition->totalWellFlowPlot()->createViewWidget( this );
|
||||
new RiuPlotObjectPicker( totalFlowAllocationWidget, m_plotDefinition->totalWellFlowPlot() );
|
||||
new RiuContextMenuLauncher( totalFlowAllocationWidget, menuBuilder );
|
||||
|
||||
leftColumnLayout->addWidget( totalFlowAllocationWidget, Qt::AlignTop );
|
||||
leftColumnLayout->addWidget( m_plotDefinition->tofAccumulatedPhaseFractionsPlot()->createViewWidget( this ),
|
||||
Qt::AlignTop );
|
||||
leftColumnLayout->addStretch();
|
||||
|
||||
QWidget* wellFlowWidget = m_plotDefinition->accumulatedWellFlowPlot()->createPlotWidget();
|
||||
|
||||
plotWidgetsLayout->addWidget( wellFlowWidget );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuWellAllocationPlot::~RiuWellAllocationPlot()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellAllocationPlot* RiuWellAllocationPlot::ownerPlotDefinition()
|
||||
{
|
||||
return m_plotDefinition;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimViewWindow* RiuWellAllocationPlot::ownerViewWindow() const
|
||||
{
|
||||
return m_plotDefinition;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::showTitle( const QString& title )
|
||||
{
|
||||
m_titleLabel->show();
|
||||
|
||||
m_titleLabel->setText( title );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::hideTitle()
|
||||
{
|
||||
m_titleLabel->hide();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::showLegend( bool doShow )
|
||||
{
|
||||
if ( doShow )
|
||||
m_legendWidget->show();
|
||||
else
|
||||
m_legendWidget->hide();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::addLegendItem( const QString& name, const cvf::Color3f& color, float value )
|
||||
{
|
||||
QColor sliceColor( color.rByte(), color.gByte(), color.bByte() );
|
||||
|
||||
m_legendWidget->addItem( name, sliceColor, value );
|
||||
m_legendWidget->updateGeometry();
|
||||
m_legendWidget->update();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::clearLegend()
|
||||
{
|
||||
m_legendWidget->clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QSize RiuWellAllocationPlot::minimumSizeHint() const
|
||||
{
|
||||
return QSize( 0, 100 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::contextMenuEvent( QContextMenuEvent* event )
|
||||
{
|
||||
QMenu menu;
|
||||
caf::CmdFeatureMenuBuilder menuBuilder;
|
||||
|
||||
menuBuilder << "RicShowContributingWellsFromPlotFeature";
|
||||
menuBuilder << "RicShowCumulativePhasePlotFeature";
|
||||
|
||||
menuBuilder.appendToMenu( &menu );
|
||||
|
||||
if ( menu.actions().size() > 0 )
|
||||
{
|
||||
menu.exec( event->globalPos() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QSize RiuWellAllocationPlot::sizeHint() const
|
||||
{
|
||||
return QSize( 0, 0 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellAllocationPlot::setDefaults()
|
||||
{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user