mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added ternary texture and scalar mappers
This commit is contained in:
@@ -25,9 +25,11 @@
|
||||
#include "RimReservoirView.h"
|
||||
|
||||
#include "RivTernarySaturationOverlayItem.h"
|
||||
#include "RivTernaryScalarMapper.h"
|
||||
|
||||
#include "cvfqtUtils.h"
|
||||
|
||||
#include <cmath>
|
||||
#include "cvfqtUtils.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimTernaryLegendConfig, "RimTernaryLegendConfig");
|
||||
@@ -93,6 +95,8 @@ RimTernaryLegendConfig::RimTernaryLegendConfig()
|
||||
m_localAutoMin.resize(3, 0.0);
|
||||
m_localAutoMax.resize(3, 1.0);
|
||||
|
||||
m_scalarMapper = new RivTernaryScalarMapper(cvf::Color3f::GRAY);
|
||||
|
||||
recreateLegend();
|
||||
updateLegend();
|
||||
}
|
||||
@@ -163,6 +167,7 @@ void RimTernaryLegendConfig::updateLegend()
|
||||
double swatUpper = 1.0;
|
||||
|
||||
ternaryRanges(soilLower, soilUpper, sgasLower, sgasUpper, swatLower, swatUpper);
|
||||
m_scalarMapper->setTernaryRanges(soilLower, soilUpper, sgasLower, sgasUpper);
|
||||
|
||||
cvf::String soilRange;
|
||||
cvf::String sgasRange;
|
||||
@@ -438,3 +443,11 @@ void RimTernaryLegendConfig::updateLabelText()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivTernaryScalarMapper* RimTernaryLegendConfig::scalarMapper()
|
||||
{
|
||||
return m_scalarMapper.p();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
class RimReservoirView;
|
||||
class RivTernarySaturationOverlayItem;
|
||||
class RivTernaryScalarMapper;
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
@@ -70,7 +71,8 @@ public:
|
||||
|
||||
void recreateLegend();
|
||||
|
||||
RivTernarySaturationOverlayItem* legend();
|
||||
RivTernarySaturationOverlayItem* legend();
|
||||
RivTernaryScalarMapper* scalarMapper();
|
||||
|
||||
protected:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||
@@ -106,4 +108,5 @@ private:
|
||||
|
||||
caf::PdmPointer<RimReservoirView> m_reservoirView;
|
||||
cvf::ref<RivTernarySaturationOverlayItem> m_legend;
|
||||
cvf::ref<RivTernaryScalarMapper> m_scalarMapper;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user