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

@@ -31,6 +31,34 @@ enum class PlotAxis
PLOT_AXIS_TOP PLOT_AXIS_TOP
}; };
enum class RegionAnnotationType
{
NO_ANNOTATIONS = 0,
FORMATION_ANNOTATIONS = 1,
// Used to have Wbs-parameter coding as 2
RESULT_PROPERTY_ANNOTATIONS = 3
};
enum RegionDisplay
{
DARK_LINES = 0x01,
COLORED_LINES = 0x02,
COLOR_SHADING = 0x04,
COLOR_SHADING_AND_LINES = 0x05,
LIGHT_LINES = 0x08,
};
enum class TrackSpan
{
FULL_WIDTH,
LEFT_COLUMN,
CENTRE_COLUMN,
RIGHT_COLUMN
};
enum class Orientation
{
HORIZONTAL = 0,
VERTICAL
};
double minimumDefaultValuePlot(); double minimumDefaultValuePlot();
double minimumDefaultLogValuePlot(); double minimumDefaultLogValuePlot();
double maximumDefaultValuePlot(); double maximumDefaultValuePlot();

View File

@@ -223,7 +223,7 @@ void RicNewStimPlanModelPlotFeature::createFormationTrack( RimStimPlanModelPlot*
RimWellLogTrack* formationTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, "Formations", plot ); RimWellLogTrack* formationTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, "Formations", plot );
formationTrack->setFormationWellPath( stimPlanModel->thicknessDirectionWellPath() ); formationTrack->setFormationWellPath( stimPlanModel->thicknessDirectionWellPath() );
formationTrack->setFormationCase( eclipseCase ); formationTrack->setFormationCase( eclipseCase );
formationTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ); formationTrack->setAnnotationType( RiaDefines::RegionAnnotationType::FORMATION_ANNOTATIONS );
formationTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AxisGridVisibility::AXIS_GRID_NONE ); formationTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AxisGridVisibility::AXIS_GRID_NONE );
formationTrack->setShowWellPathAttributes( true ); formationTrack->setShowWellPathAttributes( true );
formationTrack->setShowBothSidesOfWell( false ); formationTrack->setShowBothSidesOfWell( false );
@@ -255,9 +255,9 @@ void RicNewStimPlanModelPlotFeature::createFaciesTrack( RimStimPlanModelPlot* pl
RimWellLogTrack* faciesTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, "Facies", plot ); RimWellLogTrack* faciesTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, "Facies", plot );
faciesTrack->setFormationWellPath( stimPlanModel->thicknessDirectionWellPath() ); faciesTrack->setFormationWellPath( stimPlanModel->thicknessDirectionWellPath() );
faciesTrack->setFormationCase( eclipseCase ); faciesTrack->setFormationCase( eclipseCase );
faciesTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS ); faciesTrack->setAnnotationType( RiaDefines::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS );
faciesTrack->setRegionPropertyResultType( faciesDefinition->resultType(), faciesDefinition->resultVariable() ); faciesTrack->setRegionPropertyResultType( faciesDefinition->resultType(), faciesDefinition->resultVariable() );
faciesTrack->setAnnotationDisplay( RiuPlotAnnotationTool::COLOR_SHADING ); faciesTrack->setAnnotationDisplay( RiaDefines::COLOR_SHADING );
faciesTrack->setOverburdenHeight( stimPlanModel->overburdenHeight() ); faciesTrack->setOverburdenHeight( stimPlanModel->overburdenHeight() );
faciesTrack->setUnderburdenHeight( stimPlanModel->underburdenHeight() ); faciesTrack->setUnderburdenHeight( stimPlanModel->underburdenHeight() );
faciesTrack->setPropertyValueAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::FACIES ) ); faciesTrack->setPropertyValueAxisTitle( stimPlanModel->unitForProperty( RiaDefines::CurveProperty::FACIES ) );

View File

@@ -20,6 +20,7 @@
#include "RiaColorTables.h" #include "RiaColorTables.h"
#include "RiaLogging.h" #include "RiaLogging.h"
#include "RiaPlotDefines.h"
#include "RiaResultNames.h" #include "RiaResultNames.h"
#include "RicNewWellLogCurveExtractionFeature.h" #include "RicNewWellLogCurveExtractionFeature.h"
@@ -219,7 +220,7 @@ void RicNewWellBoreStabilityPlotFeature::createFormationTrack( RimWellBoreStabil
RimWellLogTrack* formationTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, "Formations", plot ); RimWellLogTrack* formationTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, "Formations", plot );
formationTrack->setFormationWellPath( wellPath ); formationTrack->setFormationWellPath( wellPath );
formationTrack->setFormationCase( geoMechCase ); formationTrack->setFormationCase( geoMechCase );
formationTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ); formationTrack->setAnnotationType( RiaDefines::RegionAnnotationType::FORMATION_ANNOTATIONS );
formationTrack->setVisiblePropertyValueRange( 0.0, 0.0 ); formationTrack->setVisiblePropertyValueRange( 0.0, 0.0 );
formationTrack->setColSpan( RimPlot::ONE ); formationTrack->setColSpan( RimPlot::ONE );
} }
@@ -235,8 +236,8 @@ void RicNewWellBoreStabilityPlotFeature::createCasingShoeTrack( RimWellBoreStabi
casingShoeTrack->setColSpan( RimPlot::ONE ); casingShoeTrack->setColSpan( RimPlot::ONE );
casingShoeTrack->setFormationWellPath( wellPath ); casingShoeTrack->setFormationWellPath( wellPath );
casingShoeTrack->setFormationCase( geoMechCase ); casingShoeTrack->setFormationCase( geoMechCase );
casingShoeTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ); casingShoeTrack->setAnnotationType( RiaDefines::RegionAnnotationType::FORMATION_ANNOTATIONS );
casingShoeTrack->setAnnotationDisplay( RiuPlotAnnotationTool::COLOR_SHADING_AND_LINES ); casingShoeTrack->setAnnotationDisplay( RiaDefines::COLOR_SHADING_AND_LINES );
casingShoeTrack->setShowRegionLabels( false ); casingShoeTrack->setShowRegionLabels( false );
casingShoeTrack->setShowWellPathAttributes( true ); casingShoeTrack->setShowWellPathAttributes( true );
casingShoeTrack->setShowBothSidesOfWell( false ); casingShoeTrack->setShowBothSidesOfWell( false );
@@ -312,8 +313,8 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
stabilityCurvesTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR ); stabilityCurvesTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
stabilityCurvesTrack->setFormationWellPath( wellPath ); stabilityCurvesTrack->setFormationWellPath( wellPath );
stabilityCurvesTrack->setFormationCase( geoMechCase ); stabilityCurvesTrack->setFormationCase( geoMechCase );
stabilityCurvesTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ); stabilityCurvesTrack->setAnnotationType( RiaDefines::RegionAnnotationType::FORMATION_ANNOTATIONS );
stabilityCurvesTrack->setAnnotationDisplay( RiuPlotAnnotationTool::LIGHT_LINES ); stabilityCurvesTrack->setAnnotationDisplay( RiaDefines::LIGHT_LINES );
stabilityCurvesTrack->setShowRegionLabels( false ); stabilityCurvesTrack->setShowRegionLabels( false );
std::vector<QString> resultNames = RiaResultNames::wbsDerivedResultNames(); std::vector<QString> resultNames = RiaResultNames::wbsDerivedResultNames();
@@ -431,7 +432,7 @@ void RicNewWellBoreStabilityPlotFeature::createAnglesTrack( RimWellBoreStability
wellPathAnglesTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR ); wellPathAnglesTrack->setPropertyValueAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
wellPathAnglesTrack->setFormationWellPath( wellPath ); wellPathAnglesTrack->setFormationWellPath( wellPath );
wellPathAnglesTrack->setFormationCase( geoMechCase ); wellPathAnglesTrack->setFormationCase( geoMechCase );
wellPathAnglesTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ); wellPathAnglesTrack->setAnnotationType( RiaDefines::RegionAnnotationType::FORMATION_ANNOTATIONS );
wellPathAnglesTrack->setAnnotationDisplay( RiuPlotAnnotationTool::LIGHT_LINES ); wellPathAnglesTrack->setAnnotationDisplay( RiaDefines::LIGHT_LINES );
wellPathAnglesTrack->setShowRegionLabels( false ); wellPathAnglesTrack->setShowRegionLabels( false );
} }

