mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Adjustments for RC2
* Add dependency to Svg * Renaming * Remove special handling of bright colored curves For some ensemble cases, the curve highlight does not work well. A prototype for ensemble curve highlight was introduced, but this was not working for a collection of standalone summary curves. * Set version to RC_02
This commit is contained in:
parent
2aedf38f79
commit
b641d6b86f
@ -502,7 +502,7 @@ void RimSummaryCurveCollection::defineEditorAttribute( const caf::PdmFieldHandle
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryCurveCollection::onCurvesReordered( const SignalEmitter* emitter )
|
void RimSummaryCurveCollection::onCurvesReordered( const SignalEmitter* emitter )
|
||||||
{
|
{
|
||||||
refreshCurveOrdering();
|
updateCurveOrder();
|
||||||
curvesChanged.send();
|
curvesChanged.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -545,7 +545,7 @@ void RimSummaryCurveCollection::defineObjectEditorAttribute( QString uiConfigNam
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryCurveCollection::refreshCurveOrdering()
|
void RimSummaryCurveCollection::updateCurveOrder()
|
||||||
{
|
{
|
||||||
detachPlotCurves();
|
detachPlotCurves();
|
||||||
reattachPlotCurves();
|
reattachPlotCurves();
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
|
|
||||||
void loadDataAndUpdate( bool updateParentPlot );
|
void loadDataAndUpdate( bool updateParentPlot );
|
||||||
|
|
||||||
void refreshCurveOrdering();
|
void updateCurveOrder();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setParentPlotAndReplot( RiuPlotWidget* plot );
|
void setParentPlotAndReplot( RiuPlotWidget* plot );
|
||||||
|
@ -2456,7 +2456,7 @@ RiuPlotWidget* RimSummaryPlot::doCreatePlotViewWidget( QWidget* mainWindowParent
|
|||||||
m_summaryPlot = std::make_unique<RiuSummaryQwtPlot>( this, mainWindowParent );
|
m_summaryPlot = std::make_unique<RiuSummaryQwtPlot>( this, mainWindowParent );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QObject::connect( plotWidget(), SIGNAL( curveOrderNeedsUpdate() ), this, SLOT( updateCurveOrder() ) );
|
QObject::connect( plotWidget(), SIGNAL( curveOrderNeedsUpdate() ), this, SLOT( onUpdateCurveOrder() ) );
|
||||||
|
|
||||||
for ( const auto& axisProperties : m_axisProperties )
|
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();
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,7 @@ protected:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onPlotZoomed();
|
void onPlotZoomed();
|
||||||
void updateCurveOrder();
|
void onUpdateCurveOrder();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<RimSummaryCurve*> visibleSummaryCurvesForAxis( RiuPlotAxis plotAxis ) const;
|
std::vector<RimSummaryCurve*> visibleSummaryCurvesForAxis( RiuPlotAxis plotAxis ) const;
|
||||||
|
@ -925,8 +925,8 @@ void RiuQwtPlotWidget::selectClosestPlotItem( const QPoint& pos, bool toggleItem
|
|||||||
RiuPlotMainWindowTools::showPlotMainWindow();
|
RiuPlotMainWindowTools::showPlotMainWindow();
|
||||||
if ( closestItem && distanceFromClick < 20 )
|
if ( closestItem && distanceFromClick < 20 )
|
||||||
{
|
{
|
||||||
bool refreshCurveOrder = false;
|
bool updateCurveOrder = false;
|
||||||
resetPlotItemHighlighting( refreshCurveOrder );
|
resetPlotItemHighlighting( updateCurveOrder );
|
||||||
std::set<const QwtPlotItem*> plotItems = { closestItem };
|
std::set<const QwtPlotItem*> plotItems = { closestItem };
|
||||||
highlightPlotItems( plotItems );
|
highlightPlotItems( plotItems );
|
||||||
auto plotItem = std::make_shared<RiuQwtPlotItem>( closestItem );
|
auto plotItem = std::make_shared<RiuQwtPlotItem>( closestItem );
|
||||||
@ -963,53 +963,6 @@ void RiuQwtPlotWidget::replot()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuQwtPlotWidget::highlightPlotItems( const std::set<const QwtPlotItem*>& closestItems )
|
void RiuQwtPlotWidget::highlightPlotItems( const std::set<const QwtPlotItem*>& closestItems )
|
||||||
{
|
{
|
||||||
if ( closestItems.size() == 1 )
|
|
||||||
{
|
|
||||||
auto* constPlotCurve = dynamic_cast<const QwtPlotCurve*>( *closestItems.begin() );
|
|
||||||
auto* plotCurve = const_cast<QwtPlotCurve*>( 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<QwtSymbol*>( 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();
|
auto plotItemList = m_plot->itemList();
|
||||||
for ( QwtPlotItem* plotItem : plotItemList )
|
for ( QwtPlotItem* plotItem : plotItemList )
|
||||||
{
|
{
|
||||||
@ -1070,13 +1023,13 @@ void RiuQwtPlotWidget::highlightPlotItems( const std::set<const QwtPlotItem*>& c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
restoreCurveOrder();
|
updateCurveOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuQwtPlotWidget::resetPlotItemHighlighting( bool refreshCurveOrder )
|
void RiuQwtPlotWidget::resetPlotItemHighlighting( bool doUpdateCurveOrder )
|
||||||
{
|
{
|
||||||
auto plotItemList = m_plot->itemList();
|
auto plotItemList = m_plot->itemList();
|
||||||
for ( QwtPlotItem* plotItem : plotItemList )
|
for ( QwtPlotItem* plotItem : plotItemList )
|
||||||
@ -1118,7 +1071,7 @@ void RiuQwtPlotWidget::resetPlotItemHighlighting( bool refreshCurveOrder )
|
|||||||
|
|
||||||
resetPlotAxisHighlighting();
|
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();
|
emit curveOrderNeedsUpdate();
|
||||||
}
|
}
|
||||||
|
@ -215,14 +215,14 @@ private:
|
|||||||
void highlightPlotAxes( QwtAxisId axisIdX, QwtAxisId axisIdY );
|
void highlightPlotAxes( QwtAxisId axisIdX, QwtAxisId axisIdY );
|
||||||
void highlightPlotItemsForQwtAxis( QwtAxisId axisId );
|
void highlightPlotItemsForQwtAxis( QwtAxisId axisId );
|
||||||
void highlightPlotItems( const std::set<const QwtPlotItem*>& closestItems );
|
void highlightPlotItems( const std::set<const QwtPlotItem*>& closestItems );
|
||||||
void resetPlotItemHighlighting( bool refreshCurveOrder = true );
|
void resetPlotItemHighlighting( bool doUpdateCurveOrder = true );
|
||||||
void resetPlotAxisHighlighting();
|
void resetPlotAxisHighlighting();
|
||||||
void onAxisSelected( QwtScaleWidget* scale, bool toggleItemInSelection );
|
void onAxisSelected( QwtScaleWidget* scale, bool toggleItemInSelection );
|
||||||
void recalculateAxisExtents( RiuPlotAxis axis );
|
void recalculateAxisExtents( RiuPlotAxis axis );
|
||||||
|
|
||||||
static int highlightItemWidthAdjustment();
|
static int highlightItemWidthAdjustment();
|
||||||
|
|
||||||
void restoreCurveOrder();
|
void updateCurveOrder();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct CurveProperties
|
struct CurveProperties
|
||||||
|
@ -5,9 +5,9 @@ project(cafUserInterface_UnitTests)
|
|||||||
find_package(
|
find_package(
|
||||||
Qt5
|
Qt5
|
||||||
COMPONENTS
|
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})
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ set(RESINSIGHT_PATCH_VERSION 1)
|
|||||||
|
|
||||||
# Opional text with no restrictions
|
# Opional text with no restrictions
|
||||||
#set(RESINSIGHT_VERSION_TEXT "-dev")
|
#set(RESINSIGHT_VERSION_TEXT "-dev")
|
||||||
set(RESINSIGHT_VERSION_TEXT "-RC_01")
|
set(RESINSIGHT_VERSION_TEXT "-RC_02")
|
||||||
|
|
||||||
# Optional text
|
# Optional text
|
||||||
# Must be unique and increasing within one combination of major/minor/patch version
|
# Must be unique and increasing within one combination of major/minor/patch version
|
||||||
|
Loading…
Reference in New Issue
Block a user