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:
Kristian Bendiksen
2022-01-17 13:14:21 +01:00
committed by GitHub
parent d9bb82de91
commit 258fbddc10
145 changed files with 7245 additions and 2932 deletions

View File

@@ -136,7 +136,7 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot )
if ( m_isUsingAutoName )
{
m_qwtPlotCurve->setTitle( createCurveAutoName() );
m_plotCurve->setTitle( createCurveAutoName() );
}
setSymbol( getSymbolForMeasurementKind( m_measurementKind() ) );
@@ -156,10 +156,10 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot )
depthType = wellLogPlot->depthType();
}
m_qwtPlotCurve->setSamples( this->curveData()->xPlotValues().data(),
this->curveData()->depthPlotValues( depthType, displayUnit ).data(),
static_cast<int>( this->curveData()->xPlotValues().size() ) );
m_qwtPlotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
m_plotCurve->setSamplesFromXValuesAndYValues( this->curveData()->xPlotValues(),
this->curveData()->depthPlotValues( depthType, displayUnit ),
static_cast<int>( this->curveData()->xPlotValues().size() ) );
m_plotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
}
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
@@ -169,9 +169,9 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot )
updateZoomInParentPlot();
}
if ( m_parentQwtPlot )
if ( m_parentPlot )
{
m_parentQwtPlot->replot();
m_parentPlot->replot();
}
}
@@ -205,7 +205,7 @@ void RimWellMeasurementCurve::fieldChangedByUi( const caf::PdmFieldHandle* chang
this->loadDataAndUpdate( true );
}
if ( m_parentQwtPlot ) m_parentQwtPlot->replot();
if ( m_parentPlot ) m_parentPlot->replot();
}
//--------------------------------------------------------------------------------------------------
@@ -350,25 +350,25 @@ void RimWellMeasurementCurve::setMeasurementKind( const QString& measurementKind
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuQwtSymbol::PointSymbolEnum RimWellMeasurementCurve::getSymbolForMeasurementKind( const QString& measurementKind )
RiuPlotCurveSymbol::PointSymbolEnum RimWellMeasurementCurve::getSymbolForMeasurementKind( const QString& measurementKind )
{
std::map<QString, RiuQwtSymbol::PointSymbolEnum> symbolTable;
symbolTable["XLOT"] = RiuQwtSymbol::SYMBOL_RECT;
symbolTable["LOT"] = RiuQwtSymbol::SYMBOL_TRIANGLE;
symbolTable["FIT"] = RiuQwtSymbol::SYMBOL_DIAMOND;
symbolTable["MCF"] = RiuQwtSymbol::SYMBOL_ELLIPSE;
symbolTable["MNF"] = RiuQwtSymbol::SYMBOL_ELLIPSE;
symbolTable["TH"] = RiuQwtSymbol::SYMBOL_STAR1;
symbolTable["LE"] = RiuQwtSymbol::SYMBOL_STAR2;
symbolTable["BA"] = RiuQwtSymbol::SYMBOL_STAR1;
symbolTable["CORE"] = RiuQwtSymbol::SYMBOL_RECT;
symbolTable["PPG"] = RiuQwtSymbol::SYMBOL_RECT;
std::map<QString, RiuPlotCurveSymbol::PointSymbolEnum> symbolTable;
symbolTable["XLOT"] = RiuPlotCurveSymbol::SYMBOL_RECT;
symbolTable["LOT"] = RiuPlotCurveSymbol::SYMBOL_TRIANGLE;
symbolTable["FIT"] = RiuPlotCurveSymbol::SYMBOL_DIAMOND;
symbolTable["MCF"] = RiuPlotCurveSymbol::SYMBOL_ELLIPSE;
symbolTable["MNF"] = RiuPlotCurveSymbol::SYMBOL_ELLIPSE;
symbolTable["TH"] = RiuPlotCurveSymbol::SYMBOL_STAR1;
symbolTable["LE"] = RiuPlotCurveSymbol::SYMBOL_STAR2;
symbolTable["BA"] = RiuPlotCurveSymbol::SYMBOL_STAR1;
symbolTable["CORE"] = RiuPlotCurveSymbol::SYMBOL_RECT;
symbolTable["PPG"] = RiuPlotCurveSymbol::SYMBOL_RECT;
auto it = symbolTable.find( measurementKind );
if ( it != symbolTable.end() )
return it->second;
else
return RiuQwtSymbol::SYMBOL_CROSS;
return RiuPlotCurveSymbol::SYMBOL_CROSS;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -63,8 +63,8 @@ protected:
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
RiuQwtSymbol::PointSymbolEnum getSymbolForMeasurementKind( const QString& measurementKind );
cvf::Color3f getColorForMeasurementKind( const QString& measurementKind );
RiuPlotCurveSymbol::PointSymbolEnum getSymbolForMeasurementKind( const QString& measurementKind );
cvf::Color3f getColorForMeasurementKind( const QString& measurementKind );
protected:
caf::PdmPtrField<RimWellPath*> m_wellPath;