mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #8387 from OPM/qtcharts-summary-plots
Closes #8228 Major refactoring of summary plotting. Now possible to create plots both with Qwt and QtChart as plotting tool.
This commit is contained in:
committed by
GitHub
parent
d9bb82de91
commit
258fbddc10
@@ -20,6 +20,7 @@
|
||||
#include "RimWellLogCurve.h"
|
||||
|
||||
#include "RiaCurveDataTools.h"
|
||||
#include "RiaPlotDefines.h"
|
||||
#include "RigWellLogCurveData.h"
|
||||
|
||||
#include "RimDepthTrackPlot.h"
|
||||
@@ -46,10 +47,6 @@ RimWellLogCurve::RimWellLogCurve()
|
||||
{
|
||||
CAF_PDM_InitObject( "WellLogCurve", ":/WellLogCurve16x16.png" );
|
||||
|
||||
m_qwtPlotCurve->setXAxis( QwtPlot::xTop );
|
||||
m_qwtCurveErrorBars->setXAxis( QwtPlot::xTop );
|
||||
m_qwtPlotCurve->setYAxis( QwtPlot::yLeft );
|
||||
|
||||
m_curveData = new RigWellLogCurveData;
|
||||
|
||||
m_curveDataXRange = std::make_pair( std::numeric_limits<double>::infinity(), -std::numeric_limits<double>::infinity() );
|
||||
@@ -179,11 +176,22 @@ const RigWellLogCurveData* RimWellLogCurve::curveData() const
|
||||
void RimWellLogCurve::updateCurveAppearance()
|
||||
{
|
||||
RimPlotCurve::updateCurveAppearance();
|
||||
|
||||
if ( m_plotCurve )
|
||||
{
|
||||
m_plotCurve->setXAxis( RiaDefines::PlotAxis::PLOT_AXIS_TOP );
|
||||
m_plotCurve->setYAxis( RiaDefines::PlotAxis::PLOT_AXIS_LEFT );
|
||||
}
|
||||
|
||||
if ( fillStyle() != Qt::BrushStyle::NoBrush )
|
||||
{
|
||||
m_qwtPlotCurve->setOrientation( Qt::Horizontal );
|
||||
m_qwtPlotCurve->setBaseline( -std::numeric_limits<double>::infinity() );
|
||||
m_qwtPlotCurve->setCurveAttribute( QwtPlotCurve::Inverted, true );
|
||||
RiuQwtPlotCurve* qwtPlotCurve = dynamic_cast<RiuQwtPlotCurve*>( m_plotCurve );
|
||||
if ( qwtPlotCurve )
|
||||
{
|
||||
qwtPlotCurve->setOrientation( Qt::Horizontal );
|
||||
qwtPlotCurve->setBaseline( -std::numeric_limits<double>::infinity() );
|
||||
qwtPlotCurve->setCurveAttribute( QwtPlotCurve::Inverted, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,10 +220,10 @@ void RimWellLogCurve::setOverrideCurveData( const std::vector<double>&
|
||||
{
|
||||
auto minmax_it = std::minmax_element( xValues.begin(), xValues.end() );
|
||||
this->setOverrideCurveDataXRange( *( minmax_it.first ), *( minmax_it.second ) );
|
||||
if ( m_qwtPlotCurve )
|
||||
if ( m_plotCurve )
|
||||
{
|
||||
m_qwtPlotCurve->setSamples( xValues.data(), depthValues.data(), static_cast<int>( depthValues.size() ) );
|
||||
m_qwtPlotCurve->setLineSegmentStartStopIndices( curveIntervals );
|
||||
m_plotCurve->setSamplesValues( xValues, depthValues );
|
||||
m_plotCurve->setLineSegmentStartStopIndices( curveIntervals );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user