Improve annotations to work in both vertical and horizontal plots (#9154)

* Move enums to RiaPlotDefines.h
* Add support for formation names shading in horizontal plots
* Refactor line property code
* modernize code
This commit is contained in:
Magne Sjaastad
2022-08-05 13:14:58 +02:00
committed by GitHub
parent 824d5bd458
commit f102a8b249
16 changed files with 308 additions and 307 deletions

View File

@@ -149,12 +149,11 @@ void RiuSummaryQwtPlot::useTimeBasedTimeAxis()
//--------------------------------------------------------------------------------------------------
void RiuSummaryQwtPlot::updateAnnotationObjects( RimPlotAxisPropertiesInterface* axisProperties )
{
RiuPlotAnnotationTool::Orientation orientation = RiuPlotAnnotationTool::Orientation::HORIZONTAL;
RiaDefines::Orientation orientation = RiaDefines::Orientation::HORIZONTAL;
if ( axisProperties->plotAxisType().axis() == RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM )
{
orientation = RiuPlotAnnotationTool::Orientation::VERTICAL;
orientation = RiaDefines::Orientation::VERTICAL;
}
m_annotationTool->detachAllAnnotations( orientation );
for ( auto annotation : axisProperties->annotations() )
{
@@ -221,3 +220,11 @@ RiuPlotWidget* RiuSummaryQwtPlot::plotWidget() const
{
return m_plotWidget;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuSummaryQwtPlot::clearAnnotationObjects()
{
m_annotationTool->detachAllAnnotations();
}