Fix bug in color mapping when changing mapping mode for Tables

* Fix color mapping and ticks in table legend
- For Summary and WellConnectivity
- Add range types: automatic and user defined
- Remove category from mapping type
- Add closest to zero for correct logarithmic scale
---------

Co-authored-by: Magne Sjaastad <magne.sjaastad@ceetronsolutions.com>
This commit is contained in:
Jørgen Herje
2023-06-12 15:44:39 +02:00
committed by GitHub
parent 1335b4bc09
commit 2639c7172f
9 changed files with 175 additions and 9 deletions

View File

@@ -25,6 +25,7 @@
#include "RimViewWindow.h"
#include "RiuAbstractLegendFrame.h"
#include "RiuCategoryLegendFrame.h"
#include "RiuQwtLinearScaleEngine.h"
#include "RiuQwtPlotItem.h"
#include "RiuQwtPlotTools.h"
@@ -176,9 +177,18 @@ void RiuMatrixPlotWidget::createPlot()
createMatrixCells();
scheduleReplot();
auto frame = dynamic_cast<RiuScalarMapperLegendFrame*>( m_legendFrame.data() );
frame->updateTickValues();
frame->update();
auto scalarMapperFrame = dynamic_cast<RiuScalarMapperLegendFrame*>( m_legendFrame.data() );
auto categoryFrame = dynamic_cast<RiuCategoryLegendFrame*>( m_legendFrame.data() );
if ( scalarMapperFrame )
{
scalarMapperFrame->setScalarMapper( m_legendConfig->scalarMapper() );
scalarMapperFrame->updateTickValues();
scalarMapperFrame->update();
}
if ( categoryFrame )
{
categoryFrame->update();
}
}
//--------------------------------------------------------------------------------------------------

View File

@@ -77,6 +77,14 @@ void RiuScalarMapperLegendFrame::updateTickValues()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuScalarMapperLegendFrame::setScalarMapper( cvf::ScalarMapper* scalarMapper )
{
m_scalarMapper = scalarMapper;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -47,6 +47,7 @@ public:
void setTickPrecision( int precision );
void setTickFormat( NumberFormat format );
void updateTickValues();
void setScalarMapper( cvf::ScalarMapper* scalarMapper );
private:
void layoutInfo( LayoutInfo* layout ) const override;