View File

@@ -20,6 +20,7 @@
#include "RiaDateStringParser.h" #include "RiaDateStringParser.h"
#include "RiaLogging.h" #include "RiaLogging.h"
#include "RiaPlotDefines.h"
#include "RiaQDateTimeTools.h" #include "RiaQDateTimeTools.h"
#include "RiaWellNameComparer.h" #include "RiaWellNameComparer.h"
@@ -1096,7 +1097,7 @@ void RimWellPltPlot::onLoadDataAndUpdate()
RimWellLogTrack* const plotTrack = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) ); RimWellLogTrack* const plotTrack = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) );
if ( plotTrack ) if ( plotTrack )
{ {
plotTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ); plotTrack->setAnnotationType( RiaDefines::RegionAnnotationType::FORMATION_ANNOTATIONS );
} }
} }
m_isOnLoad = false; m_isOnLoad = false;

View File

@@ -21,6 +21,7 @@
#include "RiaColorTables.h" #include "RiaColorTables.h"
#include "RiaColorTools.h" #include "RiaColorTools.h"
#include "RiaDateStringParser.h" #include "RiaDateStringParser.h"
#include "RiaPlotDefines.h"
#include "RiaSimWellBranchTools.h" #include "RiaSimWellBranchTools.h"
#include "RifReaderEclipseRft.h" #include "RifReaderEclipseRft.h"
@@ -1058,7 +1059,7 @@ void RimWellRftPlot::onLoadDataAndUpdate()
RimWellLogTrack* const plotTrack = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) ); RimWellLogTrack* const plotTrack = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) );
if ( plotTrack ) if ( plotTrack )
{ {
plotTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ); plotTrack->setAnnotationType( RiaDefines::RegionAnnotationType::FORMATION_ANNOTATIONS );
} }
} }

View File

