diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp index c365d41e0d..6fb2df98c9 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp @@ -502,7 +502,7 @@ void RimSummaryCurveCollection::defineEditorAttribute( const caf::PdmFieldHandle //-------------------------------------------------------------------------------------------------- void RimSummaryCurveCollection::onCurvesReordered( const SignalEmitter* emitter ) { - refreshCurveOrdering(); + updateCurveOrder(); curvesChanged.send(); } @@ -545,7 +545,7 @@ void RimSummaryCurveCollection::defineObjectEditorAttribute( QString uiConfigNam //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimSummaryCurveCollection::refreshCurveOrdering() +void RimSummaryCurveCollection::updateCurveOrder() { detachPlotCurves(); reattachPlotCurves(); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.h index a8a133c4a0..29fa373d28 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.h @@ -61,7 +61,7 @@ public: void loadDataAndUpdate( bool updateParentPlot ); - void refreshCurveOrdering(); + void updateCurveOrder(); private: void setParentPlotAndReplot( RiuPlotWidget* plot ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 035af09d97..41f405c1e2 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -2456,7 +2456,7 @@ RiuPlotWidget* RimSummaryPlot::doCreatePlotViewWidget( QWidget* mainWindowParent m_summaryPlot = std::make_unique( this, mainWindowParent ); #endif - QObject::connect( plotWidget(), SIGNAL( curveOrderNeedsUpdate() ), this, SLOT( updateCurveOrder() ) ); + QObject::connect( plotWidget(), SIGNAL( curveOrderNeedsUpdate() ), this, SLOT( onUpdateCurveOrder() ) ); for ( const auto& axisProperties : m_axisProperties ) { @@ -3021,7 +3021,7 @@ RimSummaryPlotSourceStepping* RimSummaryPlot::sourceStepper() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimSummaryPlot::updateCurveOrder() +void RimSummaryPlot::onUpdateCurveOrder() { - m_summaryCurveCollection->refreshCurveOrdering(); + m_summaryCurveCollection->updateCurveOrder(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h index 44a23813e3..31507c497f 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h @@ -252,7 +252,7 @@ protected: private slots: void onPlotZoomed(); - void updateCurveOrder(); + void onUpdateCurveOrder(); private: std::vector visibleSummaryCurvesForAxis( RiuPlotAxis plotAxis ) const; diff --git a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp index 0d4cd136fc..5f933c03e0 100644 --- a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp +++ b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.cpp @@ -925,8 +925,8 @@ void RiuQwtPlotWidget::selectClosestPlotItem( const QPoint& pos, bool toggleItem RiuPlotMainWindowTools::showPlotMainWindow(); if ( closestItem && distanceFromClick < 20 ) { - bool refreshCurveOrder = false; - resetPlotItemHighlighting( refreshCurveOrder ); + bool updateCurveOrder = false; + resetPlotItemHighlighting( updateCurveOrder ); std::set plotItems = { closestItem }; highlightPlotItems( plotItems ); auto plotItem = std::make_shared( closestItem ); @@ -963,53 +963,6 @@ void RiuQwtPlotWidget::replot() //-------------------------------------------------------------------------------------------------- void RiuQwtPlotWidget::highlightPlotItems( const std::set& closestItems ) { - if ( closestItems.size() == 1 ) - { - auto* constPlotCurve = dynamic_cast( *closestItems.begin() ); - auto* plotCurve = const_cast( constPlotCurve ); - - if ( plotCurve ) - { - auto curveColor = plotCurve->pen().color(); - if ( RiaColorTools::isBrightnessAboveThreshold( RiaColorTools::fromQColorTo3f( curveColor ) ) ) - { - // The brightness of selected curve is above threshold. Modify the saturation, and leave the other - // curves unchanged - - QColor symbolColor; - QColor symbolLineColor; - auto* symbol = const_cast( plotCurve->symbol() ); - if ( symbol ) - { - symbolColor = symbol->brush().color(); - symbolLineColor = symbol->pen().color(); - } - - double zValue = plotCurve->z(); - plotCurve->setZ( zValue + 100.0 ); - highlightPlotAxes( plotCurve->xAxis(), plotCurve->yAxis() ); - - auto hightlightColor = curveColor; - qreal h, s, v; - hightlightColor.getHsvF( &h, &s, &v ); - hightlightColor.setHsvF( h, 0.95, v ); - - auto curveWidth = plotCurve->pen().width(); - plotCurve->setPen( hightlightColor, - plotCurve->pen().width() + highlightItemWidthAdjustment(), - plotCurve->pen().style() ); - - CurveProperties properties = { curveColor, symbolColor, symbolLineColor, curveWidth }; - m_originalCurveProperties.insert( std::make_pair( plotCurve, properties ) ); - m_originalZValues.insert( std::make_pair( plotCurve, zValue ) ); - - restoreCurveOrder(); - - return; - } - } - } - auto plotItemList = m_plot->itemList(); for ( QwtPlotItem* plotItem : plotItemList ) { @@ -1070,13 +1023,13 @@ void RiuQwtPlotWidget::highlightPlotItems( const std::set& c } } - restoreCurveOrder(); + updateCurveOrder(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RiuQwtPlotWidget::resetPlotItemHighlighting( bool refreshCurveOrder ) +void RiuQwtPlotWidget::resetPlotItemHighlighting( bool doUpdateCurveOrder ) { auto plotItemList = m_plot->itemList(); for ( QwtPlotItem* plotItem : plotItemList ) @@ -1118,7 +1071,7 @@ void RiuQwtPlotWidget::resetPlotItemHighlighting( bool refreshCurveOrder ) resetPlotAxisHighlighting(); - if ( refreshCurveOrder ) restoreCurveOrder(); + if ( doUpdateCurveOrder ) updateCurveOrder(); } //-------------------------------------------------------------------------------------------------- @@ -1539,7 +1492,7 @@ void RiuQwtPlotWidget::onLegendClicked( const QVariant& itemInfo, int index ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RiuQwtPlotWidget::restoreCurveOrder() +void RiuQwtPlotWidget::updateCurveOrder() { emit curveOrderNeedsUpdate(); } diff --git a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.h b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.h index 4bcb928c29..aec51a3dd3 100644 --- a/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.h +++ b/ApplicationLibCode/UserInterface/RiuQwtPlotWidget.h @@ -215,14 +215,14 @@ private: void highlightPlotAxes( QwtAxisId axisIdX, QwtAxisId axisIdY ); void highlightPlotItemsForQwtAxis( QwtAxisId axisId ); void highlightPlotItems( const std::set& closestItems ); - void resetPlotItemHighlighting( bool refreshCurveOrder = true ); + void resetPlotItemHighlighting( bool doUpdateCurveOrder = true ); void resetPlotAxisHighlighting(); void onAxisSelected( QwtScaleWidget* scale, bool toggleItemInSelection ); void recalculateAxisExtents( RiuPlotAxis axis ); static int highlightItemWidthAdjustment(); - void restoreCurveOrder(); + void updateCurveOrder(); private: struct CurveProperties diff --git a/Fwk/AppFwk/cafUserInterface/cafUserInterface_UnitTests/CMakeLists.txt b/Fwk/AppFwk/cafUserInterface/cafUserInterface_UnitTests/CMakeLists.txt index d66d8b99aa..8618b25be2 100644 --- a/Fwk/AppFwk/cafUserInterface/cafUserInterface_UnitTests/CMakeLists.txt +++ b/Fwk/AppFwk/cafUserInterface/cafUserInterface_UnitTests/CMakeLists.txt @@ -5,9 +5,9 @@ project(cafUserInterface_UnitTests) find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets + REQUIRED Core Gui Widgets Svg ) -set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL) +set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL Qt5::Svg) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index 5a3f6fdb33..6882453f29 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -5,7 +5,7 @@ set(RESINSIGHT_PATCH_VERSION 1) # Opional text with no restrictions #set(RESINSIGHT_VERSION_TEXT "-dev") -set(RESINSIGHT_VERSION_TEXT "-RC_01") +set(RESINSIGHT_VERSION_TEXT "-RC_02") # Optional text # Must be unique and increasing within one combination of major/minor/patch version