mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -77,6 +77,14 @@ void RiuScalarMapperLegendFrame::updateTickValues()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuScalarMapperLegendFrame::setScalarMapper( cvf::ScalarMapper* scalarMapper )
|
||||
{
|
||||
m_scalarMapper = scalarMapper;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user