@@ -217,6 +217,8 @@ void RimSummaryPlot::updateAxes()
updateAxis( RiaDefines::PlotAxis::PLOT_AXIS_LEFT ); updateAxis( RiaDefines::PlotAxis::PLOT_AXIS_LEFT );
updateAxis( RiaDefines::PlotAxis::PLOT_AXIS_RIGHT ); updateAxis( RiaDefines::PlotAxis::PLOT_AXIS_RIGHT );
m_summaryPlot->clearAnnotationObjects();
if ( timeAxisProperties() && plotWidget() ) if ( timeAxisProperties() && plotWidget() )
{ {
m_summaryPlot->updateAnnotationObjects( timeAxisProperties() ); m_summaryPlot->updateAnnotationObjects( timeAxisProperties() );

View File

@@ -149,23 +149,23 @@ void AppEnum<RigWellPathFormations::FormationLevel>::setUp()
} }
template <> template <>
void AppEnum<RiuPlotAnnotationTool::RegionAnnotationType>::setUp() void AppEnum<RiaDefines::RegionAnnotationType>::setUp()
{ {
addItem( RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS, "NO_ANNOTATIONS", "No Annotations" ); addItem( RiaDefines::RegionAnnotationType::NO_ANNOTATIONS, "NO_ANNOTATIONS", "No Annotations" );
addItem( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS, "FORMATIONS", "Formations" ); addItem( RiaDefines::RegionAnnotationType::FORMATION_ANNOTATIONS, "FORMATIONS", "Formations" );
addItem( RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS, "RESULT_PROPERTY", "Result Property" ); addItem( RiaDefines::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS, "RESULT_PROPERTY", "Result Property" );
setDefault( RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS ); setDefault( RiaDefines::RegionAnnotationType::NO_ANNOTATIONS );
} }
template <> template <>
void AppEnum<RiuPlotAnnotationTool::RegionDisplay>::setUp() void AppEnum<RiaDefines::RegionDisplay>::setUp()
{ {
addItem( RiuPlotAnnotationTool::DARK_LINES, "DARK_LINES", "Dark Lines" ); addItem( RiaDefines::DARK_LINES, "DARK_LINES", "Dark Lines" );
addItem( RiuPlotAnnotationTool::LIGHT_LINES, "LIGHT_LINES", "Light Lines" ); addItem( RiaDefines::LIGHT_LINES, "LIGHT_LINES", "Light Lines" );
addItem( RiuPlotAnnotationTool::COLORED_LINES, "COLORED_LINES", "Colored Lines" ); addItem( RiaDefines::COLORED_LINES, "COLORED_LINES", "Colored Lines" );
addItem( RiuPlotAnnotationTool::COLOR_SHADING, "COLOR_SHADING", "Color Shading" ); addItem( RiaDefines::COLOR_SHADING, "COLOR_SHADING", "Color Shading" );
addItem( RiuPlotAnnotationTool::COLOR_SHADING_AND_LINES, "SHADING_AND_LINES", "Color Shading and Lines" ); addItem( RiaDefines::COLOR_SHADING_AND_LINES, "SHADING_AND_LINES", "Color Shading and Lines" );
setDefault( RiuPlotAnnotationTool::COLOR_SHADING_AND_LINES ); setDefault( RiaDefines::COLOR_SHADING_AND_LINES );
} }
} // namespace caf } // namespace caf
@@ -1305,8 +1305,8 @@ void RimWellLogTrack::onLoadDataAndUpdate()
m_curves[cIdx]->loadDataAndUpdate( false ); m_curves[cIdx]->loadDataAndUpdate( false );
} }
if ( m_regionAnnotationType == RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS || if ( m_regionAnnotationType == RiaDefines::RegionAnnotationType::FORMATION_ANNOTATIONS ||
m_regionAnnotationType == RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS ) m_regionAnnotationType == RiaDefines::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS )
{ {
m_resultDefinition->loadDataAndUpdate(); m_resultDefinition->loadDataAndUpdate();
setFormationFieldsUiReadOnly( false ); setFormationFieldsUiReadOnly( false );
@@ -1315,7 +1315,7 @@ void RimWellLogTrack::onLoadDataAndUpdate()
{ {
setFormationFieldsUiReadOnly( true ); setFormationFieldsUiReadOnly( true );
} }
bool noAnnotations = m_regionAnnotationType() == RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS; bool noAnnotations = m_regionAnnotationType() == RiaDefines::RegionAnnotationType::NO_ANNOTATIONS;
m_regionAnnotationDisplay.uiCapability()->setUiReadOnly( noAnnotations ); m_regionAnnotationDisplay.uiCapability()->setUiReadOnly( noAnnotations );
m_showRegionLabels.uiCapability()->setUiReadOnly( noAnnotations ); m_showRegionLabels.uiCapability()->setUiReadOnly( noAnnotations );
@@ -1356,7 +1356,7 @@ void RimWellLogTrack::setAndUpdateWellPathFormationNamesData( RimCase* rimCase,
updateConnectedEditors(); updateConnectedEditors();
if ( m_regionAnnotationType != RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS ) if ( m_regionAnnotationType != RiaDefines::RegionAnnotationType::NO_ANNOTATIONS )
{ {
updateRegionAnnotationsOnPlot(); updateRegionAnnotationsOnPlot();
} }
@@ -1388,7 +1388,7 @@ void RimWellLogTrack::setAndUpdateSimWellFormationNamesData( RimCase* rimCase, c
updateConnectedEditors(); updateConnectedEditors();
if ( m_regionAnnotationType != RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS ) if ( m_regionAnnotationType != RiaDefines::RegionAnnotationType::NO_ANNOTATIONS )
{ {
updateRegionAnnotationsOnPlot(); updateRegionAnnotationsOnPlot();
} }
@@ -1730,7 +1730,7 @@ void RimWellLogTrack::setColorShadingLegend( RimColorLegend* colorLegend )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType annotationType ) void RimWellLogTrack::setAnnotationType( RiaDefines::RegionAnnotationType annotationType )
{ {
m_regionAnnotationType = annotationType; m_regionAnnotationType = annotationType;
} }
@@ -1738,7 +1738,7 @@ void RimWellLogTrack::setAnnotationType( RiuPlotAnnotationTool::RegionAnnotation
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setAnnotationDisplay( RiuPlotAnnotationTool::RegionDisplay annotationDisplay ) void RimWellLogTrack::setAnnotationDisplay( RiaDefines::RegionDisplay annotationDisplay )
{ {
m_regionAnnotationDisplay = annotationDisplay; m_regionAnnotationDisplay = annotationDisplay;
} }
@@ -1754,7 +1754,7 @@ void RimWellLogTrack::setAnnotationTransparency( int percent )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiuPlotAnnotationTool::RegionAnnotationType RimWellLogTrack::annotationType() const RiaDefines::RegionAnnotationType RimWellLogTrack::annotationType() const
{ {
return m_regionAnnotationType(); return m_regionAnnotationType();
} }
@@ -1762,7 +1762,7 @@ RiuPlotAnnotationTool::RegionAnnotationType RimWellLogTrack::annotationType() co
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiuPlotAnnotationTool::RegionDisplay RimWellLogTrack::annotationDisplay() const RiaDefines::RegionDisplay RimWellLogTrack::annotationDisplay() const
{ {
return m_regionAnnotationDisplay(); return m_regionAnnotationDisplay();
} }
@@ -1772,7 +1772,7 @@ RiuPlotAnnotationTool::RegionDisplay RimWellLogTrack::annotationDisplay() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RimWellLogTrack::showFormations() const bool RimWellLogTrack::showFormations() const
{ {
return m_regionAnnotationType() == RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS; return m_regionAnnotationType() == RiaDefines::RegionAnnotationType::FORMATION_ANNOTATIONS;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -1919,14 +1919,13 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
annotationGroup->add( &m_regionAnnotationType ); annotationGroup->add( &m_regionAnnotationType );
annotationGroup->add( &m_regionAnnotationDisplay ); annotationGroup->add( &m_regionAnnotationDisplay );
annotationGroup->add( &m_showRegionLabels ); annotationGroup->add( &m_showRegionLabels );
if ( m_regionAnnotationType() == RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS ) if ( m_regionAnnotationType() == RiaDefines::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS )
annotationGroup->add( &m_regionLabelFontSize ); annotationGroup->add( &m_regionLabelFontSize );
if ( m_regionAnnotationDisplay() & RiuPlotAnnotationTool::COLOR_SHADING || if ( m_regionAnnotationDisplay() & RiaDefines::COLOR_SHADING || m_regionAnnotationDisplay() & RiaDefines::COLORED_LINES )
m_regionAnnotationDisplay() & RiuPlotAnnotationTool::COLORED_LINES )
{ {
annotationGroup->add( &m_colorShadingLegend ); annotationGroup->add( &m_colorShadingLegend );
if ( m_regionAnnotationDisplay() & RiuPlotAnnotationTool::COLOR_SHADING ) if ( m_regionAnnotationDisplay() & RiaDefines::COLOR_SHADING )
{ {
annotationGroup->add( &m_colorShadingTransparency ); annotationGroup->add( &m_colorShadingTransparency );
} }
@@ -1975,7 +1974,7 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
} }
} }
if ( m_regionAnnotationType() == RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS ) if ( m_regionAnnotationType() == RiaDefines::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS )
{ {
m_resultDefinition->uiOrdering( uiConfigName, *annotationGroup ); m_resultDefinition->uiOrdering( uiConfigName, *annotationGroup );
} }
@@ -2002,7 +2001,7 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogTrack::initAfterRead() void RimWellLogTrack::initAfterRead()
{ {
if ( m_regionAnnotationType() == RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS ) if ( m_regionAnnotationType() == RiaDefines::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS )
{ {
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_formationCase.value() ); RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_formationCase.value() );
m_resultDefinition->setEclipseCase( dynamic_cast<RimEclipseCase*>( eclipseCase ) ); m_resultDefinition->setEclipseCase( dynamic_cast<RimEclipseCase*>( eclipseCase ) );
@@ -2708,18 +2707,18 @@ void RimWellLogTrack::updateRegionAnnotationsOnPlot()
{ {
removeRegionAnnotations(); removeRegionAnnotations();
if ( m_regionAnnotationType == RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS ) return; if ( m_regionAnnotationType == RiaDefines::RegionAnnotationType::NO_ANNOTATIONS ) return;
if ( m_annotationTool == nullptr ) if ( m_annotationTool == nullptr )
{ {
m_annotationTool = std::unique_ptr<RiuPlotAnnotationTool>( new RiuPlotAnnotationTool() ); m_annotationTool = std::unique_ptr<RiuPlotAnnotationTool>( new RiuPlotAnnotationTool() );
} }
if ( m_regionAnnotationType == RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ) if ( m_regionAnnotationType == RiaDefines::RegionAnnotationType::FORMATION_ANNOTATIONS )
{ {
updateFormationNamesOnPlot(); updateFormationNamesOnPlot();
} }
else if ( m_regionAnnotationType == RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS ) else if ( m_regionAnnotationType == RiaDefines::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS )
{ {
updateResultPropertyNamesOnPlot(); updateResultPropertyNamesOnPlot();
} }
@@ -2740,6 +2739,10 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
RiaDefines::DepthUnitType fromDepthUnit = plot->caseDepthUnit(); RiaDefines::DepthUnitType fromDepthUnit = plot->caseDepthUnit();
RiaDefines::DepthUnitType toDepthUnit = plot->depthUnit(); RiaDefines::DepthUnitType toDepthUnit = plot->depthUnit();
RiaDefines::Orientation orientation = RiaDefines::Orientation::HORIZONTAL;
if ( plot->depthOrientation() == RimDepthTrackPlot::DepthOrientation::VERTICAL )
orientation = RiaDefines::Orientation::VERTICAL;
if ( m_formationSource() == FormationSource::WELL_PICK_FILTER ) if ( m_formationSource() == FormationSource::WELL_PICK_FILTER )
{ {
if ( m_formationWellPathForSourceWellPath == nullptr ) return; if ( m_formationWellPathForSourceWellPath == nullptr ) return;
@@ -2833,8 +2836,6 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
if ( geoMechWellLogExtractor ) if ( geoMechWellLogExtractor )
{ {
// Attach water and rock base formations // Attach water and rock base formations
const std::pair<double, double> xRange =
std::make_pair( m_visiblePropertyValueRangeMin(), m_visiblePropertyValueRangeMax() );
const caf::ColorTable waterAndRockColors = RiaColorTables::waterAndRockPaletteColors(); const caf::ColorTable waterAndRockColors = RiaColorTables::waterAndRockPaletteColors();
const std::vector<std::pair<double, double>> waterAndRockIntervals = const std::vector<std::pair<double, double>> waterAndRockIntervals =
@@ -2845,13 +2846,13 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
m_annotationTool->attachNamedRegions( m_plotWidget->qwtPlot(), m_annotationTool->attachNamedRegions( m_plotWidget->qwtPlot(),
{ "Sea Level", "" }, { "Sea Level", "" },
xRange, orientation,
convertedYValues, convertedYValues,
m_regionAnnotationDisplay(), m_regionAnnotationDisplay(),
waterAndRockColors, waterAndRockColors,
( ( 100 - m_colorShadingTransparency ) * 255 ) / 100, ( ( 100 - m_colorShadingTransparency ) * 255 ) / 100,
m_showRegionLabels(), m_showRegionLabels(),
RiuPlotAnnotationTool::TrackSpan::LEFT_COLUMN, RiaDefines::TrackSpan::LEFT_COLUMN,
{ Qt::SolidPattern, Qt::Dense6Pattern } ); { Qt::SolidPattern, Qt::Dense6Pattern } );
} }
@@ -2882,16 +2883,13 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
&formationNamesToPlot, &formationNamesToPlot,
&yValues ); &yValues );
const std::pair<double, double> xRange =
std::make_pair( m_visiblePropertyValueRangeMin(), m_visiblePropertyValueRangeMax() );
std::vector<std::pair<double, double>> convertedYValues = std::vector<std::pair<double, double>> convertedYValues =
RiaWellLogUnitTools<double>::convertDepths( yValues, fromDepthUnit, toDepthUnit ); RiaWellLogUnitTools<double>::convertDepths( yValues, fromDepthUnit, toDepthUnit );
caf::ColorTable colorTable( m_colorShadingLegend->colorArray() ); caf::ColorTable colorTable( m_colorShadingLegend->colorArray() );
m_annotationTool->attachNamedRegions( m_plotWidget->qwtPlot(), m_annotationTool->attachNamedRegions( m_plotWidget->qwtPlot(),
formationNamesToPlot, formationNamesToPlot,
xRange, orientation,
convertedYValues, convertedYValues,
m_regionAnnotationDisplay(), m_regionAnnotationDisplay(),
colorTable, colorTable,
@@ -2912,6 +2910,10 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot()
RiaDefines::DepthUnitType fromDepthUnit = plot->caseDepthUnit(); RiaDefines::DepthUnitType fromDepthUnit = plot->caseDepthUnit();
RiaDefines::DepthUnitType toDepthUnit = plot->depthUnit(); RiaDefines::DepthUnitType toDepthUnit = plot->depthUnit();
RiaDefines::Orientation orientation = RiaDefines::Orientation::HORIZONTAL;
if ( plot->depthOrientation() == RimDepthTrackPlot::DepthOrientation::VERTICAL )
orientation = RiaDefines::Orientation::VERTICAL;
RigEclipseWellLogExtractor* eclWellLogExtractor = RigEclipseWellLogExtractor* eclWellLogExtractor =
RiaExtractionTools::findOrCreateWellLogExtractor( m_formationWellPathForSourceCase, RiaExtractionTools::findOrCreateWellLogExtractor( m_formationWellPathForSourceCase,
dynamic_cast<RimEclipseCase*>( m_formationCase() ) ); dynamic_cast<RimEclipseCase*>( m_formationCase() ) );
@@ -2944,8 +2946,6 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot()
CurveSamplingPointData curveData = RimWellLogTrack::curveSamplingPointData( eclWellLogExtractor, resultAccessor.p() ); CurveSamplingPointData curveData = RimWellLogTrack::curveSamplingPointData( eclWellLogExtractor, resultAccessor.p() );
// Attach water and rock base formations // Attach water and rock base formations
const std::pair<double, double> xRange =
std::make_pair( m_visiblePropertyValueRangeMin(), m_visiblePropertyValueRangeMax() );
if ( m_formationSource == FormationSource::CASE ) if ( m_formationSource == FormationSource::CASE )
{ {
@@ -2987,7 +2987,7 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot()
std::vector<std::pair<double, double>> convertedYValues = std::vector<std::pair<double, double>> convertedYValues =
RiaWellLogUnitTools<double>::convertDepths( yValues, fromDepthUnit, toDepthUnit ); RiaWellLogUnitTools<double>::convertDepths( yValues, fromDepthUnit, toDepthUnit );
// TODO: unecessarily messy! // TODO: unnecessarily messy!
// Need to map colors to names (since a category can be used several times) // Need to map colors to names (since a category can be used several times)
for ( QString nameToPlot : namesToPlot ) for ( QString nameToPlot : namesToPlot )
{ {
@@ -3020,13 +3020,13 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot()
m_annotationTool->attachNamedRegions( m_plotWidget->qwtPlot(), m_annotationTool->attachNamedRegions( m_plotWidget->qwtPlot(),
namesToPlot, namesToPlot,
xRange, orientation,
convertedYValues, convertedYValues,
m_regionAnnotationDisplay(), m_regionAnnotationDisplay(),
colorTable, colorTable,
( ( 100 - m_colorShadingTransparency ) * 255 ) / 100, ( ( 100 - m_colorShadingTransparency ) * 255 ) / 100,
m_showRegionLabels(), m_showRegionLabels(),
RiuPlotAnnotationTool::TrackSpan::FULL_WIDTH, RiaDefines::TrackSpan::FULL_WIDTH,
{}, {},
fontSize ); fontSize );
} }
@@ -3044,6 +3044,10 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
RiaDefines::DepthUnitType fromDepthUnit = wellBoreStabilityPlot->caseDepthUnit(); RiaDefines::DepthUnitType fromDepthUnit = wellBoreStabilityPlot->caseDepthUnit();
RiaDefines::DepthUnitType toDepthUnit = wellBoreStabilityPlot->depthUnit(); RiaDefines::DepthUnitType toDepthUnit = wellBoreStabilityPlot->depthUnit();
RiaDefines::Orientation orientation = RiaDefines::Orientation::HORIZONTAL;
if ( wellBoreStabilityPlot->depthOrientation() == RimDepthTrackPlot::DepthOrientation::VERTICAL )
orientation = RiaDefines::Orientation::VERTICAL;
wellBoreStabilityPlot->updateCommonDataSource(); wellBoreStabilityPlot->updateCommonDataSource();
RimGeoMechCase* geoMechCase = RimGeoMechCase* geoMechCase =
dynamic_cast<RimGeoMechCase*>( wellBoreStabilityPlot->commonDataSource()->caseToApply() ); dynamic_cast<RimGeoMechCase*>( wellBoreStabilityPlot->commonDataSource()->caseToApply() );
@@ -3056,9 +3060,6 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
RiaExtractionTools::findOrCreateWellLogExtractor( wellPath, dynamic_cast<RimGeoMechCase*>( geoMechCase ) ); RiaExtractionTools::findOrCreateWellLogExtractor( wellPath, dynamic_cast<RimGeoMechCase*>( geoMechCase ) );
if ( !geoMechWellLogExtractor ) return; if ( !geoMechWellLogExtractor ) return;
std::pair<double, double> xRange =
std::make_pair( m_visiblePropertyValueRangeMin(), m_visiblePropertyValueRangeMax() );
CurveSamplingPointData curveData; CurveSamplingPointData curveData;
curveData.md = geoMechWellLogExtractor->cellIntersectionMDs(); curveData.md = geoMechWellLogExtractor->cellIntersectionMDs();
curveData.tvd = geoMechWellLogExtractor->cellIntersectionTVDs(); curveData.tvd = geoMechWellLogExtractor->cellIntersectionTVDs();
@@ -3098,13 +3099,13 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
m_annotationTool->attachNamedRegions( m_plotWidget->qwtPlot(), m_annotationTool->attachNamedRegions( m_plotWidget->qwtPlot(),
sourceNamesToPlot, sourceNamesToPlot,
xRange, orientation,
convertedYValues, convertedYValues,
m_regionAnnotationDisplay(), m_regionAnnotationDisplay(),
colorTable, colorTable,
( ( ( 100 - m_colorShadingTransparency ) * 255 ) / 100 ) / 3, ( ( ( 100 - m_colorShadingTransparency ) * 255 ) / 100 ) / 3,
m_showRegionLabels(), m_showRegionLabels(),
RiuPlotAnnotationTool::TrackSpan::LEFT_COLUMN ); RiaDefines::TrackSpan::LEFT_COLUMN );
} }
{ {
caf::ColorTable colorTable( m_colorShadingLegend->colorArray() ); caf::ColorTable colorTable( m_colorShadingLegend->colorArray() );
@@ -3129,13 +3130,13 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
m_annotationTool->attachNamedRegions( m_plotWidget->qwtPlot(), m_annotationTool->attachNamedRegions( m_plotWidget->qwtPlot(),
sourceNamesToPlot, sourceNamesToPlot,
xRange, orientation,
convertedYValues, convertedYValues,
m_regionAnnotationDisplay(), m_regionAnnotationDisplay(),
colorTable, colorTable,
( ( ( 100 - m_colorShadingTransparency ) * 255 ) / 100 ) / 3, ( ( ( 100 - m_colorShadingTransparency ) * 255 ) / 100 ) / 3,
m_showRegionLabels(), m_showRegionLabels(),
RiuPlotAnnotationTool::TrackSpan::CENTRE_COLUMN ); RiaDefines::TrackSpan::CENTRE_COLUMN );
} }
{ {
caf::ColorTable colorTable( m_colorShadingLegend->colorArray() ); caf::ColorTable colorTable( m_colorShadingLegend->colorArray() );
@@ -3159,13 +3160,13 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
m_annotationTool->attachNamedRegions( m_plotWidget->qwtPlot(), m_annotationTool->attachNamedRegions( m_plotWidget->qwtPlot(),
sourceNamesToPlot, sourceNamesToPlot,
xRange, orientation,
convertedYValues, convertedYValues,
m_regionAnnotationDisplay(), m_regionAnnotationDisplay(),
colorTable, colorTable,
( ( ( 100 - m_colorShadingTransparency ) * 255 ) / 100 ) / 3, ( ( ( 100 - m_colorShadingTransparency ) * 255 ) / 100 ) / 3,
m_showRegionLabels(), m_showRegionLabels(),
RiuPlotAnnotationTool::TrackSpan::RIGHT_COLUMN ); RiaDefines::TrackSpan::RIGHT_COLUMN );
} }
} }
} }

View File

@@ -21,8 +21,8 @@
#include "RimWellLogPlot.h" #include "RimWellLogPlot.h"
#include "RiaPlotDefines.h"
#include "RigWellPathFormations.h" #include "RigWellPathFormations.h"
#include "RiuPlotAnnotationTool.h"
#include "RimPlot.h" #include "RimPlot.h"
@@ -57,6 +57,7 @@ class RigWellLogExtractor;
class RimEclipseResultDefinition; class RimEclipseResultDefinition;
class RimColorLegend; class RimColorLegend;
class RimEnsembleWellLogCurveSet; class RimEnsembleWellLogCurveSet;
class RiuPlotAnnotationTool;
struct CurveSamplingPointData struct CurveSamplingPointData
{ {
@@ -87,8 +88,8 @@ public:
WELL_PICK_FILTER WELL_PICK_FILTER
}; };
using RegionAnnotationTypeEnum = caf::AppEnum<RiuPlotAnnotationTool::RegionAnnotationType>; using RegionAnnotationTypeEnum = caf::AppEnum<RiaDefines::RegionAnnotationType>;
using RegionAnnotationDisplayEnum = caf::AppEnum<RiuPlotAnnotationTool::RegionDisplay>; using RegionAnnotationDisplayEnum = caf::AppEnum<RiaDefines::RegionDisplay>;
public: public:
RimWellLogTrack(); RimWellLogTrack();
@@ -166,13 +167,13 @@ public:
void setMinAndMaxTicksOnly( bool enable ); void setMinAndMaxTicksOnly( bool enable );
void setPropertyValueAxisGridVisibility( RimWellLogPlot::AxisGridVisibility gridLines ); void setPropertyValueAxisGridVisibility( RimWellLogPlot::AxisGridVisibility gridLines );
void setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType annotationType ); void setAnnotationType( RiaDefines::RegionAnnotationType annotationType );
void setAnnotationDisplay( RiuPlotAnnotationTool::RegionDisplay annotationDisplay ); void setAnnotationDisplay( RiaDefines::RegionDisplay annotationDisplay );
void setAnnotationTransparency( int percent ); void setAnnotationTransparency( int percent );
void setColorShadingLegend( RimColorLegend* colorLegend ); void setColorShadingLegend( RimColorLegend* colorLegend );
RiuPlotAnnotationTool::RegionAnnotationType annotationType() const; RiaDefines::RegionAnnotationType annotationType() const;
RiuPlotAnnotationTool::RegionDisplay annotationDisplay() const; RiaDefines::RegionDisplay annotationDisplay() const;
bool showFormations() const; bool showFormations() const;

View File

@@ -18,6 +18,7 @@
#include "RiuGridCrossQwtPlot.h" #include "RiuGridCrossQwtPlot.h"
#include "RiaFontCache.h" #include "RiaFontCache.h"
#include "RiaPlotDefines.h"
#include "RimGridCrossPlot.h" #include "RimGridCrossPlot.h"
#include "RimGridCrossPlotCurve.h" #include "RimGridCrossPlotCurve.h"
@@ -145,7 +146,7 @@ void RiuGridCrossQwtPlot::updateAnnotationObjects( RimPlotAxisPropertiesInterfac
annotation->color(), annotation->color(),
annotation->name(), annotation->name(),
annotation->value(), annotation->value(),
RiuPlotAnnotationTool::Orientation::HORIZONTAL ); RiaDefines::Orientation::HORIZONTAL );
} }
} }

