mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
Removed ternary specific code and cleaned up includes
This commit is contained in:
@@ -18,27 +18,23 @@
|
|||||||
|
|
||||||
#include "RimLegendConfig.h"
|
#include "RimLegendConfig.h"
|
||||||
|
|
||||||
#include "RimReservoirView.h"
|
|
||||||
#include "cafFactory.h"
|
#include "cafFactory.h"
|
||||||
#include "cafPdmUiLineEditor.h"
|
#include "cafPdmFieldCvfColor.h"
|
||||||
|
#include "cafPdmFieldCvfMat4d.h"
|
||||||
#include "cafPdmUiComboBoxEditor.h"
|
#include "cafPdmUiComboBoxEditor.h"
|
||||||
|
#include "cafPdmUiLineEditor.h"
|
||||||
|
|
||||||
#include "cvfScalarMapperDiscreteLog.h"
|
|
||||||
#include "cvfScalarMapperContinuousLog.h"
|
|
||||||
#include "cvfScalarMapperContinuousLinear.h"
|
|
||||||
#include "cvfOverlayScalarMapperLegend.h"
|
#include "cvfOverlayScalarMapperLegend.h"
|
||||||
|
#include "cvfScalarMapperContinuousLinear.h"
|
||||||
|
#include "cvfScalarMapperContinuousLog.h"
|
||||||
#include "cvfScalarMapperDiscreteLinear.h"
|
#include "cvfScalarMapperDiscreteLinear.h"
|
||||||
|
#include "cvfScalarMapperDiscreteLog.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "cafPdmFieldCvfMat4d.h"
|
#include "RimReservoirView.h"
|
||||||
#include "cafPdmFieldCvfColor.h"
|
|
||||||
#include "RimResultSlot.h"
|
|
||||||
#include "RimCellEdgeResultSlot.h"
|
|
||||||
#include "RimCellRangeFilterCollection.h"
|
|
||||||
#include "RimCellPropertyFilterCollection.h"
|
|
||||||
#include "RimWellCollection.h"
|
|
||||||
#include "Rim3dOverlayInfoConfig.h"
|
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimLegendConfig, "Legend");
|
CAF_PDM_SOURCE_INIT(RimLegendConfig, "Legend");
|
||||||
|
|
||||||
@@ -480,18 +476,6 @@ void RimLegendConfig::updateFieldVisibility()
|
|||||||
m_userDefinedMaxValue.setUiHidden(true);
|
m_userDefinedMaxValue.setUiHidden(true);
|
||||||
m_userDefinedMinValue.setUiHidden(true);
|
m_userDefinedMinValue.setUiHidden(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_reservoirView && m_reservoirView->cellResult() && m_reservoirView->cellResult()->isTernarySaturationSelected())
|
|
||||||
{
|
|
||||||
if (m_mappingMode == LINEAR_DISCRETE)
|
|
||||||
{
|
|
||||||
m_numLevels.setUiHidden(false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_numLevels.setUiHidden(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -647,18 +631,6 @@ void RimLegendConfig::setClosestToZeroValues(double globalPosClosestToZero, doub
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimLegendConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
void RimLegendConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||||
{
|
{
|
||||||
if (m_reservoirView && m_reservoirView->cellResult() && m_reservoirView->cellResult()->isTernarySaturationSelected())
|
|
||||||
{
|
|
||||||
//TODO: Add support for discrete legend
|
|
||||||
// caf::PdmUiOrdering * formatGr = uiOrdering.addNewGroup("Ternary format");
|
|
||||||
// formatGr->add(&m_mappingMode);
|
|
||||||
// formatGr->add(&m_numLevels);
|
|
||||||
caf::PdmUiOrdering * mappingGr = uiOrdering.addNewGroup("Mapping");
|
|
||||||
mappingGr->add(&m_rangeMode);
|
|
||||||
|
|
||||||
uiOrdering.setForgetRemainingFields(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
caf::PdmUiOrdering * formatGr = uiOrdering.addNewGroup("Format");
|
caf::PdmUiOrdering * formatGr = uiOrdering.addNewGroup("Format");
|
||||||
formatGr->add(&m_numLevels);
|
formatGr->add(&m_numLevels);
|
||||||
@@ -674,53 +646,3 @@ void RimLegendConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
/// Return the number of levels if mapping mode is LINEAR_DISCRETE, else -1
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
int RimLegendConfig::linearDiscreteLevelCount() const
|
|
||||||
{
|
|
||||||
if (m_mappingMode == LINEAR_DISCRETE)
|
|
||||||
{
|
|
||||||
return m_numLevels;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
QList<caf::PdmOptionItemInfo> RimLegendConfig::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
|
||||||
{
|
|
||||||
if (m_reservoirView && m_reservoirView->cellResult() && m_reservoirView->cellResult()->isTernarySaturationSelected())
|
|
||||||
{
|
|
||||||
if (fieldNeedingOptions == &m_mappingMode)
|
|
||||||
{
|
|
||||||
QList<caf::PdmOptionItemInfo> optionList;
|
|
||||||
optionList.push_back(caf::PdmOptionItemInfo(MappingEnum(LINEAR_DISCRETE).uiText(), LINEAR_DISCRETE));
|
|
||||||
optionList.push_back(caf::PdmOptionItemInfo(MappingEnum(LINEAR_CONTINUOUS).uiText(), LINEAR_CONTINUOUS));
|
|
||||||
|
|
||||||
return optionList;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fieldNeedingOptions == &m_rangeMode)
|
|
||||||
{
|
|
||||||
QList<caf::PdmOptionItemInfo> optionList;
|
|
||||||
optionList.push_back(caf::PdmOptionItemInfo(RangeModeEnum(AUTOMATIC_ALLTIMESTEPS).uiText(), AUTOMATIC_ALLTIMESTEPS));
|
|
||||||
optionList.push_back(caf::PdmOptionItemInfo(RangeModeEnum(AUTOMATIC_CURRENT_TIMESTEP).uiText(), AUTOMATIC_CURRENT_TIMESTEP));
|
|
||||||
|
|
||||||
return optionList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return QList<caf::PdmOptionItemInfo>();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
RimLegendConfig::RangeModeType RimLegendConfig::rangeMode() const
|
|
||||||
{
|
|
||||||
return m_rangeMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -96,9 +96,6 @@ public:
|
|||||||
cvf::ScalarMapper* scalarMapper() { return m_currentScalarMapper.p(); }
|
cvf::ScalarMapper* scalarMapper() { return m_currentScalarMapper.p(); }
|
||||||
cvf::OverlayScalarMapperLegend* legend() { return m_legend.p(); }
|
cvf::OverlayScalarMapperLegend* legend() { return m_legend.p(); }
|
||||||
|
|
||||||
int linearDiscreteLevelCount() const;
|
|
||||||
RangeModeType rangeMode() const;
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||||
@@ -110,8 +107,6 @@ private:
|
|||||||
cvf::ref<cvf::Color3ubArray> interpolateColorArray(const cvf::Color3ubArray& colorArray, cvf::uint targetColorCount);
|
cvf::ref<cvf::Color3ubArray> interpolateColorArray(const cvf::Color3ubArray& colorArray, cvf::uint targetColorCount);
|
||||||
double roundToNumSignificantDigits(double value, double precision);
|
double roundToNumSignificantDigits(double value, double precision);
|
||||||
|
|
||||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmPointer<RimReservoirView> m_reservoirView;
|
caf::PdmPointer<RimReservoirView> m_reservoirView;
|
||||||
|
|||||||
Reference in New Issue
Block a user