View File

@@ -44,17 +44,17 @@ RiuPlotAnnotationTool::~RiuPlotAnnotationTool()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuPlotAnnotationTool::attachNamedRegions( QwtPlot* plot, void RiuPlotAnnotationTool::attachNamedRegions( QwtPlot* plot,
const std::vector<QString>& names, const std::vector<QString>& names,
const std::pair<double, double> xRange, RiaDefines::Orientation depthOrientation,
const std::vector<std::pair<double, double>>& yPositions, const std::vector<std::pair<double, double>>& regionRanges,
RegionDisplay regionDisplay, RiaDefines::RegionDisplay regionDisplay,
const caf::ColorTable& colorTable, const caf::ColorTable& colorTable,
int shadingAlphaByte, int shadingAlphaByte,
bool showNames /*= true */, bool showNames /*= true */,
TrackSpan trackSpan /*= FULL_WIDTH*/, RiaDefines::TrackSpan trackSpan /*= FULL_WIDTH*/,
const std::vector<Qt::BrushStyle>& brushStyles /* = {}*/, const std::vector<Qt::BrushStyle>& brushStyles /* = {}*/,
int fontSize ) int fontSize )
{ {
if ( names.size() != yPositions.size() ) return; if ( names.size() != regionRanges.size() ) return;
m_plot = plot; m_plot = plot;
double delta = 0.5; double delta = 0.5;
@@ -66,27 +66,36 @@ void RiuPlotAnnotationTool::attachNamedRegions( QwtPlot*
catMapper.setCategories( categoryIndices ); catMapper.setCategories( categoryIndices );
catMapper.setInterpolateColors( colorTable.color3ubArray() ); catMapper.setInterpolateColors( colorTable.color3ubArray() );
RiaDefines::Orientation annotationOrientation = RiaDefines::Orientation::HORIZONTAL;
if ( depthOrientation == RiaDefines::Orientation::HORIZONTAL )
annotationOrientation = RiaDefines::Orientation::VERTICAL;
for ( size_t i = 0; i < names.size(); i++ ) for ( size_t i = 0; i < names.size(); i++ )
{ {
QwtPlotMarker* line( new QwtPlotMarker() ); auto* line( new QwtPlotMarker() );
QString name; QString name;
if ( showNames && !names[i].isEmpty() ) if ( showNames && !names[i].isEmpty() )
{ {
name = names[i]; name = names[i];
if ( ( regionDisplay & COLOR_SHADING ) == 0 && names[i].toLower().indexOf( "top" ) == -1 ) if ( ( regionDisplay & RiaDefines::COLOR_SHADING ) == 0 && names[i].toLower().indexOf( "top" ) == -1 )
{ {
name += " Top"; name += " Top";
} }
} }
if ( regionDisplay & COLOR_SHADING ) if ( regionDisplay & RiaDefines::COLOR_SHADING )
{ {
cvf::Color3ub cvfColor = catMapper.mapToColor( static_cast<double>( i ) ); cvf::Color3ub cvfColor = catMapper.mapToColor( static_cast<double>( i ) );
QColor shadingColor( cvfColor.r(), cvfColor.g(), cvfColor.b(), shadingAlphaByte ); QColor shadingColor( cvfColor.r(), cvfColor.g(), cvfColor.b(), shadingAlphaByte );
QwtPlotZoneItem* shading = new QwtPlotZoneItem(); auto* shading = new QwtPlotZoneItem();
shading->setOrientation( Qt::Horizontal );
shading->setInterval( yPositions[i].first, yPositions[i].second ); if ( depthOrientation == RiaDefines::Orientation::HORIZONTAL )
shading->setOrientation( Qt::Vertical );
else
shading->setOrientation( Qt::Horizontal );
shading->setInterval( regionRanges[i].first, regionRanges[i].second );
shading->setPen( shadingColor, 0.0, Qt::NoPen ); shading->setPen( shadingColor, 0.0, Qt::NoPen );
QBrush brush( shadingColor ); QBrush brush( shadingColor );
if ( i < brushStyles.size() ) if ( i < brushStyles.size() )
@@ -97,21 +106,22 @@ void RiuPlotAnnotationTool::attachNamedRegions( QwtPlot*
shading->attach( m_plot ); shading->attach( m_plot );
shading->setZ( -100.0 ); shading->setZ( -100.0 );
shading->setXAxis( QwtAxis::XTop ); shading->setXAxis( QwtAxis::XTop );
m_horizontalMarkers.push_back( std::move( shading ) ); m_plotItems.push_back( shading );
} }
QColor lineColor( 0, 0, 0, 0 ); QColor lineColor( 0, 0, 0, 0 );
QColor textColor( 0, 0, 0, 255 ); QColor textColor( 0, 0, 0, 255 );
if ( regionDisplay & DARK_LINES || regionDisplay & COLORED_LINES || regionDisplay & LIGHT_LINES ) if ( regionDisplay & RiaDefines::DARK_LINES || regionDisplay & RiaDefines::COLORED_LINES ||
regionDisplay & RiaDefines::LIGHT_LINES )
{ {
cvf::Color3ub cvfColor = catMapper.mapToColor( static_cast<double>( i ) ); cvf::Color3ub cvfColor = catMapper.mapToColor( static_cast<double>( i ) );
QColor cycledColor( cvfColor.r(), cvfColor.g(), cvfColor.b() ); QColor cycledColor( cvfColor.r(), cvfColor.g(), cvfColor.b() );
if ( regionDisplay & DARK_LINES ) if ( regionDisplay & RiaDefines::DARK_LINES )
{ {
lineColor = QColor( 50, 50, 100 ); lineColor = QColor( 50, 50, 100 );
} }
else if ( regionDisplay & LIGHT_LINES ) else if ( regionDisplay & RiaDefines::LIGHT_LINES )
{ {
lineColor = QColor( 200, 200, 200 ); lineColor = QColor( 200, 200, 200 );
} }
@@ -122,29 +132,34 @@ void RiuPlotAnnotationTool::attachNamedRegions( QwtPlot*
textColor = lineColor; textColor = lineColor;
} }
Qt::Alignment horizontalAlignment = trackTextAlignment( trackSpan ); Qt::Alignment horizontalAlignment = trackTextAlignment( trackSpan );
RiuPlotAnnotationTool::horizontalDashedLine( line,
name, RiuPlotAnnotationTool::setLineProperties( line,
yPositions[i].first, name,
lineColor, annotationOrientation,
textColor, regionRanges[i].first,
horizontalAlignment, Qt::DashLine,
fontSize ); lineColor,
textColor,
horizontalAlignment,
fontSize );
line->attach( m_plot ); line->attach( m_plot );
m_horizontalMarkers.push_back( std::move( line ) ); m_plotItems.push_back( line );
if ( ( i != names.size() - 1 ) && cvf::Math::abs( yPositions[i].second - yPositions[i + 1].first ) > delta ) if ( ( i != names.size() - 1 ) && cvf::Math::abs( regionRanges[i].second - regionRanges[i + 1].first ) > delta )
{ {
QwtPlotMarker* bottomLine( new QwtPlotMarker() ); auto* bottomLine( new QwtPlotMarker() );
RiuPlotAnnotationTool::horizontalDashedLine( bottomLine,
QString(),
yPositions[i].second,
lineColor,
textColor,
Qt::AlignRight,
fontSize );
RiuPlotAnnotationTool::setLineProperties( bottomLine,
QString(),
annotationOrientation,
regionRanges[i].second,
Qt::DashLine,
lineColor,
textColor,
Qt::AlignRight,
fontSize );
bottomLine->attach( m_plot ); bottomLine->attach( m_plot );
m_horizontalMarkers.push_back( std::move( bottomLine ) ); m_plotItems.push_back( bottomLine );
} }
} }
} }
@@ -156,68 +171,63 @@ void RiuPlotAnnotationTool::attachWellPicks( QwtPlot* plot,
const std::vector<QString>& names, const std::vector<QString>& names,
const std::vector<double>& yPositions ) const std::vector<double>& yPositions )
{ {
detachAllAnnotations( Orientation::HORIZONTAL ); detachAllAnnotations();
if ( names.size() != yPositions.size() ) return; if ( names.size() != yPositions.size() ) return;
m_plot = plot; m_plot = plot;
for ( size_t i = 0; i < names.size(); i++ ) for ( size_t i = 0; i < names.size(); i++ )
{ {
QwtPlotMarker* line( new QwtPlotMarker() ); auto* line( new QwtPlotMarker() );
RiuPlotAnnotationTool::horizontalDashedLine( line, names[i], yPositions[i] ); RiuPlotAnnotationTool::setLineProperties( line, names[i], RiaDefines::Orientation::HORIZONTAL, yPositions[i] );
line->attach( m_plot ); line->attach( m_plot );
m_horizontalMarkers.push_back( std::move( line ) ); m_plotItems.push_back( line );
} }
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuPlotAnnotationTool::attachAnnotationLine( QwtPlot* plot, void RiuPlotAnnotationTool::attachAnnotationLine( QwtPlot* plot,
const QColor& color, const QColor& color,
const QString& annotationText, const QString& annotationText,
const double position, const double position,
Orientation orientation ) RiaDefines::Orientation orientation )
{ {
m_plot = plot; m_plot = plot;
QwtPlotMarker* line( new QwtPlotMarker() ); auto* line( new QwtPlotMarker() );
if ( orientation == Orientation::HORIZONTAL )
auto textColor = color;
if ( orientation == RiaDefines::Orientation::VERTICAL )
{ {
RiuPlotAnnotationTool::horizontalDashedLine( line, annotationText, position, color, color ); textColor = RiuGuiTheme::getColorByVariableName( "textColor" );
m_horizontalMarkers.push_back( std::move( line ) );
}
else if ( orientation == Orientation::VERTICAL )
{
RiuPlotAnnotationTool::verticalLine( line,
annotationText,
position,
color,
RiuGuiTheme::getColorByVariableName( "textColor" ) );
m_verticalMarkers.push_back( std::move( line ) );
} }
RiuPlotAnnotationTool::setLineProperties( line, annotationText, orientation, position, Qt::SolidLine, color, textColor );
m_plotItems.push_back( line );
line->attach( m_plot ); line->attach( m_plot );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuPlotAnnotationTool::attachAnnotationRange( QwtPlot* plot, void RiuPlotAnnotationTool::attachAnnotationRange( QwtPlot* plot,
const QColor& color, const QColor& color,
const QString& annotationText, const QString& annotationText,
const double rangeStart, const double rangeStart,
const double rangeEnd, const double rangeEnd,
Orientation orientation ) RiaDefines::Orientation orientation )
{ {
m_plot = plot; m_plot = plot;
if ( orientation == Orientation::HORIZONTAL ) if ( orientation == RiaDefines::Orientation::HORIZONTAL )
{ {
RiuPlotAnnotationTool::horizontalRange( annotationText, RiuPlotAnnotationTool::horizontalRange( annotationText,
std::make_pair( rangeStart, rangeEnd ), std::make_pair( rangeStart, rangeEnd ),
color, color,
RiuGuiTheme::getColorByVariableName( "textColor" ) ); RiuGuiTheme::getColorByVariableName( "textColor" ) );
} }
else if ( orientation == Orientation::VERTICAL ) else if ( orientation == RiaDefines::Orientation::VERTICAL )
{ {
RiuPlotAnnotationTool::verticalRange( annotationText, RiuPlotAnnotationTool::verticalRange( annotationText,
std::make_pair( rangeStart, rangeEnd ), std::make_pair( rangeStart, rangeEnd ),
@@ -230,91 +240,38 @@ void RiuPlotAnnotationTool::attachAnnotationRange( QwtPlot* plot,
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuPlotAnnotationTool::detachAllAnnotations( Orientation orientation ) void RiuPlotAnnotationTool::detachAllAnnotations()
{ {
if ( m_plot ) if ( m_plot )
{ {
if ( orientation == Orientation::HORIZONTAL ) for ( auto& plotItem : m_plotItems )
{ {
for ( size_t i = 0; i < m_horizontalMarkers.size(); i++ ) plotItem->detach();
{ delete plotItem;
m_horizontalMarkers[i]->detach();
delete m_horizontalMarkers[i];
}
}
else if ( orientation == Orientation::VERTICAL )
{
for ( size_t i = 0; i < m_verticalMarkers.size(); i++ )
{
m_verticalMarkers[i]->detach();
delete m_verticalMarkers[i];
}
} }
} }
if ( orientation == Orientation::HORIZONTAL ) m_plotItems.clear();
{
m_horizontalMarkers.clear();
}
else if ( orientation == Orientation::VERTICAL )
{
m_verticalMarkers.clear();
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuPlotAnnotationTool::detachAllAnnotations() Qt::Alignment RiuPlotAnnotationTool::trackTextAlignment( RiaDefines::TrackSpan trackSpan )
{
detachAllAnnotations( Orientation::HORIZONTAL );
detachAllAnnotations( Orientation::VERTICAL );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Qt::Alignment RiuPlotAnnotationTool::trackTextAlignment( TrackSpan trackSpan )
{ {
switch ( trackSpan ) switch ( trackSpan )
{ {
case TrackSpan::FULL_WIDTH: case RiaDefines::TrackSpan::FULL_WIDTH:
return Qt::AlignRight; return Qt::AlignRight;
case TrackSpan::LEFT_COLUMN: case RiaDefines::TrackSpan::LEFT_COLUMN:
return Qt::AlignLeft; return Qt::AlignLeft;
case TrackSpan::CENTRE_COLUMN: case RiaDefines::TrackSpan::CENTRE_COLUMN:
return Qt::AlignCenter; return Qt::AlignCenter;
case TrackSpan::RIGHT_COLUMN: case RiaDefines::TrackSpan::RIGHT_COLUMN:
return Qt::AlignRight; return Qt::AlignRight;
} }
return Qt::AlignRight; return Qt::AlignRight;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPlotAnnotationTool::horizontalDashedLine( QwtPlotMarker* line,
const QString& name,
double yValue,
const QColor& color /*= QColor(0, 0, 100) */,
const QColor& textColor /*= QColor(0, 0, 100) */,
Qt::Alignment horizontalAlignment /*= Qt::AlignRight */,
int fontSize )
{
QPen curvePen;
curvePen.setStyle( Qt::DashLine );
curvePen.setColor( color );
curvePen.setWidth( 1 );
line->setLineStyle( QwtPlotMarker::HLine );
line->setLinePen( curvePen );
line->setYValue( yValue );
QwtText label( name );
label.setColor( textColor );
if ( fontSize > 0 ) label.setFont( QFont( label.font().key(), fontSize ) );
line->setLabel( label );
line->setLabelAlignment( horizontalAlignment | Qt::AlignBottom );
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -327,7 +284,7 @@ void RiuPlotAnnotationTool::horizontalRange( const QString& nam
QColor shadingColor = color; QColor shadingColor = color;
shadingColor.setAlpha( 10 ); shadingColor.setAlpha( 10 );
QwtPlotZoneItem* shading = new QwtPlotZoneItem(); auto* shading = new QwtPlotZoneItem();
shading->setOrientation( Qt::Horizontal ); shading->setOrientation( Qt::Horizontal );
shading->setInterval( yRange.first, yRange.second ); shading->setInterval( yRange.first, yRange.second );
shading->setPen( shadingColor, 0.0, Qt::NoPen ); shading->setPen( shadingColor, 0.0, Qt::NoPen );
@@ -336,18 +293,31 @@ void RiuPlotAnnotationTool::horizontalRange( const QString& nam
shading->attach( m_plot ); shading->attach( m_plot );
shading->setZ( -100.0 ); shading->setZ( -100.0 );
shading->setXAxis( QwtAxis::XBottom ); shading->setXAxis( QwtAxis::XBottom );
m_horizontalMarkers.push_back( std::move( shading ) ); m_plotItems.push_back( shading );
QwtPlotMarker* line( new QwtPlotMarker() ); auto* line( new QwtPlotMarker() );
RiuPlotAnnotationTool::horizontalDashedLine( line, name, yRange.first, color, color, horizontalAlignment ); RiuPlotAnnotationTool::setLineProperties( line,
name,
RiaDefines::Orientation::HORIZONTAL,
yRange.first,
Qt::DashLine,
color,
color,
horizontalAlignment );
line->attach( m_plot ); line->attach( m_plot );
m_horizontalMarkers.push_back( std::move( line ) ); m_plotItems.push_back( line );
QwtPlotMarker* bottomLine( new QwtPlotMarker() ); auto* bottomLine( new QwtPlotMarker() );
RiuPlotAnnotationTool::horizontalDashedLine( bottomLine, QString(), yRange.second, color, color ); RiuPlotAnnotationTool::setLineProperties( bottomLine,
QString(),
RiaDefines::Orientation::HORIZONTAL,
yRange.second,
Qt::DashLine,
color,
color );
bottomLine->attach( m_plot ); bottomLine->attach( m_plot );
m_horizontalMarkers.push_back( std::move( bottomLine ) ); m_plotItems.push_back( bottomLine );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -362,7 +332,7 @@ void RiuPlotAnnotationTool::verticalRange( const QString& name,
QColor shadingColor = color; QColor shadingColor = color;
shadingColor.setAlpha( 50 ); shadingColor.setAlpha( 50 );
QwtPlotZoneItem* shading = new QwtPlotZoneItem(); auto* shading = new QwtPlotZoneItem();
shading->setOrientation( Qt::Vertical ); shading->setOrientation( Qt::Vertical );
shading->setInterval( xRange.first, xRange.second ); shading->setInterval( xRange.first, xRange.second );
shading->setPen( shadingColor, 0.0, Qt::NoPen ); shading->setPen( shadingColor, 0.0, Qt::NoPen );
@@ -371,56 +341,68 @@ void RiuPlotAnnotationTool::verticalRange( const QString& name,
shading->attach( m_plot ); shading->attach( m_plot );
shading->setZ( -100.0 ); shading->setZ( -100.0 );
shading->setXAxis( QwtAxis::XBottom ); shading->setXAxis( QwtAxis::XBottom );
m_verticalMarkers.push_back( std::move( shading ) ); m_plotItems.push_back( shading );
QStringList labels = name.split( " - " ); QStringList labels = name.split( " - " );
QwtPlotMarker* line( new QwtPlotMarker() ); auto* line( new QwtPlotMarker() );
RiuPlotAnnotationTool::verticalLine( line, RiuPlotAnnotationTool::setLineProperties( line,
labels[0], labels[0],
xRange.first, RiaDefines::Orientation::VERTICAL,
color, xRange.first,
textColor, Qt::SolidLine,
Qt::SolidLine, color,
Qt::AlignRight | horizontalAlignment ); textColor,
Qt::AlignRight | horizontalAlignment );
line->attach( m_plot ); line->attach( m_plot );
m_verticalMarkers.push_back( std::move( line ) ); m_plotItems.push_back( line );
QwtPlotMarker* rightLine( new QwtPlotMarker() ); auto* rightLine( new QwtPlotMarker() );
RiuPlotAnnotationTool::verticalLine( rightLine, RiuPlotAnnotationTool::setLineProperties( rightLine,
labels.size() == 2 ? labels[1] : QString(), labels.size() == 2 ? labels[1] : QString(),
xRange.second, RiaDefines::Orientation::VERTICAL,
color, xRange.second,
textColor, Qt::SolidLine,
Qt::SolidLine, color,
Qt::AlignLeft | horizontalAlignment ); textColor,
Qt::AlignLeft | horizontalAlignment );
rightLine->attach( m_plot ); rightLine->attach( m_plot );
m_verticalMarkers.push_back( std::move( rightLine ) ); m_plotItems.push_back( rightLine );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuPlotAnnotationTool::verticalLine( QwtPlotMarker* line, void RiuPlotAnnotationTool::setLineProperties( QwtPlotMarker* line,
const QString& name, const QString& name,
double xValue, RiaDefines::Orientation orientation,
const QColor& color /*= QColor(0, 0, 100) */, double linePosition,
const QColor& textColor /*= QColor(0, 0, 100) */, Qt::PenStyle lineStyle,
Qt::PenStyle lineStyle /*= Qt::DashLine */, const QColor& color /*= QColor( 0, 0, 100 )*/,
Qt::Alignment horizontalAlignment /*= Qt::AlignRight | Qt::AlignBottom */ ) const QColor& textColor /*= QColor( 0, 0, 100 )*/,
Qt::Alignment horizontalAlignment /*= Qt::AlignRight*/,
int fontSize /*= 0 */ )
{ {
QPen curvePen; QPen curvePen;
curvePen.setStyle( lineStyle ); curvePen.setStyle( lineStyle );
curvePen.setColor( color ); curvePen.setColor( color );
curvePen.setWidth( 1 ); curvePen.setWidth( 1 );
line->setAxes( QwtAxis::XBottom, QwtAxis::YLeft );
line->setLineStyle( QwtPlotMarker::VLine );
line->setLinePen( curvePen ); line->setLinePen( curvePen );
line->setXValue( xValue );
QwtText label( name ); QwtText label( name );
label.setColor( textColor ); label.setColor( textColor );
if ( fontSize > 0 ) label.setFont( QFont( label.font().key(), fontSize ) );
line->setLabel( label ); line->setLabel( label );
line->setLabelAlignment( horizontalAlignment ); line->setLabelAlignment( horizontalAlignment | Qt::AlignBottom );
line->setLabelOrientation( Qt::Orientation::Vertical );
if ( orientation == RiaDefines::Orientation::HORIZONTAL )
{
line->setLineStyle( QwtPlotMarker::HLine );
line->setYValue( linePosition );
}
else
{
line->setLineStyle( QwtPlotMarker::VLine );
line->setXValue( linePosition );
}
} }

View File

@@ -18,6 +18,8 @@
#pragma once #pragma once
#include "RiaPlotDefines.h"
#include "cafColorTable.h" #include "cafColorTable.h"
#include "qwt_plot_marker.h" #include "qwt_plot_marker.h"
@@ -33,64 +35,35 @@ class QwtPlot;
class RiuPlotAnnotationTool class RiuPlotAnnotationTool
{ {
public:
enum class RegionAnnotationType
{
NO_ANNOTATIONS = 0,
FORMATION_ANNOTATIONS = 1,
// Used to have Wbs-parameter coding as 2
RESULT_PROPERTY_ANNOTATIONS = 3
};
enum RegionDisplay
{
DARK_LINES = 0x01,
COLORED_LINES = 0x02,
COLOR_SHADING = 0x04,
COLOR_SHADING_AND_LINES = 0x05,
LIGHT_LINES = 0x08,
};
enum class TrackSpan
{
FULL_WIDTH,
LEFT_COLUMN,
CENTRE_COLUMN,
RIGHT_COLUMN
};
enum class Orientation
{
HORIZONTAL = 0,
VERTICAL
};
public: public:
RiuPlotAnnotationTool(){}; RiuPlotAnnotationTool(){};
~RiuPlotAnnotationTool(); ~RiuPlotAnnotationTool();
void attachNamedRegions( QwtPlot* plot, void attachNamedRegions( QwtPlot* plot,
const std::vector<QString>& names, const std::vector<QString>& names,
const std::pair<double, double> xRange, RiaDefines::Orientation orientation,
const std::vector<std::pair<double, double>>& yPositions, const std::vector<std::pair<double, double>>& regionRanges,
RegionDisplay regionDisplay, RiaDefines::RegionDisplay regionDisplay,
const caf::ColorTable& colorTable, const caf::ColorTable& colorTable,
int shadingAlphaByte, int shadingAlphaByte,
bool showNames = true, bool showNames = true,
TrackSpan trackSpan = TrackSpan::FULL_WIDTH, RiaDefines::TrackSpan trackSpan = RiaDefines::TrackSpan::FULL_WIDTH,
const std::vector<Qt::BrushStyle>& brushStyles = {}, const std::vector<Qt::BrushStyle>& brushStyles = {},
int fontSize = 0 ); int fontSize = 0 );
void attachWellPicks( QwtPlot* plot, const std::vector<QString>& names, const std::vector<double>& yPositions ); void attachWellPicks( QwtPlot* plot, const std::vector<QString>& names, const std::vector<double>& yPositions );
void attachAnnotationLine( QwtPlot* plot, void attachAnnotationLine( QwtPlot* plot,
const QColor& color, const QColor& color,
const QString& annotationText, const QString& annotationText,
const double position, const double position,
Orientation orientation ); RiaDefines::Orientation orientation );
void attachAnnotationRange( QwtPlot* plot, void attachAnnotationRange( QwtPlot* plot,
const QColor& color, const QColor& color,
const QString& annotationText, const QString& annotationText,
const double rangeStart, const double rangeStart,
const double rangeEnd, const double rangeEnd,
Orientation orientation ); RiaDefines::Orientation orientation );
void horizontalRange( const QString& name, void horizontalRange( const QString& name,
const std::pair<double, double> yRange, const std::pair<double, double> yRange,
@@ -105,28 +78,21 @@ public:
Qt::Alignment horizontalAlignment = Qt::AlignRight ); Qt::Alignment horizontalAlignment = Qt::AlignRight );
void detachAllAnnotations(); void detachAllAnnotations();
void detachAllAnnotations( Orientation orientation );
private: private:
static Qt::Alignment trackTextAlignment( TrackSpan trackSpan ); static Qt::Alignment trackTextAlignment( RiaDefines::TrackSpan trackSpan );
static void horizontalDashedLine( QwtPlotMarker* line,
const QString& name,
double yValue,
const QColor& color = QColor( 0, 0, 100 ),
const QColor& textColor = QColor( 0, 0, 100 ),
Qt::Alignment horizontalAlignment = Qt::AlignRight,
int fontSize = 0 );
void verticalLine( QwtPlotMarker* line, static void setLineProperties( QwtPlotMarker* line,
const QString& name, const QString& name,
double xValue, RiaDefines::Orientation orientation,
const QColor& color = QColor( 0, 0, 100 ), double linePosition,
const QColor& textColor = QColor( 0, 0, 100 ), Qt::PenStyle lineStyle = Qt::DashLine,
Qt::PenStyle lineStyle = Qt::DashLine, const QColor& color = QColor( 0, 0, 100 ),
Qt::Alignment horizontalAlignment = Qt::AlignRight | Qt::AlignBottom ); const QColor& textColor = QColor( 0, 0, 100 ),
Qt::Alignment horizontalAlignment = Qt::AlignRight,
int fontSize = 0 );
private: private:
QPointer<QwtPlot> m_plot; QPointer<QwtPlot> m_plot;
std::vector<QwtPlotItem*> m_horizontalMarkers; std::vector<QwtPlotItem*> m_plotItems;
std::vector<QwtPlotItem*> m_verticalMarkers;
}; };

View File

@@ -47,6 +47,7 @@ public:
virtual void useTimeBasedTimeAxis() = 0; virtual void useTimeBasedTimeAxis() = 0;
virtual void clearAnnotationObjects() = 0;
virtual void updateAnnotationObjects( RimPlotAxisPropertiesInterface* axisProperties ) = 0; virtual void updateAnnotationObjects( RimPlotAxisPropertiesInterface* axisProperties ) = 0;
virtual RiuPlotWidget* plotWidget() const = 0; virtual RiuPlotWidget* plotWidget() const = 0;

View File

@@ -73,6 +73,13 @@ void RiuSummaryQtChartsPlot::useTimeBasedTimeAxis()
m_plotWidget->setAxisScaleType( RiuPlotAxis::defaultBottom(), RiuPlotWidget::AxisScaleType::DATE ); m_plotWidget->setAxisScaleType( RiuPlotAxis::defaultBottom(), RiuPlotWidget::AxisScaleType::DATE );
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuSummaryQtChartsPlot::clearAnnotationObjects()
{
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@@ -50,6 +50,7 @@ public:
void useTimeBasedTimeAxis() override; void useTimeBasedTimeAxis() override;
void clearAnnotationObjects() override;
void updateAnnotationObjects( RimPlotAxisPropertiesInterface* axisProperties ) override; void updateAnnotationObjects( RimPlotAxisPropertiesInterface* axisProperties ) override;
RiuPlotWidget* plotWidget() const override; RiuPlotWidget* plotWidget() const override;

View File

@@ -149,12 +149,11 @@ void RiuSummaryQwtPlot::useTimeBasedTimeAxis()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuSummaryQwtPlot::updateAnnotationObjects( RimPlotAxisPropertiesInterface* axisProperties ) 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 ) 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() ) for ( auto annotation : axisProperties->annotations() )
{ {
@@ -221,3 +220,11 @@ RiuPlotWidget* RiuSummaryQwtPlot::plotWidget() const
{ {
return m_plotWidget; return m_plotWidget;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuSummaryQwtPlot::clearAnnotationObjects()
{
m_annotationTool->detachAllAnnotations();
}

View File

@@ -55,6 +55,7 @@ public:
void useTimeBasedTimeAxis() override; void useTimeBasedTimeAxis() override;
void clearAnnotationObjects() override;
void updateAnnotationObjects( RimPlotAxisPropertiesInterface* axisProperties ) override; void updateAnnotationObjects( RimPlotAxisPropertiesInterface* axisProperties ) override;
RiuPlotWidget* plotWidget() const override; RiuPlotWidget* plotWidget() const override;